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