diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /js/src/tests/test262/ch11/11.4/11.4.1 | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'js/src/tests/test262/ch11/11.4/11.4.1')
79 files changed, 1929 insertions, 0 deletions
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-0-1.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-0-1.js new file mode 100644 index 000000000..2a3407dd5 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-0-1.js @@ -0,0 +1,26 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * This test is actually testing the [[Delete]] internal method (8.12.8). Since the
+ * language provides no way to directly exercise [[Delete]], the tests are placed here.
+ *
+ * @path ch11/11.4/11.4.1/11.4.1-0-1.js
+ * @description delete operator as UnaryExpression
+ */
+
+
+function testcase() {
+ var x = 1;
+ var y = 2;
+ var z = 3;
+
+ if( (!delete x || delete y) &&
+ delete delete z)
+ {
+ return true;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-2-1.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-2-1.js new file mode 100644 index 000000000..223de50d5 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-2-1.js @@ -0,0 +1,18 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-2-1.js
+ * @description delete operator returns true when deleting a non-reference (number)
+ */
+
+
+function testcase() {
+ var d = delete 42;
+ if (d === true) {
+ return true;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-2-2.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-2-2.js new file mode 100644 index 000000000..eed36f4c5 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-2-2.js @@ -0,0 +1,20 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-2-2.js
+ * @description delete operator returns true when deleting returned value from a function
+ */
+
+
+function testcase() {
+ var bIsFooCalled = false;
+ var foo = function(){bIsFooCalled = true;};
+
+ var d = delete foo();
+ if(d === true && bIsFooCalled === true)
+ return true;
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-2-3.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-2-3.js new file mode 100644 index 000000000..5d8fc9bce --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-2-3.js @@ -0,0 +1,18 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-2-3.js
+ * @description delete operator returns true when deleting a non-reference (boolean)
+ */
+
+
+function testcase() {
+ var d = delete true;
+ if (d === true) {
+ return true;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-2-4.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-2-4.js new file mode 100644 index 000000000..3da874599 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-2-4.js @@ -0,0 +1,18 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-2-4.js
+ * @description delete operator returns true when deleting a non-reference (string)
+ */
+
+
+function testcase() {
+ var d = delete "abc";
+ if (d === true) {
+ return true;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-2-5.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-2-5.js new file mode 100644 index 000000000..ae32bebce --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-2-5.js @@ -0,0 +1,18 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-2-5.js
+ * @description delete operator returns true when deleting a non-reference (obj)
+ */
+
+
+function testcase() {
+ var d = delete {a:0} ;
+ if (d === true) {
+ return true;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-2-6.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-2-6.js new file mode 100644 index 000000000..bcee797c2 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-2-6.js @@ -0,0 +1,18 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-2-6.js
+ * @description delete operator returns true when deleting a non-reference (null)
+ */
+
+
+function testcase() {
+ var d = delete null;
+ if (d === true) {
+ return true;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-3-1.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-3-1.js new file mode 100644 index 000000000..9ae258064 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-3-1.js @@ -0,0 +1,19 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-3-1.js
+ * @description delete operator returns true when deleting an unresolvable reference
+ */
+
+
+function testcase() {
+ // just cooking up a long/veryLikely unique name
+ var d = delete __ES3_1_test_suite_test_11_4_1_3_unique_id_0__;
+ if (d === true) {
+ return true;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-3-2.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-3-2.js new file mode 100644 index 000000000..fefff3071 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-3-2.js @@ -0,0 +1,24 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-3-2.js
+ * @description delete operator throws ReferenceError when deleting an explicitly qualified yet unresolvable reference (base obj undefined)
+ */
+
+
+function testcase() {
+ // just cooking up a long/veryLikely unique name
+ try
+ {
+ var d = delete __ES3_1_test_suite_test_11_4_1_3_unique_id_2__.x;
+ }
+ catch(e)
+ {
+ if (e instanceof ReferenceError)
+ return true;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-3-3.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-3-3.js new file mode 100644 index 000000000..1f70cca92 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-3-3.js @@ -0,0 +1,19 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-3-3.js
+ * @description delete operator returns true when deleting an explicitly qualified yet unresolvable reference (property undefined for base obj)
+ */
+
+
+function testcase() {
+ var __ES3_1_test_suite_test_11_4_1_3_unique_id_3__ = {};
+ var d = delete __ES3_1_test_suite_test_11_4_1_3_unique_id_3__.x;
+ if (d === true) {
+ return true;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-3-a-1-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-3-a-1-s.js new file mode 100644 index 000000000..7172421d0 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-3-a-1-s.js @@ -0,0 +1,23 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-3-a-1-s.js
+ * @description Strict Mode - SyntaxError is thrown when deleting an un-resolvable reference
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+
+ try {
+ eval("delete obj");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4-a-1-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4-a-1-s.js new file mode 100644 index 000000000..82c586a1f --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4-a-1-s.js @@ -0,0 +1,28 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-4-a-1-s.js
+ * @description Strict Mode - TypeError is thrown when deleting non-configurable data property
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ var obj = {};
+ Object.defineProperty(obj, "prop", {
+ value: "abc",
+ configurable: false
+ });
+
+ try {
+ delete obj.prop;
+ return false;
+ } catch (e) {
+ return e instanceof TypeError && obj.prop === "abc";
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4-a-2-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4-a-2-s.js new file mode 100644 index 000000000..135f01295 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4-a-2-s.js @@ -0,0 +1,30 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-4-a-2-s.js
+ * @description Strict Mode - TypeError is thrown when deleting non-configurable accessor property
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ var obj = {};
+ Object.defineProperty(obj, "prop", {
+ get: function () {
+ return "abc";
+ },
+ configurable: false
+ });
+
+ try {
+ delete obj.prop;
+ return false;
+ } catch (e) {
+ return e instanceof TypeError && obj.prop === "abc";
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4-a-3-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4-a-3-s.js new file mode 100644 index 000000000..85bc8b2d7 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4-a-3-s.js @@ -0,0 +1,24 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-4-a-3-s.js
+ * @description Strict Mode - TypeError isn't thrown when deleting configurable data property
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ var obj = {};
+ Object.defineProperty(obj, "prop", {
+ value: "abc",
+ configurable: true
+ });
+
+ delete obj.prop;
+ return !obj.hasOwnProperty("prop");
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4-a-4-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4-a-4-s.js new file mode 100644 index 000000000..6ce81cfbc --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4-a-4-s.js @@ -0,0 +1,26 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-4-a-4-s.js
+ * @description Strict Mode - TypeError isn't thrown when deleting configurable accessor property
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ var obj = {};
+ Object.defineProperty(obj, "prop", {
+ get: function () {
+ return "abc";
+ },
+ configurable: true
+ });
+
+ delete obj.prop;
+ return !obj.hasOwnProperty("prop");
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-1.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-1.js new file mode 100644 index 000000000..0ed36af96 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-1.js @@ -0,0 +1,26 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * This test is actually testing the [[Delete]] internal method (8.12.8). Since the
+ * language provides no way to directly exercise [[Delete]], the tests are placed here.
+ *
+ * @path ch11/11.4/11.4.1/11.4.1-4.a-1.js
+ * @description delete operator returns true when deleting a configurable data property
+ */
+
+
+function testcase() {
+ var o = {};
+
+ var desc = { value: 1, configurable: true };
+ Object.defineProperty(o, "foo", desc);
+
+ var d = delete o.foo;
+ if (d === true && o.hasOwnProperty("foo") === false) {
+ return true;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-10.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-10.js new file mode 100644 index 000000000..7a515d725 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-10.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * This test is actually testing the [[Delete]] internal method (8.12.8). Since the
+ * language provides no way to directly exercise [[Delete]], the tests are placed here.
+ *
+ * @path ch11/11.4/11.4.1/11.4.1-4.a-10.js
+ * @description delete operator returns true for property (stringify) defined on built-in object (JSON)
+ */
+
+
+function testcase() {
+ try {
+ var o = JSON.stringify;
+ var desc;
+ try {
+ desc = Object.getOwnPropertyDescriptor(JSON, 'stringify')
+ }
+ catch (e) {
+ };
+ var d = delete JSON.stringify;
+ if (d === true && JSON.stringify === undefined) {
+ return true;
+ }
+ } finally {
+ if (desc) Object.defineProperty(JSON, 'stringify', desc)
+ else JSON.stringify = o /* this branch messes up the attributes */;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-11.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-11.js new file mode 100644 index 000000000..b46af9f74 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-11.js @@ -0,0 +1,24 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * This test is actually testing the [[Delete]] internal method (8.12.8). Since the
+ * language provides no way to directly exercise [[Delete]], the tests are placed here.
+ *
+ * @path ch11/11.4/11.4.1/11.4.1-4.a-11.js
+ * @description delete operator returns true on deleting arguments propterties(arguments.callee)
+ */
+
+
+function testcase() {
+ function foo(a,b)
+ {
+ return (delete arguments.callee);
+ }
+ var d = delete arguments.callee;
+ if(d === true && arguments.callee === undefined)
+ return true;
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-12.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-12.js new file mode 100644 index 000000000..5cc30983c --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-12.js @@ -0,0 +1,23 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * This test is actually testing the [[Delete]] internal method (8.12.8). Since the
+ * language provides no way to directly exercise [[Delete]], the tests are placed here.
+ *
+ * @path ch11/11.4/11.4.1/11.4.1-4.a-12.js
+ * @description delete operator returns false when deleting a property(length)
+ */
+
+
+function testcase() {
+
+ var a = [1,2,3]
+ a.x = 10;
+ var d = delete a.length
+ if(d === false && a.length === 3)
+ return true;
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-13.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-13.js new file mode 100644 index 000000000..5156957ed --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-13.js @@ -0,0 +1,25 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * This test is actually testing the [[Delete]] internal method (8.12.8). Since the
+ * language provides no way to directly exercise [[Delete]], the tests are placed here.
+ *
+ * @path ch11/11.4/11.4.1/11.4.1-4.a-13.js
+ * @description delete operator returns false when deleting Array object
+ */
+
+
+function testcase() {
+
+ var a = [1,2,3]
+ a.x = 10;
+
+ var d = delete a
+
+ if(d === false && Array.isArray(a) === true)
+ return true;
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-14.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-14.js new file mode 100644 index 000000000..288d25ec0 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-14.js @@ -0,0 +1,23 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * This test is actually testing the [[Delete]] internal method (8.12.8). Since the
+ * language provides no way to directly exercise [[Delete]], the tests are placed here.
+ *
+ * @path ch11/11.4/11.4.1/11.4.1-4.a-14.js
+ * @description delete operator returns true when deleting Array elements
+ */
+
+
+function testcase() {
+
+ var a = [1,2,3]
+ a.x = 10;
+ var d = delete a[1]
+ if(d === true && a[1] === undefined)
+ return true;
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-15.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-15.js new file mode 100644 index 000000000..98a6d6c08 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-15.js @@ -0,0 +1,23 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * This test is actually testing the [[Delete]] internal method (8.12.8). Since the
+ * language provides no way to directly exercise [[Delete]], the tests are placed here.
+ *
+ * @path ch11/11.4/11.4.1/11.4.1-4.a-15.js
+ * @description delete operator returns true when deleting Array expandos
+ */
+
+
+function testcase() {
+
+ var a = [1,2,3]
+ a.x = 10;
+ var d = delete a.x;
+ if( d === true && a.x === undefined)
+ return true;
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-16.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-16.js new file mode 100644 index 000000000..01873811f --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-16.js @@ -0,0 +1,20 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * This test is actually testing the [[Delete]] internal method (8.12.8). Since the
+ * language provides no way to directly exercise [[Delete]], the tests are placed here.
+ *
+ * @path ch11/11.4/11.4.1/11.4.1-4.a-16.js
+ * @description delete operator returns false on deleting arguments object
+ */
+
+
+function testcase() {
+
+ if(delete arguments === false && arguments !== undefined)
+ return true;
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-17.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-17.js new file mode 100644 index 000000000..97f0e0ab9 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-17.js @@ -0,0 +1,25 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * This test is actually testing the [[Delete]] internal method (8.12.8). Since the
+ * language provides no way to directly exercise [[Delete]], the tests are placed here.
+ *
+ * @path ch11/11.4/11.4.1/11.4.1-4.a-17.js
+ * @description delete operator returns true on deleting a arguments element
+ */
+
+
+function testcase() {
+ function foo(a,b)
+ {
+ var d = delete arguments[0];
+ return (d === true && arguments[0] === undefined);
+ }
+
+ if(foo(1,2) === true)
+ return true;
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-2.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-2.js new file mode 100644 index 000000000..be165f1f1 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-2.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * This test is actually testing the [[Delete]] internal method (8.12.8). Since the
+ * language provides no way to directly exercise [[Delete]], the tests are placed here.
+ *
+ * @path ch11/11.4/11.4.1/11.4.1-4.a-2.js
+ * @description delete operator returns true when deleting a configurable accessor property
+ */
+
+
+function testcase() {
+ var o = {};
+
+ // define an accessor
+ // dummy getter
+ var getter = function () { return 1; }
+ var desc = { get: getter, configurable: true };
+ Object.defineProperty(o, "foo", desc);
+
+ var d = delete o.foo;
+ if (d === true && o.hasOwnProperty("foo") === false) {
+ return true;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-3-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-3-s.js new file mode 100644 index 000000000..85e5c23db --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-3-s.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * This test is actually testing the [[Delete]] internal method (8.12.8). Since the
+ * language provides no way to directly exercise [[Delete]], the tests are placed here.
+ *
+ * @path ch11/11.4/11.4.1/11.4.1-4.a-3-s.js
+ * @description delete operator throws TypeError when deleting a non-configurable data property in strict mode
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ 'use strict';
+
+ var o = {};
+ var desc = { value : 1 }; // all other attributes default to false
+ Object.defineProperty(o, "foo", desc);
+
+ // Now, deleting o.foo should throw TypeError because [[Configurable]] on foo is false.
+ try {
+ delete o.foo;
+ return false;
+ }
+ catch (e) {
+ return (e instanceof TypeError);
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-3.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-3.js new file mode 100644 index 000000000..25f9bc7d0 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-3.js @@ -0,0 +1,26 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * This test is actually testing the [[Delete]] internal method (8.12.8). Since the
+ * language provides no way to directly exercise [[Delete]], the tests are placed here.
+ *
+ * @path ch11/11.4/11.4.1/11.4.1-4.a-3.js
+ * @description delete operator returns false when deleting a non-configurable data property
+ */
+
+
+function testcase() {
+ var o = {};
+ var desc = { value : 1, configurable: false }; // all other attributes default to false
+ Object.defineProperty(o, "foo", desc);
+
+ // Now, deleting o.foo should fail because [[Configurable]] on foo is false.
+ var d = delete o.foo;
+ if (d === false && o.hasOwnProperty("foo") === true) {
+ return true;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-4.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-4.js new file mode 100644 index 000000000..98f2496f9 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-4.js @@ -0,0 +1,22 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * This test is actually testing the [[Delete]] internal method (8.12.8). Since the
+ * language provides no way to directly exercise [[Delete]], the tests are placed here.
+ *
+ * @path ch11/11.4/11.4.1/11.4.1-4.a-4.js
+ * @description delete operator returns false when deleting a non-configurable data property (NaN)
+ */
+
+
+function testcase() {
+ // NaN (15.1.1.1) has [[Configurable]] set to false.
+ var d = delete NaN;
+ if (d === false) {
+ return true;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-5.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-5.js new file mode 100644 index 000000000..0585bb3c4 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-5.js @@ -0,0 +1,28 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * This test is actually testing the [[Delete]] internal method (8.12.8). Since the
+ * language provides no way to directly exercise [[Delete]], the tests are placed here.
+ *
+ * @path ch11/11.4/11.4.1/11.4.1-4.a-5.js
+ * @description delete operator returns false when deleting the environment object inside 'with'
+ */
+
+
+function testcase() {
+ var o = new Object();
+ o.x = 1;
+ var d;
+ with(o)
+ {
+ d = delete o;
+ }
+ if (d === false && typeof(o) === 'object' && o.x === 1) {
+ return true;
+ }
+ return false;
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-6.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-6.js new file mode 100644 index 000000000..a5194837f --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-6.js @@ -0,0 +1,27 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * This test is actually testing the [[Delete]] internal method (8.12.8). Since the
+ * language provides no way to directly exercise [[Delete]], the tests are placed here.
+ *
+ * @path ch11/11.4/11.4.1/11.4.1-4.a-6.js
+ * @description delete operator returns true when deleting a property inside 'with'
+ */
+
+
+function testcase() {
+ var o = new Object();
+ o.x = 1;
+ var d;
+ with(o)
+ {
+ d = delete x;
+ }
+ if (d === true && o.x === undefined) {
+ return true;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-7.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-7.js new file mode 100644 index 000000000..85bbe995d --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-7.js @@ -0,0 +1,23 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * This test is actually testing the [[Delete]] internal method (8.12.8). Since the
+ * language provides no way to directly exercise [[Delete]], the tests are placed here.
+ *
+ * @path ch11/11.4/11.4.1/11.4.1-4.a-7.js
+ * @description delete operator inside 'eval'
+ */
+
+
+function testcase() {
+ var x = 1;
+ var d = eval("delete x");
+ if (d === false && x === 1) {
+ return true;
+ }
+ return false;
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-8-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-8-s.js new file mode 100644 index 000000000..c73f8d833 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-8-s.js @@ -0,0 +1,28 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * This test is actually testing the [[Delete]] internal method (8.12.8). Since the
+ * language provides no way to directly exercise [[Delete]], the tests are placed here.
+ *
+ * @path ch11/11.4/11.4.1/11.4.1-4.a-8-s.js
+ * @description delete operator throws TypeError when deleting a non-configurable data property in strict mode
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ 'use strict';
+
+ // NaN (15.1.1.1) has [[Configurable]] set to false.
+ try {
+ delete fnGlobalObject().NaN;
+ return false;
+ }
+ catch (e) {
+ return (e instanceof TypeError);
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-8.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-8.js new file mode 100644 index 000000000..0d6da1a80 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-8.js @@ -0,0 +1,26 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * This test is actually testing the [[Delete]] internal method (8.12.8). Since the
+ * language provides no way to directly exercise [[Delete]], the tests are placed here.
+ *
+ * @path ch11/11.4/11.4.1/11.4.1-4.a-8.js
+ * @description delete operator returns true for built-in objects (JSON)
+ */
+
+
+function testcase() {
+ try {
+ var o = JSON;
+ var d = delete JSON;
+ if (d === true) {
+ return true;
+ }
+ } finally {
+ JSON = o;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-9-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-9-s.js new file mode 100644 index 000000000..da7a464ba --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-9-s.js @@ -0,0 +1,27 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * This test is actually testing the [[Delete]] internal method (8.12.8). Since the
+ * language provides no way to directly exercise [[Delete]], the tests are placed here.
+ *
+ * @path ch11/11.4/11.4.1/11.4.1-4.a-9-s.js
+ * @description delete operator throws TypeError when deleting a non-configurable data property (Math.LN2) in strict mode
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ 'use strict';
+
+ try {
+ delete Math.LN2;
+ return false;
+ }
+ catch (e) {
+ return (e instanceof TypeError);
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-9.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-9.js new file mode 100644 index 000000000..472fdc0c8 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-4.a-9.js @@ -0,0 +1,21 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * This test is actually testing the [[Delete]] internal method (8.12.8). Since the
+ * language provides no way to directly exercise [[Delete]], the tests are placed here.
+ *
+ * @path ch11/11.4/11.4.1/11.4.1-4.a-9.js
+ * @description delete operator returns false when deleting a non-configurable data property (Math.LN2)
+ */
+
+
+function testcase() {
+ var d = delete Math.LN2;
+ if (d === false) {
+ return true;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-1.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-1.js new file mode 100644 index 000000000..c4de1ba6f --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-1.js @@ -0,0 +1,20 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-5-1.js
+ * @description delete operator returns false when deleting a direct reference to a var
+ */
+
+
+function testcase() {
+ var x = 1;
+
+ // Now, deleting 'x' directly should fail;
+ var d = delete x;
+ if(d === false && x === 1)
+ return true;
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-2.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-2.js new file mode 100644 index 000000000..838b653b1 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-2.js @@ -0,0 +1,23 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-5-2.js
+ * @description delete operator returns false when deleting a direct reference to a function argument
+ */
+
+
+function testcase() {
+
+ function foo(a,b) {
+
+ // Now, deleting 'a' directly should fail
+ // because 'a' is direct reference to a function argument;
+ var d = delete a;
+ return (d === false && a === 1);
+ }
+ return foo(1,2);
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-3.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-3.js new file mode 100644 index 000000000..33efcdb3e --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-3.js @@ -0,0 +1,20 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-5-3.js
+ * @description delete operator returns false when deleting a direct reference to a function name
+ */
+
+
+function testcase() {
+ var foo = function(){};
+
+ // Now, deleting 'foo' directly should fail;
+ var d = delete foo;
+ if(d === false && fnExists(foo))
+ return true;
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-1-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-1-s.js new file mode 100644 index 000000000..3235f6aff --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-1-s.js @@ -0,0 +1,24 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-5-a-1-s.js
+ * @description Strict Mode - SyntaxError is thrown when deleting a variable which is a primitive value type (number)
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ var _11_4_1_5 = 5;
+
+ try {
+ eval("delete _11_4_1_5;");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-10-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-10-s.js new file mode 100644 index 000000000..6d614fb99 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-10-s.js @@ -0,0 +1,24 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-5-a-10-s.js
+ * @description Strict Mode - SyntaxError is thrown when deleting a variable of type Array
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ var arrObj = [1,2,3];
+
+ try {
+ eval("delete arrObj;");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-11-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-11-s.js new file mode 100644 index 000000000..328b4926f --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-11-s.js @@ -0,0 +1,24 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-5-a-11-s.js
+ * @description Strict Mode - SyntaxError is thrown when deleting a variable of type String
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ var strObj = new String("abc");
+
+ try {
+ eval("delete strObj;");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-12-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-12-s.js new file mode 100644 index 000000000..e09226b1d --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-12-s.js @@ -0,0 +1,24 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-5-a-12-s.js
+ * @description Strict Mode - SyntaxError is thrown when deleting a variable of type Boolean
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ var boolObj = new Boolean(false);
+
+ try {
+ eval("delete boolObj;");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-13-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-13-s.js new file mode 100644 index 000000000..008466068 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-13-s.js @@ -0,0 +1,24 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-5-a-13-s.js
+ * @description Strict Mode - SyntaxError is thrown when deleting a variable of type Number
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ var numObj = new Number(0);
+
+ try {
+ eval("delete numObj;");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-14-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-14-s.js new file mode 100644 index 000000000..8d6770b27 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-14-s.js @@ -0,0 +1,24 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-5-a-14-s.js
+ * @description Strict Mode - SyntaxError is thrown when deleting a variable of type Date
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ var dateObj = new Date();
+
+ try {
+ eval("delete dateObj;");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-15-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-15-s.js new file mode 100644 index 000000000..3ce568c6a --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-15-s.js @@ -0,0 +1,24 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-5-a-15-s.js
+ * @description Strict Mode - SyntaxError is thrown when deleting a variable of type RegExp
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ var regObj = new RegExp();
+
+ try {
+ eval("delete regObj;");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-16-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-16-s.js new file mode 100644 index 000000000..0edd4401f --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-16-s.js @@ -0,0 +1,24 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-5-a-16-s.js
+ * @description Strict Mode - SyntaxError is thrown when deleting a variable of type Error
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ var errObj = new Error();
+
+ try {
+ eval("delete errObj;");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-17-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-17-s.js new file mode 100644 index 000000000..2cb8fedef --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-17-s.js @@ -0,0 +1,23 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-5-a-17-s.js
+ * @description Strict Mode - SyntaxError is thrown when deleting a variable of type Arguments
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ try {
+ eval("var argObj = (function (a, b) { delete arguments; }(1, 2));");
+
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-18-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-18-s.js new file mode 100644 index 000000000..d26819ff7 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-18-s.js @@ -0,0 +1,23 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-5-a-18-s.js
+ * @description Strict Mode - SyntaxError is thrown when deleting a built-in (Object)
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+
+ try {
+ eval("delete Object;");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-19-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-19-s.js new file mode 100644 index 000000000..c45a701b0 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-19-s.js @@ -0,0 +1,23 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-5-a-19-s.js
+ * @description Strict Mode - SyntaxError is thrown when deleting a built-in (Function)
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+
+ try {
+ eval("delete Function;");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-2-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-2-s.js new file mode 100644 index 000000000..aa5290faa --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-2-s.js @@ -0,0 +1,26 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-5-a-2-s.js
+ * @description Strict Mode - SyntaxError is thrown when deleting a function parameter
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ function funObj(x) {
+ eval("delete x;");
+ }
+
+ try {
+ funObj(1);
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-20-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-20-s.js new file mode 100644 index 000000000..cf683589c --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-20-s.js @@ -0,0 +1,23 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-5-a-20-s.js
+ * @description Strict Mode - SyntaxError is thrown when deleting a built-in (Array)
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+
+ try {
+ eval("delete Array;");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-21-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-21-s.js new file mode 100644 index 000000000..994e6ff96 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-21-s.js @@ -0,0 +1,23 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-5-a-21-s.js
+ * @description Strict Mode - SyntaxError is thrown when deleting a built-in (String)
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+
+ try {
+ eval("delete String;");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-22-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-22-s.js new file mode 100644 index 000000000..341062b03 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-22-s.js @@ -0,0 +1,23 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-5-a-22-s.js
+ * @description Strict Mode - SyntaxError is thrown when deleting a built-in (Boolean)
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+
+ try {
+ eval("delete Boolean;");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-23-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-23-s.js new file mode 100644 index 000000000..b0302df8b --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-23-s.js @@ -0,0 +1,23 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-5-a-23-s.js
+ * @description Strict Mode - SyntaxError is thrown when deleting a built-in (Number)
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+
+ try {
+ eval("delete Number;");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-24-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-24-s.js new file mode 100644 index 000000000..0f03df1a7 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-24-s.js @@ -0,0 +1,23 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-5-a-24-s.js
+ * @description Strict Mode - SyntaxError is thrown when deleting a built-in (Date)
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+
+ try {
+ eval("delete Date;");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-25-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-25-s.js new file mode 100644 index 000000000..0f418645a --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-25-s.js @@ -0,0 +1,23 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-5-a-25-s.js
+ * @description Strict Mode - SyntaxError is thrown when deleting a built-in (RegExp)
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+
+ try {
+ eval("delete RegExp;");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-26-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-26-s.js new file mode 100644 index 000000000..62ed21fc3 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-26-s.js @@ -0,0 +1,26 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-5-a-26-s.js
+ * @description Strict Mode - SyntaxError is thrown when deleting a built-in (Error)
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ var errorBackup = Error;
+ try {
+ eval("delete Error;");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ } finally {
+ Error = errorBackup;
+ }
+
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-27-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-27-s.js new file mode 100644 index 000000000..4dacb29bd --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-27-s.js @@ -0,0 +1,25 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-5-a-27-s.js
+ * @description Strict Mode - TypeError is thrown after deleting a property, calling preventExtensions, and attempting to reassign the property
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ var a = {x:0, get y() { return 0;}};
+ delete a.x;
+ Object.preventExtensions(a);
+ try {
+ a.x = 1;
+ return false;
+ } catch (e) {
+ return e instanceof TypeError;
+ }
+}
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-28-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-28-s.js new file mode 100644 index 000000000..4a5e015c3 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-28-s.js @@ -0,0 +1,23 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-5-a-28-s.js
+ * @description Strict Mode - TypeError is thrown when deleting RegExp.length
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ var a = new RegExp();
+ try {
+ var b = delete RegExp.length;
+ return false;
+ } catch (e) {
+ return e instanceof TypeError;
+ }
+}
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-3-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-3-s.js new file mode 100644 index 000000000..3c1e18390 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-3-s.js @@ -0,0 +1,24 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-5-a-3-s.js
+ * @description Strict Mode - SyntaxError is thrown when deleting a function name
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ function funObj () { }
+
+ try {
+ eval("delete funObj");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-4-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-4-s.js new file mode 100644 index 000000000..55bca492b --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-4-s.js @@ -0,0 +1,26 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-5-a-4-s.js
+ * @description Strict Mode - SyntaxError is thrown when deleting a function parameter
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ function funObj(x, y, z) {
+ eval("delete y;");
+ }
+
+ try {
+ funObj(1);
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-5-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-5-s.js new file mode 100644 index 000000000..4e72bc917 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-5-s.js @@ -0,0 +1,24 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-5-a-5-s.js
+ * @description Strict Mode - SyntaxError is thrown when deleting a variable which is a primitive type (boolean)
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ var _11_4_1_5 = true;
+
+ try {
+ eval("delete _11_4_1_5;");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-5gs.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-5gs.js new file mode 100644 index 000000000..ed126f668 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-5gs.js @@ -0,0 +1,15 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-5-a-5gs.js
+ * @description Strict Mode - SyntaxError is thrown when deleting a variable which is primitive type(boolean)
+ * @onlyStrict
+ * @negative ^((?!NotEarlyError).)*$
+ */
+"use strict";
+var _11_4_1_5 = 7;
+throw NotEarlyError;
+delete _11_4_1_5;
\ No newline at end of file diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-6-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-6-s.js new file mode 100644 index 000000000..f428dfeb6 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-6-s.js @@ -0,0 +1,24 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-5-a-6-s.js
+ * @description Strict Mode - SyntaxError is thrown when deleting a variable which is a primitive type (string)
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ var _11_4_1_5 = "abc";
+
+ try {
+ eval("delete _11_4_1_5;");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-7-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-7-s.js new file mode 100644 index 000000000..090276fd7 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-7-s.js @@ -0,0 +1,24 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-5-a-7-s.js
+ * @description Strict Mode - SyntaxError is thrown when deleting a variable of type Object
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ var obj = new Object();
+
+ try {
+ eval("delete obj;");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-8-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-8-s.js new file mode 100644 index 000000000..3116d6bc7 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-8-s.js @@ -0,0 +1,24 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-5-a-8-s.js
+ * @description Strict Mode - SyntaxError is thrown when deleting a function object
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ var funObj = function () { };
+
+ try {
+ eval("delete funObj;");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-9-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-9-s.js new file mode 100644 index 000000000..45b626551 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.1-5-a-9-s.js @@ -0,0 +1,24 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.4/11.4.1/11.4.1-5-a-9-s.js
+ * @description Strict Mode - SyntaxError is thrown when deleting a variable of type function (declaration)
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ function funObj () { };
+
+ try {
+ eval("delete funObj;");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/11.4.4-4.a-3-s.js b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.4-4.a-3-s.js new file mode 100644 index 000000000..109216dea --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/11.4.4-4.a-3-s.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * This test is actually testing the [[Delete]] internal method (8.12.8). Since the
+ * language provides no way to directly exercise [[Delete]], the tests are placed here.
+ *
+ * @path ch11/11.4/11.4.1/11.4.4-4.a-3-s.js
+ * @description delete operator throws TypeError when deleting a non-configurable data property in strict mode
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ 'use strict';
+
+ var o = {};
+ var desc = { value : 1 }; // all other attributes default to false
+ Object.defineProperty(o, "foo", desc);
+
+ // Now, deleting o.foo should throw TypeError because [[Configurable]] on foo is false.
+ try {
+ delete o.foo;
+ return false;
+ }
+ catch (e) {
+ return (e instanceof TypeError);
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/S11.4.1_A1.js b/js/src/tests/test262/ch11/11.4/11.4.1/S11.4.1_A1.js new file mode 100644 index 000000000..35764288f --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/S11.4.1_A1.js @@ -0,0 +1,60 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * White Space and Line Terminator between "delete" and UnaryExpression are allowed + * + * @path ch11/11.4/11.4.1/S11.4.1_A1.js + * @description Checking by using eval + */ + +//CHECK#1 +if (eval("delete\u00090") !== true) { + $ERROR('#1: delete\\u00090 === true'); +} + +//CHECK#2 +if (eval("delete\u000B0") !== true) { + $ERROR('#2: delete\\u000B0 === true'); +} + +//CHECK#3 +if (eval("delete\u000C0") !== true) { + $ERROR('#3: delete\\u000C0 === true'); +} + +//CHECK#4 +if (eval("delete\u00200") !== true) { + $ERROR('#4: delete\\u00200 === true'); +} + +//CHECK#5 +if (eval("delete\u00A00") !== true) { + $ERROR('#5: delete\\u00A00 === true'); +} + +//CHECK#6 +if (eval("delete\u000A0") !== true) { + $ERROR('#6: delete\\u000A0 === true'); +} + +//CHECK#7 +if (eval("delete\u000D0") !== true) { + $ERROR('#7: delete\\u000D0 === true'); +} + +//CHECK#8 +if (eval("delete\u20280") !== true) { + $ERROR('#8: delete\\u20280 === true'); +} + +//CHECK#9 +if (eval("delete\u20290") !== true) { + $ERROR('#9: delete\\u20290 === true'); +} + +//CHECK#10 +if (eval("delete\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u20290") !== true) { + $ERROR('#10: delete\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20290 === true'); +} + diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/S11.4.1_A2.1.js b/js/src/tests/test262/ch11/11.4/11.4.1/S11.4.1_A2.1.js new file mode 100644 index 000000000..b993e4a9d --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/S11.4.1_A2.1.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If Type(x) is not Reference, return true + * + * @path ch11/11.4/11.4.1/S11.4.1_A2.1.js + * @description Checking primitive value and Object value cases + */ + +//CHECK#1 +if (delete 1 !== true) { + $ERROR('#1: delete 1 === true'); +} + +//CHECK#2 +if (delete new Object() !== true) { + $ERROR('#2: delete new Object() === true'); +} + + diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/S11.4.1_A2.2_T1.js b/js/src/tests/test262/ch11/11.4/11.4.1/S11.4.1_A2.2_T1.js new file mode 100644 index 000000000..97fd10939 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/S11.4.1_A2.2_T1.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If GetBase(x) doesn't have a property GetPropertyName(x), return true + * + * @path ch11/11.4/11.4.1/S11.4.1_A2.2_T1.js + * @description Checking undeclared variable case + */ + +//CHECK#1 +if (delete x !== true) { + $ERROR('#1: delete x === true'); +} + +//CHECK#2 +if (delete this.x !== true) { + $ERROR('#2: delete this.x === true'); +} + diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/S11.4.1_A2.2_T2.js b/js/src/tests/test262/ch11/11.4/11.4.1/S11.4.1_A2.2_T2.js new file mode 100644 index 000000000..e5c0cbe54 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/S11.4.1_A2.2_T2.js @@ -0,0 +1,23 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If GetBase(x) doesn't have a property GetPropertyName(x), return true + * + * @path ch11/11.4/11.4.1/S11.4.1_A2.2_T2.js + * @description Checking Object object and Function object cases + */ + +//CHECK#1 +function MyFunction(){} +var MyObject = new MyFunction(); +if (delete MyObject.prop !== true) { + $ERROR('#1: function MyFunction(){}; var MyObject = new MyFunction(); delete MyObject.prop === true'); +} + +//CHECK#2 +var MyObject = new Object(); +if (delete MyObject.prop !== true) { + $ERROR('#2: var MyObject = new Object(); delete MyObject.prop === true'); +} + diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/S11.4.1_A3.1.js b/js/src/tests/test262/ch11/11.4/11.4.1/S11.4.1_A3.1.js new file mode 100644 index 000000000..b1edccca9 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/S11.4.1_A3.1.js @@ -0,0 +1,40 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If the property has the DontDelete attribute, return false + * + * @path ch11/11.4/11.4.1/S11.4.1_A3.1.js + * @description Checking declared variable + */ + +//CHECK#1 +var x = 1; +if (delete x !== false) { + $ERROR('#1: var x = 1; delete x === false'); +} + +//CHECK#2 +var y = 1; +if (delete this.y !== false) { + $ERROR('#2: var y = 1; delete this.y === false'); +} + +//CHECK#3 +function MyFunction(){}; +if (delete MyFunction !== false) { + $ERROR('#3: function MyFunction(){}; delete MyFunction === false'); +} + +//CHECK#4 +function MyFunction(){}; +var MyObject = new MyFunction(); +if (delete MyObject !== false) { + $ERROR('#4: function MyFunction(){}; var MyObject = new MyFunction(); delete MyObject === false'); +} + +//CHECK#5 +if (delete MyObject !== false) { + $ERROR('#5: function MyFunction(){}; var MyObject = new MyFunction(); delete MyObject === false'); +} + diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/S11.4.1_A3.2.js b/js/src/tests/test262/ch11/11.4/11.4.1/S11.4.1_A3.2.js new file mode 100644 index 000000000..bee091183 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/S11.4.1_A3.2.js @@ -0,0 +1,31 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If the property doesn't have the DontDelete attribute, return true + * + * @path ch11/11.4/11.4.1/S11.4.1_A3.2.js + * @description Checking declared variable + */ + +//CHECK#1 +x = 1; +if (delete x !== true) { + $ERROR('#1: x = 1; delete x === true'); +} + +//CHECK#2 +function MyFunction(){}; +MyFunction.prop = 1; +if (delete MyFunction.prop !== true) { + $ERROR('#2: function MyFunction(){}; MyFunction.prop = 1; delete MyFunction.prop === true'); +} + +//CHECK#3 +function MyFunction(){}; +var MyObject = new MyFunction(); +MyObject.prop = 1; +if (delete MyObject.prop !== true) { + $ERROR('#3: function MyFunction(){}; var MyObject = new MyFunction(); MyFunction.prop = 1; delete MyObject.prop === true'); +} + diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/S11.4.1_A3.3.js b/js/src/tests/test262/ch11/11.4/11.4.1/S11.4.1_A3.3.js new file mode 100644 index 000000000..e396ee626 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/S11.4.1_A3.3.js @@ -0,0 +1,61 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If the property doesn't have the DontDelete attribute, remove the property + * + * @path ch11/11.4/11.4.1/S11.4.1_A3.3.js + * @description Checking declared variable + */ + +//CHECK#1 +try { + x = 1; + delete x; + x; + $ERROR('#1: x = 1; delete x; x is not exist'); +} catch (e) { + if (e instanceof ReferenceError !== true) { + $ERROR('#1: x = 1; delete x; x is not exist'); + } +} + + +//CHECK#2 +function MyFunction(){}; +MyFunction.prop = 1; +delete MyFunction.prop; +if (MyFunction.prop !== undefined) { + $ERROR('#2: function MyFunction(){}; MyFunction.prop = 1; delete MyFunction.prop; MyFunction.prop === undefined. Actual: ' + (MyFunction.prop)); + +} + +//CHECK#3 +function MyFunction(){}; +var MyObjectVar = new MyFunction(); +MyObjectVar.prop = 1; +delete MyObjectVar.prop; +if (MyObjectVar.prop !== undefined) { + $ERROR('#3: function MyFunction(){}; var MyObjectVar = new MyFunction(); MyFunction.prop = 1; delete MyObjectVar.prop; MyObjectVar.prop === undefined. Actual: ' + (MyObjectVar.prop)); +} + +//CHECK#4 +if (delete MyObjectVar !== false) { + $ERROR('#4: function MyFunction(){}; var MyObjectVar = new MyFunction(); delete MyObjectVar === false'); +} + +//CHECK#5 +function MyFunction(){}; +MyObjectNotVar = new MyFunction(); +MyObjectNotVar.prop = 1; +delete MyObjectNotVar.prop; +if (MyObjectNotVar.prop !== undefined) { + $ERROR('#5: function MyFunction(){}; MyObjectNotVar = new MyFunction(); MyFunction.prop = 1; delete MyObjectNotVar.prop; MyObjectNotVar.prop === undefined. Actual: ' + (MyObjectNotVar.prop)); +} + +//CHECK#6 +if (delete MyObjectNotVar !== true) { + $ERROR('#6: function MyFunction(){}; var MyObjectNotVar = new MyFunction(); delete MyObjectNotVar === true'); +} + + diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/S11.4.1_A4.js b/js/src/tests/test262/ch11/11.4/11.4.1/S11.4.1_A4.js new file mode 100644 index 000000000..a534ce959 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/S11.4.1_A4.js @@ -0,0 +1,19 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * "Delete" operator removes property, which is reference to the object, not the object + * + * @path ch11/11.4/11.4.1/S11.4.1_A4.js + * @description Checking two reference by one object + */ + +//CHECK#1 +var obj = new Object(); +var ref = obj; +delete ref; +if (typeof obj !== "object") { + $ERROR('#1: obj = new Object(); ref = obj; delete ref; typeof obj === "object". Actual: ' + (typeof obj)); +} + + diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/S11.4.1_A5.js b/js/src/tests/test262/ch11/11.4/11.4.1/S11.4.1_A5.js new file mode 100644 index 000000000..2fd5f5243 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/S11.4.1_A5.js @@ -0,0 +1,35 @@ +// Copyright 2011 Google Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * A strict delete should either succeed, returning true, or it + * should fail by throwing a TypeError. Under no circumstances + * should a strict delete return false. + * + * @path ch11/11.4/11.4.1/S11.4.1_A5.js + * @description See if a strict delete returns false when deleting a + * non-standard property. + * @onlyStrict + */ + +"use strict"; + +var reNames = Object.getOwnPropertyNames(RegExp); +for (var i = 0, len = reNames.length; i < len; i++) { + var reName = reNames[i]; + if (reName !== 'prototype') { + var deleted = 'unassigned'; + try { + deleted = delete RegExp[reName]; + } catch (err) { + if (!(err instanceof TypeError)) { + $ERROR('#1: strict delete threw a non-TypeError: ' + err); + } + // fall through + } + if (deleted === false) { + $ERROR('#2: Strict delete returned false'); + } + } +} + diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/browser.js b/js/src/tests/test262/ch11/11.4/11.4.1/browser.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/browser.js diff --git a/js/src/tests/test262/ch11/11.4/11.4.1/shell.js b/js/src/tests/test262/ch11/11.4/11.4.1/shell.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.1/shell.js |