diff options
Diffstat (limited to 'js/src/tests/test262/ch14/14.1')
21 files changed, 436 insertions, 0 deletions
diff --git a/js/src/tests/test262/ch14/14.1/14.1-1-s.js b/js/src/tests/test262/ch14/14.1/14.1-1-s.js new file mode 100644 index 000000000..6b2b377b8 --- /dev/null +++ b/js/src/tests/test262/ch14/14.1/14.1-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 ch14/14.1/14.1-1-s.js
+ * @description 'use strict' directive - correct usage
+ * @noStrict
+ */
+
+
+function testcase() {
+
+ function foo()
+ {
+ 'use strict';
+ return(this === undefined);
+ }
+
+ return foo.call(undefined);
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch14/14.1/14.1-10-s.js b/js/src/tests/test262/ch14/14.1/14.1-10-s.js new file mode 100644 index 000000000..5badea52b --- /dev/null +++ b/js/src/tests/test262/ch14/14.1/14.1-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 ch14/14.1/14.1-10-s.js
+ * @description other directives - may follow 'use strict' directive
+ * @noStrict
+ */
+
+
+function testcase() {
+
+ function foo()
+ {
+ "use strict";
+ "bogus directive";
+ return (this === undefined);
+ }
+
+ return foo.call(undefined);
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch14/14.1/14.1-11-s.js b/js/src/tests/test262/ch14/14.1/14.1-11-s.js new file mode 100644 index 000000000..bb5cbf79c --- /dev/null +++ b/js/src/tests/test262/ch14/14.1/14.1-11-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 ch14/14.1/14.1-11-s.js
+ * @description comments may preceed 'use strict' directive
+ * @noStrict
+ */
+
+
+function testcase() {
+
+ function foo()
+ {
+ // comment
+ /* comment */ "use strict";
+
+ return(this === undefined);
+
+ }
+
+ return foo.call(undefined);
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch14/14.1/14.1-12-s.js b/js/src/tests/test262/ch14/14.1/14.1-12-s.js new file mode 100644 index 000000000..4aa3fb115 --- /dev/null +++ b/js/src/tests/test262/ch14/14.1/14.1-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 ch14/14.1/14.1-12-s.js
+ * @description comments may follow 'use strict' directive
+ * @noStrict
+ */
+
+
+function testcase() {
+
+ function foo()
+ {
+ "use strict"; /* comment */ // comment
+
+ return (this === undefined);
+ }
+
+ return foo.call(undefined);
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch14/14.1/14.1-13-s.js b/js/src/tests/test262/ch14/14.1/14.1-13-s.js new file mode 100644 index 000000000..ba3889681 --- /dev/null +++ b/js/src/tests/test262/ch14/14.1/14.1-13-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 ch14/14.1/14.1-13-s.js
+ * @description semicolon insertion works for'use strict' directive
+ * @noStrict
+ */
+
+
+function testcase() {
+
+ function foo()
+ {
+ "use strict"
+ return (this === undefined);
+ }
+
+ return foo.call(undefined);
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch14/14.1/14.1-14-s.js b/js/src/tests/test262/ch14/14.1/14.1-14-s.js new file mode 100644 index 000000000..fd37bd4f8 --- /dev/null +++ b/js/src/tests/test262/ch14/14.1/14.1-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 ch14/14.1/14.1-14-s.js
+ * @description semicolon insertion may come before 'use strict' directive
+ * @noStrict
+ */
+
+
+function testcase() {
+
+ function foo()
+ {
+ "another directive"
+ "use strict" ;
+ return (this === undefined);
+ }
+
+ return foo.call(undefined);
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch14/14.1/14.1-15-s.js b/js/src/tests/test262/ch14/14.1/14.1-15-s.js new file mode 100644 index 000000000..38325c4d4 --- /dev/null +++ b/js/src/tests/test262/ch14/14.1/14.1-15-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 ch14/14.1/14.1-15-s.js
+ * @description blank lines may come before 'use strict' directive
+ * @noStrict
+ */
+
+
+function testcase() {
+
+ function foo()
+ {
+
+
+
+
+
+
+ "use strict" ;
+ return (this === undefined);
+ }
+
+ return foo.call(undefined);
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch14/14.1/14.1-16-s.js b/js/src/tests/test262/ch14/14.1/14.1-16-s.js new file mode 100644 index 000000000..e63ef40d0 --- /dev/null +++ b/js/src/tests/test262/ch14/14.1/14.1-16-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 ch14/14.1/14.1-16-s.js
+ * @description 'use strict' directive - not recognized if it follow an empty statement
+ * @noStrict
+ */
+
+
+function testcase() {
+
+ function foo()
+ {
+ ; 'use strict';
+ return (this !== undefined);
+ }
+
+ return foo.call(undefined);
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch14/14.1/14.1-17-s.js b/js/src/tests/test262/ch14/14.1/14.1-17-s.js new file mode 100644 index 000000000..cfc21ff21 --- /dev/null +++ b/js/src/tests/test262/ch14/14.1/14.1-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 ch14/14.1/14.1-17-s.js
+ * @description 'use strict' directive - not recognized if it follow some other statment empty statement
+ * @noStrict
+ */
+
+function testcase() {
+
+ function foo()
+ {
+ var x;
+ 'use strict';
+ return (this !== undefined);
+ }
+
+ return foo.call(undefined);
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch14/14.1/14.1-2-s.js b/js/src/tests/test262/ch14/14.1/14.1-2-s.js new file mode 100644 index 000000000..9701c4020 --- /dev/null +++ b/js/src/tests/test262/ch14/14.1/14.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 ch14/14.1/14.1-2-s.js
+ * @description "use strict" directive - correct usage double quotes
+ * @noStrict
+ */
+
+
+function testcase() {
+
+ function foo()
+ {
+ "use strict";
+ return (this === undefined);
+ }
+
+ return foo.call(undefined);
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch14/14.1/14.1-3-s.js b/js/src/tests/test262/ch14/14.1/14.1-3-s.js new file mode 100644 index 000000000..90eb7767a --- /dev/null +++ b/js/src/tests/test262/ch14/14.1/14.1-3-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 ch14/14.1/14.1-3-s.js
+ * @description 'use strict' directive - not recognized if it contains extra whitespace
+ * @noStrict
+ */
+
+
+function testcase() {
+
+ function foo()
+ {
+ ' use strict ';
+ return (this !== undefined);
+ }
+
+ return foo.call(undefined);
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch14/14.1/14.1-4-s.js b/js/src/tests/test262/ch14/14.1/14.1-4-s.js new file mode 100644 index 000000000..f53cd37fa --- /dev/null +++ b/js/src/tests/test262/ch14/14.1/14.1-4-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 ch14/14.1/14.1-4-s.js
+ * @description 'use strict' directive - not recognized if contains Line Continuation
+ * @noStrict
+ */
+
+
+function testcase() {
+
+ function foo()
+ {
+ 'use str\
+ict';
+ return (this !== undefined);
+ }
+
+ return foo.call(undefined);
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch14/14.1/14.1-4gs.js b/js/src/tests/test262/ch14/14.1/14.1-4gs.js new file mode 100644 index 000000000..67456de53 --- /dev/null +++ b/js/src/tests/test262/ch14/14.1/14.1-4gs.js @@ -0,0 +1,14 @@ +/// 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 ch14/14.1/14.1-4gs.js
+ * @description StrictMode - a Use Strict Directive followed by a strict mode violation
+ * @onlyStrict
+ * @negative ^((?!NotEarlyError).)*$
+ */
+"use strict";
+throw NotEarlyError;
+eval = 42;
\ No newline at end of file diff --git a/js/src/tests/test262/ch14/14.1/14.1-5-s.js b/js/src/tests/test262/ch14/14.1/14.1-5-s.js new file mode 100644 index 000000000..f0b40a12c --- /dev/null +++ b/js/src/tests/test262/ch14/14.1/14.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 ch14/14.1/14.1-5-s.js
+ * @description 'use strict' directive - not recognized if contains a EscapeSequence
+ * @noStrict
+ */
+
+
+function testcase() {
+
+ function foo()
+ {
+ 'use\u0020strict';
+ return(this !== undefined);
+ }
+
+ return foo.call(undefined);
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch14/14.1/14.1-5gs.js b/js/src/tests/test262/ch14/14.1/14.1-5gs.js new file mode 100644 index 000000000..9ce043a67 --- /dev/null +++ b/js/src/tests/test262/ch14/14.1/14.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 ch14/14.1/14.1-5gs.js
+ * @description StrictMode - a Use Strict Directive embedded in a directive prologue followed by a strict mode violation
+ * @onlyStrict
+ * @negative ^((?!NotEarlyError).)*$
+ */
+"a";
+"use strict";
+"c";
+throw NotEarlyError;
+eval = 42;
\ No newline at end of file diff --git a/js/src/tests/test262/ch14/14.1/14.1-6-s.js b/js/src/tests/test262/ch14/14.1/14.1-6-s.js new file mode 100644 index 000000000..c779da837 --- /dev/null +++ b/js/src/tests/test262/ch14/14.1/14.1-6-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 ch14/14.1/14.1-6-s.js
+ * @description 'use strict' directive - not recognized if contains a <TAB> instead of a space
+ * @noStrict
+ */
+
+
+function testcase() {
+
+ function foo()
+ {
+ 'use strict';
+ return (this !== undefined);
+ }
+
+ return foo.call(undefined);
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch14/14.1/14.1-7-s.js b/js/src/tests/test262/ch14/14.1/14.1-7-s.js new file mode 100644 index 000000000..a54b90774 --- /dev/null +++ b/js/src/tests/test262/ch14/14.1/14.1-7-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 ch14/14.1/14.1-7-s.js
+ * @description 'use strict' directive - not recognized if upper case
+ * @noStrict
+ */
+
+
+function testcase() {
+
+ function foo()
+ {
+ 'Use Strict';
+ return (this !== undefined);
+ }
+
+ return foo.call(undefined);
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch14/14.1/14.1-8-s.js b/js/src/tests/test262/ch14/14.1/14.1-8-s.js new file mode 100644 index 000000000..446ab3a74 --- /dev/null +++ b/js/src/tests/test262/ch14/14.1/14.1-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 ch14/14.1/14.1-8-s.js
+ * @description 'use strict' directive - may follow other directives
+ * @noStrict
+ */
+
+
+function testcase() {
+
+ function foo()
+ {
+ "bogus directive";
+ "use strict";
+ return (this === undefined);
+ }
+
+ return foo.call(undefined);
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch14/14.1/14.1-9-s.js b/js/src/tests/test262/ch14/14.1/14.1-9-s.js new file mode 100644 index 000000000..2efb4736a --- /dev/null +++ b/js/src/tests/test262/ch14/14.1/14.1-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 ch14/14.1/14.1-9-s.js
+ * @description 'use strict' directive - may occur multiple times
+ * @noStrict
+ */
+
+
+function testcase() {
+
+ function foo()
+ {
+ 'use strict';
+ "use strict";
+ return (this === undefined);
+ }
+
+ return foo.call(undefined);
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch14/14.1/browser.js b/js/src/tests/test262/ch14/14.1/browser.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch14/14.1/browser.js diff --git a/js/src/tests/test262/ch14/14.1/shell.js b/js/src/tests/test262/ch14/14.1/shell.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch14/14.1/shell.js |