]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - tests/stress/static-function-put.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / static-function-put.js
diff --git a/tests/stress/static-function-put.js b/tests/stress/static-function-put.js
new file mode 100644 (file)
index 0000000..d47d5c8
--- /dev/null
@@ -0,0 +1,11 @@
+function shouldBe(actual, expected) {
+    if (actual !== expected)
+        throw new Error('bad value: ' + actual);
+}
+var exec = RegExp.prototype.exec;
+var nested = Object.create(RegExp.prototype);
+
+nested.exec = "Hello";
+shouldBe(nested.hasOwnProperty('exec'), true);
+shouldBe(nested.exec, "Hello");
+shouldBe(/hello/.exec, exec);