diff options
Diffstat (limited to 'js/src/tests/test262/ch10/10.1')
47 files changed, 926 insertions, 0 deletions
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-1-s.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-1-s.js new file mode 100644 index 000000000..a9cf025bc --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-1-s.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 ch10/10.1/10.1.1/10.1.1-1-s.js
+ * @description Strict Mode - Use Strict Directive Prologue is 'use strict'; which contains two space between 'use' and 'strict'
+ * @noStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ var public = 1;
+ return public === 1;
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-10-s.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-10-s.js new file mode 100644 index 000000000..51aa8ca73 --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-10-s.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 ch10/10.1/10.1.1/10.1.1-10-s.js
+ * @description Strict Mode - Use Strict Directive Prologue is ''USE STRICT';' in which all characters are uppercase
+ * @noStrict
+ */
+
+
+function testcase() {
+ "USE STRICT";
+ var public = 1;
+ return public === 1;
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-11-s.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-11-s.js new file mode 100644 index 000000000..6d7794d97 --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-11-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 ch10/10.1/10.1.1/10.1.1-11-s.js
+ * @description Strict Mode - Eval code is strict code with a Use Strict Directive at the beginning of the block
+ * @noStrict
+ */
+
+
+function testcase() {
+ try {
+ eval("'use strict'; var public = 1; var anotherVariableNotReserveWord = 2;");
+
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError && typeof public === "undefined" &&
+ typeof anotherVariableNotReserveWord === "undefined";
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-12-s.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-12-s.js new file mode 100644 index 000000000..09fdffe84 --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-12-s.js @@ -0,0 +1,17 @@ +/// 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 ch10/10.1/10.1.1/10.1.1-12-s.js
+ * @description Strict Mode - Eval code is strict eval code with a Use Strict Directive in the middle of the block
+ * @noStrict
+ */
+
+
+function testcase() {
+ eval("var public = 1; 'use strict'; var anotherVariableNotReserveWord = 2;");
+ return public === 1 && anotherVariableNotReserveWord === 2;
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-13-s.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-13-s.js new file mode 100644 index 000000000..0a4ba30ff --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-13-s.js @@ -0,0 +1,17 @@ +/// 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 ch10/10.1/10.1.1/10.1.1-13-s.js
+ * @description Strict Mode - Eval code is strict eval code with a Use Strict Directive at the end of the block
+ * @noStrict
+ */
+
+
+function testcase() {
+ eval("var public = 1; var anotherVariableNotReserveWord = 2; 'use strict';");
+ return public === 1 && anotherVariableNotReserveWord === 2;
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-14-s.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-14-s.js new file mode 100644 index 000000000..dff413366 --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-14-s.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.
+/**
+ * @path ch10/10.1/10.1.1/10.1.1-14-s.js
+ * @description Strict Mode - The call to eval function is contained in a Strict Mode block
+ * @noStrict
+ */
+
+
+function testcase() {
+ 'use strict';
+ try {
+ eval("var public = 1;");
+ return false;
+ } catch (e) {
+ return true;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-15-s.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-15-s.js new file mode 100644 index 000000000..b7f7664f5 --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-15-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 ch10/10.1/10.1.1/10.1.1-15-s.js
+ * @description Strict Mode - Function code that is part of a FunctionDeclaration is strict function code if FunctionDeclaration is contained in use strict
+ * @noStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ function fun() {
+ try {
+ eval("var public = 1;");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ }
+
+ return fun();
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-16-s.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-16-s.js new file mode 100644 index 000000000..35ef8803f --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-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 ch10/10.1/10.1.1/10.1.1-16-s.js
+ * @description Strict Mode - Function code that is part of a FunctionExpression is strict function code if FunctionExpression is contained in use strict
+ * @noStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ return function () {
+ try {
+ eval("var public = 1;");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ } ();
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-17-s.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-17-s.js new file mode 100644 index 000000000..976e644fe --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-17-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 ch10/10.1/10.1.1/10.1.1-17-s.js
+ * @description Strict Mode - Function code that is part of a Accessor PropertyAssignment is in Strict Mode if Accessor PropertyAssignment is contained in use strict(getter)
+ * @noStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ try {
+ var obj = {};
+ Object.defineProperty(obj, "accProperty", {
+ get: function () {
+ eval("public = 1;");
+ return 11;
+ }
+ });
+
+ var temp = obj.accProperty === 11;
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-18-s.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-18-s.js new file mode 100644 index 000000000..b384ebfe5 --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-18-s.js @@ -0,0 +1,31 @@ +/// 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 ch10/10.1/10.1.1/10.1.1-18-s.js
+ * @description Strict Mode - Function code that is part of a Accessor PropertyAssignment is in Strict Mode if Accessor PropertyAssignment is contained in use strict(setter)
+ * @noStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ try {
+ var obj = {};
+ var data = "data";
+ Object.defineProperty(obj, "accProperty", {
+ set: function (value) {
+ eval("var public = 1;");
+ data = value;
+ }
+ });
+
+ obj.accProperty = "overrideData";
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError && data === "data";
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-19-s.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-19-s.js new file mode 100644 index 000000000..6643ec7f1 --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-19-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 ch10/10.1/10.1.1/10.1.1-19-s.js
+ * @description Strict Mode - Function code of a FunctionDeclaration contains Use Strict Directive which appears at the start of the block
+ * @noStrict
+ */
+
+
+function testcase() {
+ function fun() {
+ "use strict";
+ try {
+ eval("var public = 1;");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ }
+ return fun();
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-2-s.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-2-s.js new file mode 100644 index 000000000..42e6bce78 --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-2-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 ch10/10.1/10.1.1/10.1.1-2-s.js
+ * @description Strict Mode - Use Strict Directive Prologue is ''use strict'' which lost the last character ';'
+ * @noStrict
+ */
+
+
+function testcase() {
+ "use strict"
+ try {
+ eval("var public = 1;");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-20-s.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-20-s.js new file mode 100644 index 000000000..cc30e88e6 --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-20-s.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.
+/**
+ * @path ch10/10.1/10.1.1/10.1.1-20-s.js
+ * @description Strict Mode - Function code of a FunctionDeclaration contains Use Strict Directive which appears in the middle of the block
+ * @noStrict
+ */
+
+
+function testcase() {
+ function fun() {
+ eval("var public = 1;");
+ "use strict";
+ return public === 1;
+ }
+ return fun();
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-21-s.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-21-s.js new file mode 100644 index 000000000..6c0245461 --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-21-s.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.
+/**
+ * @path ch10/10.1/10.1.1/10.1.1-21-s.js
+ * @description Strict Mode - Function code of a FunctionDeclaration contains Use Strict Directive which appears at the end of the block
+ * @noStrict
+ */
+
+
+function testcase() {
+ function fun() {
+ eval("var public = 1;");
+ return public === 1;
+ "use strict";
+ }
+ return fun();
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-22-s.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-22-s.js new file mode 100644 index 000000000..875ad9780 --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-22-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 ch10/10.1/10.1.1/10.1.1-22-s.js
+ * @description Strict Mode - Function code of a FunctionExpression contains Use Strict Directive which appears at the start of the block
+ * @noStrict
+ */
+
+
+function testcase() {
+ return function () {
+ "use strict";
+ try {
+ eval("var public = 1;");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ } ();
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-23-s.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-23-s.js new file mode 100644 index 000000000..680e928cd --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-23-s.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 ch10/10.1/10.1.1/10.1.1-23-s.js
+ * @description Strict Mode - Function code of a FunctionExpression contains Use Strict Directive which appears in the middle of the block
+ * @noStrict
+ */
+
+
+function testcase() {
+ return function () {
+ eval("var public = 1;");
+ return public === 1;
+ "use strict";
+ } ();
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-24-s.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-24-s.js new file mode 100644 index 000000000..ef67dbe59 --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-24-s.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 ch10/10.1/10.1.1/10.1.1-24-s.js
+ * @description Strict Mode - Function code of a FunctionExpression contains Use Strict Directive which appears at the end of the block
+ * @noStrict
+ */
+
+
+function testcase() {
+ return function () {
+ eval("var public = 1;");
+ "use strict";
+ return public === 1;
+ } ();
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-25-s.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-25-s.js new file mode 100644 index 000000000..206518f72 --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-25-s.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.
+/**
+ * @path ch10/10.1/10.1.1/10.1.1-25-s.js
+ * @description Strict Mode - Function code of Accessor PropertyAssignment contains Use Strict Directive which appears at the start of the block(getter)
+ * @noStrict
+ */
+
+
+function testcase() {
+ try {
+ var obj = {};
+ Object.defineProperty(obj, "accProperty", {
+ get: function () {
+ "use strict";
+ eval("var public = 1;");
+ return 11;
+ }
+ });
+ var temp = obj.accProperty === 11;
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-26-s.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-26-s.js new file mode 100644 index 000000000..9da18136b --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-26-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.
+/**
+ * @path ch10/10.1/10.1.1/10.1.1-26-s.js
+ * @description Strict Mode - Function code of Accessor PropertyAssignment contains Use Strict Directive which appears at the start of the block(setter)
+ * @noStrict
+ */
+
+
+function testcase() {
+ try {
+ var obj = {};
+ var data = "data";
+ Object.defineProperty(obj, "accProperty", {
+ set: function (value) {
+ "use strict";
+ eval("var public = 1;");
+ data = value;
+ }
+ });
+
+ obj.accProperty = "overrideData";
+
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError && data === "data";
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-27-s.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-27-s.js new file mode 100644 index 000000000..94b01f5af --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-27-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 ch10/10.1/10.1.1/10.1.1-27-s.js
+ * @description Strict Mode - Function code of Accessor PropertyAssignment contains Use Strict Directive which appears in the middle of the block(getter)
+ * @noStrict
+ */
+
+
+function testcase() {
+ var obj = {};
+ Object.defineProperty(obj, "accProperty", {
+ get: function () {
+ eval("public = 1;");
+ "use strict";
+ return 11;
+ }
+ });
+ return obj.accProperty === 11 && public === 1;
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-28-s.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-28-s.js new file mode 100644 index 000000000..f3ebe7d11 --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-28-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.
+/**
+ * @path ch10/10.1/10.1.1/10.1.1-28-s.js
+ * @description Strict Mode - Function code of Accessor PropertyAssignment contains Use Strict Directive which appears at the end of the block(setter)
+ * @noStrict
+ */
+
+
+function testcase() {
+ var obj = {};
+ var data;
+
+ Object.defineProperty(obj, "accProperty", {
+ set: function (value) {
+ var _10_1_1_28_s = {a:1, a:2};
+ data = value;
+ "use strict";
+ }
+ });
+ obj.accProperty = "overrideData";
+ return data==="overrideData";
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-29-s.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-29-s.js new file mode 100644 index 000000000..9745777b1 --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-29-s.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 ch10/10.1/10.1.1/10.1.1-29-s.js
+ * @description Strict Mode - The built-in Function constructor is contained in use strict code
+ * @noStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ var funObj = new Function("a", "eval('public = 1;');");
+ funObj();
+ return true;
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-2gs.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-2gs.js new file mode 100644 index 000000000..dd30cb215 --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-2gs.js @@ -0,0 +1,16 @@ +/// 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 ch10/10.1/10.1.1/10.1.1-2gs.js
+ * @description Strict Mode - Use Strict Directive Prologue is ''use strict'' which lost the last character ';'
+ * @noStrict
+ * @negative ^((?!NotEarlyError).)*$
+ */
+
+"use strict"
+throw NotEarlyError;
+var public = 1;
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-3-s.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-3-s.js new file mode 100644 index 000000000..8c4e4fb5d --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-3-s.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 ch10/10.1/10.1.1/10.1.1-3-s.js
+ * @description Strict Mode - Use Strict Directive Prologue is '' use strict';' which the first character is space
+ * @noStrict
+ */
+
+
+function testcase() {
+ " use strict";
+ var public = 1;
+
+ return public === 1;
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-30-s.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-30-s.js new file mode 100644 index 000000000..79c68e7c2 --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-30-s.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.
+/**
+ * @path ch10/10.1/10.1.1/10.1.1-30-s.js
+ * @description Strict Mode - Function code of built-in Function constructor contains Use Strict Directive which appears at the start of the block
+ * @noStrict
+ */
+
+
+function testcase() {
+ try {
+ var funObj = new Function("a", "'use strict'; eval('public = 1;');");
+ funObj();
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-31-s.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-31-s.js new file mode 100644 index 000000000..21c84976b --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-31-s.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 ch10/10.1/10.1.1/10.1.1-31-s.js
+ * @description Strict Mode - Function code of built-in Function constructor contains Use Strict Directive which appears in the middle of the block
+ * @noStrict
+ */
+
+
+function testcase() {
+ var funObj = new Function("a", "eval('public = 1;'); 'use strict'; anotherVariable = 2;");
+ funObj();
+ return public === 1 && anotherVariable === 2;
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-32-s.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-32-s.js new file mode 100644 index 000000000..a7cbc1d8c --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-32-s.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 ch10/10.1/10.1.1/10.1.1-32-s.js
+ * @description Strict Mode - Function code of built-in Function constructor contains Use Strict Directive which appears at the end of the block
+ * @noStrict
+ */
+
+
+function testcase() {
+ var funObj = new Function("a", "eval('public = 1;'); anotherVariable = 2; 'use strict';");
+ funObj();
+ return public === 1 && anotherVariable === 2;
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-4-s.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-4-s.js new file mode 100644 index 000000000..3d7db1862 --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-4-s.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 ch10/10.1/10.1.1/10.1.1-4-s.js
+ * @description Strict Mode - Use Strict Directive Prologue is ''use strict ';' which the last character is space
+ * @noStrict
+ */
+
+
+function testcase() {
+ "use strict ";
+ var public = 1;
+ return public === 1;
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-5-s.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-5-s.js new file mode 100644 index 000000000..6a9f07af4 --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-5-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 ch10/10.1/10.1.1/10.1.1-5-s.js
+ * @description Strict Mode - Use Strict Directive Prologue is ''use strict';' which appears at the beginning of the block
+ * @noStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ try {
+ eval("var public = 1;");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-5gs.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-5gs.js new file mode 100644 index 000000000..63698e5e6 --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-5gs.js @@ -0,0 +1,16 @@ +/// 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 ch10/10.1/10.1.1/10.1.1-5gs.js
+ * @description Strict Mode - Use Strict Directive Prologue is ''use strict';' which appears at the start of the code
+ * @noStrict
+ * @negative ^((?!NotEarlyError).)*$
+ */
+
+"use strict";
+throw NotEarlyError;
+var public = 1;
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-6-s.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-6-s.js new file mode 100644 index 000000000..6434c2515 --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-6-s.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 ch10/10.1/10.1.1/10.1.1-6-s.js
+ * @description Strict Mode - Use Strict Directive Prologue is ''use strict';' which appears in the middle of the block
+ * @noStrict
+ */
+
+
+function testcase() {
+ var interface = 2;
+ "use strict";
+ var public = 1;
+ return public === 1 && interface === 2;
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-7-s.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-7-s.js new file mode 100644 index 000000000..42b5e1ee2 --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-7-s.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 ch10/10.1/10.1.1/10.1.1-7-s.js
+ * @description Strict Mode - Use Strict Directive Prologue is ''use strict';' which appears at the end of the block
+ * @noStrict
+ */
+
+
+function testcase() {
+ var public = 1;
+ return public === 1;
+ "use strict";
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-8-s.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-8-s.js new file mode 100644 index 000000000..3fc4df80e --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-8-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 ch10/10.1/10.1.1/10.1.1-8-s.js
+ * @description Strict Mode - Use Strict Directive Prologue is ''use strict';' which appears twice in the directive prologue
+ * @noStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ "use strict";
+ try {
+ eval("var public = 1;");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-8gs.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-8gs.js new file mode 100644 index 000000000..88476ac4a --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-8gs.js @@ -0,0 +1,17 @@ +/// 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 ch10/10.1/10.1.1/10.1.1-8gs.js
+ * @description Strict Mode - Use Strict Directive Prologue is ''use strict';' which appears twice in the code
+ * @noStrict
+ * @negative ^((?!NotEarlyError).)*$
+ */
+
+"use strict";
+"use strict";
+throw NotEarlyError;
+var public = 1;
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-9-s.js b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-9-s.js new file mode 100644 index 000000000..b294ef146 --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/10.1.1-9-s.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 ch10/10.1/10.1.1/10.1.1-9-s.js
+ * @description Strict Mode - Use Strict Directive Prologue is ''Use strict';' in which the first character is uppercase
+ * @noStrict
+ */
+
+
+function testcase() {
+ "Use strict";
+ var public = 1;
+ return public === 1;
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/browser.js b/js/src/tests/test262/ch10/10.1/10.1.1/browser.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/browser.js diff --git a/js/src/tests/test262/ch10/10.1/10.1.1/shell.js b/js/src/tests/test262/ch10/10.1/10.1.1/shell.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/10.1.1/shell.js diff --git a/js/src/tests/test262/ch10/10.1/S10.1.1_A1_T1.js b/js/src/tests/test262/ch10/10.1/S10.1.1_A1_T1.js new file mode 100644 index 000000000..4085aa5ac --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/S10.1.1_A1_T1.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Program functions are defined in source text by a FunctionDeclaration or created dynamically either + * by using a FunctionExpression or by using the built-in Function object as a constructor + * + * @path ch10/10.1/S10.1.1_A1_T1.js + * @description Defining function by a FunctionDeclaration + */ + +//CHECK#1 +function f1(){ + return 1; +} +if(typeof(f1)!=="function") + $ERROR('#1: typeof(f1)!=="function"'); + diff --git a/js/src/tests/test262/ch10/10.1/S10.1.1_A1_T2.js b/js/src/tests/test262/ch10/10.1/S10.1.1_A1_T2.js new file mode 100644 index 000000000..d453d6e59 --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/S10.1.1_A1_T2.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Program functions are defined in source text by a FunctionDeclaration or created dynamically either + * by using a FunctionExpression or by using the built-in Function object as a constructor + * + * @path ch10/10.1/S10.1.1_A1_T2.js + * @description Creating function dynamically by using a FunctionExpression + */ + +//CHECK#1 +var x=function f1(){return 1;}(); +if(x!==1) + $ERROR('#1: Create function dynamically either by using a FunctionExpression'); + +//CHECK#2 +var y=function (){return 2;}(); +if(y!==2){ + $ERROR('#2: Create an anonymous function dynamically either by using a FunctionExpression'); +} + +//CHECK#2 +var z = (function(){return 3;})(); +if(z!==3){ + $ERROR('#3: Create an anonymous function dynamically either by using a FunctionExpression wrapped in a group operator'); +} + diff --git a/js/src/tests/test262/ch10/10.1/S10.1.1_A1_T3.js b/js/src/tests/test262/ch10/10.1/S10.1.1_A1_T3.js new file mode 100644 index 000000000..5e49dcd59 --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/S10.1.1_A1_T3.js @@ -0,0 +1,16 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Program functions are defined in source text by a FunctionDeclaration or created dynamically either + * by using a FunctionExpression or by using the built-in Function object as a constructor + * + * @path ch10/10.1/S10.1.1_A1_T3.js + * @description Creating function dynamically by using the built-in Function object as a constructor + */ + +//CHECK#1 +var x=new function f1(){return 1;}; +if(typeof(x.constructor)!=="function") + $ERROR('#1: typeof(x.constructor)!=="function"'); + diff --git a/js/src/tests/test262/ch10/10.1/S10.1.1_A2_T1.js b/js/src/tests/test262/ch10/10.1/S10.1.1_A2_T1.js new file mode 100644 index 000000000..aa5701155 --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/S10.1.1_A2_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. + +/** + * There are two types of Function objects. Internal functions + * are built-in objects of the language, such as parseInt and Math.exp + * + * @path ch10/10.1/S10.1.1_A2_T1.js + * @description Checking types of parseInt and Math.exp + */ + +//CHECK#1 +if(typeof(Math.exp)!=="function") + $ERROR('#1: typeof(Math.exp(10))!=="function" '+typeof(Math.exp())); + +//CHECK#2 +if(typeof(parseInt)!=="function") + $ERROR('#2: typeof(parseInt())!=="function" '+typeof(parseInt())); + + diff --git a/js/src/tests/test262/ch10/10.1/S10.1.6_A1_T1.js b/js/src/tests/test262/ch10/10.1/S10.1.6_A1_T1.js new file mode 100644 index 000000000..5dee9bf43 --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/S10.1.6_A1_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. + +/** + * The activation object is initialised with a property with name arguments and attributes {DontDelete} + * + * @path ch10/10.1/S10.1.6_A1_T1.js + * @description Checking if deleting function parameter is possible + * @noStrict + */ + +//CHECK#1 +function f1(a){ + delete a; + return a; +} +if (f1(1) !== 1) + $ERROR('#1: Function parameter was deleted'); + + diff --git a/js/src/tests/test262/ch10/10.1/S10.1.6_A1_T2.js b/js/src/tests/test262/ch10/10.1/S10.1.6_A1_T2.js new file mode 100644 index 000000000..8747b2f11 --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/S10.1.6_A1_T2.js @@ -0,0 +1,33 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * The activation object is initialised with a property with name arguments and attributes {DontDelete} + * + * @path ch10/10.1/S10.1.6_A1_T2.js + * @description Checking funtion which returns property "arguments" + */ + +var ARG_STRING = "value of the argument property"; + +function f1() { + this.constructor.prototype.arguments = ARG_STRING; + return arguments; +} + +//CHECK#1 +if ((new f1(1,2,3,4,5)).length !== 5) + $ERROR('#1: (new f1(1,2,3,4,5)).length===5, where f1 returns "arguments" that is set to "'+ ARG_STRING + '"'); + +//CHECK#2 +if ((new f1(1,2,3,4,5))[3] !== 4) + $ERROR('#2: (new f1(1,2,3,4,5))[3]===4, where f1 returns "arguments" that is set to "'+ ARG_STRING + '"'); + +//CHECK#3 +var x = new f1(1,2,3,4,5); +if (delete x[3] !== true) + $ERROR('#3.1: Function parameters have attribute {DontDelete}'); + +if (x[3] === 4) + $ERROR('#3.2: Function parameters have attribute {DontDelete}'); + diff --git a/js/src/tests/test262/ch10/10.1/S10.1.6_A1_T3.js b/js/src/tests/test262/ch10/10.1/S10.1.6_A1_T3.js new file mode 100644 index 000000000..95e1bf2ef --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/S10.1.6_A1_T3.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. + +/** + * The activation object is initialised with a property with name arguments and attributes {DontDelete} + * + * @path ch10/10.1/S10.1.6_A1_T3.js + * @description Checking function which returns "this" + * @noStrict + */ + +function f1() { + if (delete arguments) { + $ERROR("#1: Function parameters have attribute {DontDelete}" + arguments); + } + return arguments; +} + +f1(); + diff --git a/js/src/tests/test262/ch10/10.1/S10.1.7_A1_T1.js b/js/src/tests/test262/ch10/10.1/S10.1.7_A1_T1.js new file mode 100644 index 000000000..f7e7a0b0c --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/S10.1.7_A1_T1.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * The this value associated with an executioncontext is immutable + * + * @path ch10/10.1/S10.1.7_A1_T1.js + * @description Checking if deleting "this" fails + */ + +//CHECK#1 +if (delete this !== true) + $ERROR('#1: The this value associated with an executioncontext is immutable. Actual: this was deleted'); + + diff --git a/js/src/tests/test262/ch10/10.1/browser.js b/js/src/tests/test262/ch10/10.1/browser.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/browser.js diff --git a/js/src/tests/test262/ch10/10.1/shell.js b/js/src/tests/test262/ch10/10.1/shell.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch10/10.1/shell.js |