diff --git a/test/language/directive-prologue/10.1.1-21-s.js b/test/language/directive-prologue/func-decl-final-runtime.js similarity index 76% rename from test/language/directive-prologue/10.1.1-21-s.js rename to test/language/directive-prologue/func-decl-final-runtime.js index 0aee78cf846..9cbc7431468 100644 --- a/test/language/directive-prologue/10.1.1-21-s.js +++ b/test/language/directive-prologue/func-decl-final-runtime.js @@ -2,6 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- +esid: use-strict-directive es5id: 10.1.1-21-s description: > Strict Mode - Function code of a FunctionDeclaration contains Use @@ -9,8 +10,8 @@ description: > flags: [noStrict] ---*/ function fun() { - eval("var public = 1;"); - assert.sameValue(public, 1); + test262unresolvable = null; + assert.sameValue(test262unresolvable, null); "use strict"; } fun(); diff --git a/test/language/directive-prologue/func-decl-inside-func-decl-parse.js b/test/language/directive-prologue/func-decl-inside-func-decl-parse.js new file mode 100644 index 00000000000..d540118e430 --- /dev/null +++ b/test/language/directive-prologue/func-decl-inside-func-decl-parse.js @@ -0,0 +1,22 @@ +// Copyright (c) 2018 Mike Pennisi. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: use-strict-directive +es5id: 10.1.1-15-s +description: > + Strict Mode - Function code that is part of a FunctionDeclaration + is strict function code if FunctionDeclaration is contained in use + strict +negative: + phase: early + type: SyntaxError +flags: [noStrict] +---*/ + +function testcase() { + "use strict"; + function fun() { + var static; + } +} diff --git a/test/language/directive-prologue/10.1.1-15-s.js b/test/language/directive-prologue/func-decl-inside-func-decl-runtime.js similarity index 80% rename from test/language/directive-prologue/10.1.1-15-s.js rename to test/language/directive-prologue/func-decl-inside-func-decl-runtime.js index 00a10fab71b..59313153f1a 100644 --- a/test/language/directive-prologue/10.1.1-15-s.js +++ b/test/language/directive-prologue/func-decl-inside-func-decl-runtime.js @@ -2,6 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- +esid: use-strict-directive es5id: 10.1.1-15-s description: > Strict Mode - Function code that is part of a FunctionDeclaration @@ -13,10 +14,10 @@ flags: [noStrict] function testcase() { "use strict"; function fun() { - eval("var public = 1;"); + test262unresolvable = null; } - assert.throws(SyntaxError, function() { + assert.throws(ReferenceError, function() { fun(); }); } diff --git a/test/language/directive-prologue/func-decl-no-semi-parse.js b/test/language/directive-prologue/func-decl-no-semi-parse.js new file mode 100644 index 00000000000..9135ff4b911 --- /dev/null +++ b/test/language/directive-prologue/func-decl-no-semi-parse.js @@ -0,0 +1,19 @@ +// Copyright (c) 2018 Mike Pennisi. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: use-strict-directive +es5id: 10.1.1-2-s +description: > + Strict Mode - Use Strict Directive Prologue is ''use strict'' + which lost the last character ';' +negative: + phase: early + type: SyntaxError +flags: [noStrict] +---*/ + +function fun() { + "use strict" + var static; +} diff --git a/test/language/directive-prologue/func-decl-no-semi-runtime.js b/test/language/directive-prologue/func-decl-no-semi-runtime.js new file mode 100644 index 00000000000..24062671600 --- /dev/null +++ b/test/language/directive-prologue/func-decl-no-semi-runtime.js @@ -0,0 +1,20 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: use-strict-directive +es5id: 10.1.1-2-s +description: > + Strict Mode - Use Strict Directive Prologue is ''use strict'' + which lost the last character ';' +flags: [noStrict] +---*/ + +function fun() { + "use strict" + test262unresolvable = null; +} + +assert.throws(ReferenceError, function() { + fun(); +}); diff --git a/test/language/directive-prologue/10.1.1-20-s.js b/test/language/directive-prologue/func-decl-not-first-runtime.js similarity index 76% rename from test/language/directive-prologue/10.1.1-20-s.js rename to test/language/directive-prologue/func-decl-not-first-runtime.js index be917dff80c..d6504be257f 100644 --- a/test/language/directive-prologue/10.1.1-20-s.js +++ b/test/language/directive-prologue/func-decl-not-first-runtime.js @@ -2,6 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- +esid: use-strict-directive es5id: 10.1.1-20-s description: > Strict Mode - Function code of a FunctionDeclaration contains Use @@ -10,8 +11,8 @@ flags: [noStrict] ---*/ function fun() { - eval("var public = 1;"); + test262unresolvable = null; "use strict"; - assert.sameValue(public, 1); + assert.sameValue(test262unresolvable, null); } fun(); diff --git a/test/language/directive-prologue/func-decl-parse.js b/test/language/directive-prologue/func-decl-parse.js new file mode 100644 index 00000000000..2740f3546eb --- /dev/null +++ b/test/language/directive-prologue/func-decl-parse.js @@ -0,0 +1,19 @@ +// Copyright (c) 2018 Mike Pennisi. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: use-strict-directive +es5id: 10.1.1-19-s +description: > + Strict Mode - Function code of a FunctionDeclaration contains Use + Strict Directive which appears at the start of the block +negative: + phase: early + type: SyntaxError +flags: [noStrict] +---*/ + +function fun() { + "use strict"; + var static; +} diff --git a/test/language/directive-prologue/10.1.1-19-s.js b/test/language/directive-prologue/func-decl-runtime.js similarity index 78% rename from test/language/directive-prologue/10.1.1-19-s.js rename to test/language/directive-prologue/func-decl-runtime.js index 44aefe2fa03..d3dbfb611b5 100644 --- a/test/language/directive-prologue/10.1.1-19-s.js +++ b/test/language/directive-prologue/func-decl-runtime.js @@ -2,6 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- +esid: use-strict-directive es5id: 10.1.1-19-s description: > Strict Mode - Function code of a FunctionDeclaration contains Use @@ -12,9 +13,9 @@ flags: [noStrict] function fun() { "use strict"; - eval("var public = 1;"); + test262unresolvable = null; } -assert.throws(SyntaxError, function() { +assert.throws(ReferenceError, function() { fun(); }); diff --git a/test/language/directive-prologue/10.1.1-24-s.js b/test/language/directive-prologue/func-expr-final-runtime.js similarity index 76% rename from test/language/directive-prologue/10.1.1-24-s.js rename to test/language/directive-prologue/func-expr-final-runtime.js index d74d1944cc5..b5fa0a49f3d 100644 --- a/test/language/directive-prologue/10.1.1-24-s.js +++ b/test/language/directive-prologue/func-expr-final-runtime.js @@ -2,6 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- +esid: use-strict-directive es5id: 10.1.1-24-s description: > Strict Mode - Function code of a FunctionExpression contains Use @@ -10,8 +11,8 @@ flags: [noStrict] ---*/ (function () { - eval("var public = 1;"); + test262unresolvable = null; "use strict"; - assert.sameValue(public, 1); + assert.sameValue(test262unresolvable, null); }) (); diff --git a/test/language/directive-prologue/func-expr-inside-func-decl-parse.js b/test/language/directive-prologue/func-expr-inside-func-decl-parse.js new file mode 100644 index 00000000000..22e48b2a1f6 --- /dev/null +++ b/test/language/directive-prologue/func-expr-inside-func-decl-parse.js @@ -0,0 +1,20 @@ +// Copyright (c) 2018 Mike Pennisi. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: use-strict-directive +es5id: 10.1.1-16-s +description: > + Strict Mode - Function code that is part of a FunctionExpression + is strict function code if FunctionExpression is contained in use + strict +negative: + phase: early + type: SyntaxError +flags: [noStrict] +---*/ + +function testcase() { + "use strict"; + var static; +} diff --git a/test/language/directive-prologue/10.1.1-16-s.js b/test/language/directive-prologue/func-expr-inside-func-decl-runtime.js similarity index 78% rename from test/language/directive-prologue/10.1.1-16-s.js rename to test/language/directive-prologue/func-expr-inside-func-decl-runtime.js index a55007a16a3..467fb5d6534 100644 --- a/test/language/directive-prologue/10.1.1-16-s.js +++ b/test/language/directive-prologue/func-expr-inside-func-decl-runtime.js @@ -2,6 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- +esid: use-strict-directive es5id: 10.1.1-16-s description: > Strict Mode - Function code that is part of a FunctionExpression @@ -13,8 +14,8 @@ flags: [noStrict] function testcase() { "use strict"; - assert.throws(SyntaxError, function() { - eval("var public = 1;"); + assert.throws(ReferenceError, function() { + test262unresolvable = null; }); } testcase(); diff --git a/test/language/directive-prologue/func-expr-no-semi-parse.js b/test/language/directive-prologue/func-expr-no-semi-parse.js new file mode 100644 index 00000000000..404e1ac3088 --- /dev/null +++ b/test/language/directive-prologue/func-expr-no-semi-parse.js @@ -0,0 +1,20 @@ +// Copyright (c) 2018 Mike Pennisi. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: use-strict-directive +es5id: 10.1.1-2-s +description: > + Strict Mode - Use Strict Directive Prologue is ''use strict'' + which lost the last character ';' +negative: + phase: early + type: SyntaxError +flags: [noStrict] +---*/ + +(function() { + "use strict" + + var static; +}); diff --git a/test/language/directive-prologue/10.1.1-2-s.js b/test/language/directive-prologue/func-expr-no-semi-runtime.js similarity index 75% rename from test/language/directive-prologue/10.1.1-2-s.js rename to test/language/directive-prologue/func-expr-no-semi-runtime.js index da0ba589e49..3885d3194d6 100644 --- a/test/language/directive-prologue/10.1.1-2-s.js +++ b/test/language/directive-prologue/func-expr-no-semi-runtime.js @@ -2,6 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- +esid: use-strict-directive es5id: 10.1.1-2-s description: > Strict Mode - Use Strict Directive Prologue is ''use strict'' @@ -9,8 +10,8 @@ description: > flags: [noStrict] ---*/ -assert.throws(SyntaxError, function() { +assert.throws(ReferenceError, function() { "use strict" - eval("var public = 1;"); + test262unresolvable = null; }); diff --git a/test/language/directive-prologue/10.1.1-23-s.js b/test/language/directive-prologue/func-expr-not-first-runtime.js similarity index 76% rename from test/language/directive-prologue/10.1.1-23-s.js rename to test/language/directive-prologue/func-expr-not-first-runtime.js index 98a4f1914c8..4aae5cc8a47 100644 --- a/test/language/directive-prologue/10.1.1-23-s.js +++ b/test/language/directive-prologue/func-expr-not-first-runtime.js @@ -2,6 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- +esid: use-strict-directive es5id: 10.1.1-23-s description: > Strict Mode - Function code of a FunctionExpression contains Use @@ -10,7 +11,7 @@ flags: [noStrict] ---*/ (function () { - eval("var public = 1;"); - assert.sameValue(public, 1); + test262unresolvable = null; + assert.sameValue(test262unresolvable, null); "use strict"; }) (); diff --git a/test/language/directive-prologue/func-expr-parse.js b/test/language/directive-prologue/func-expr-parse.js new file mode 100644 index 00000000000..b1239d2d49c --- /dev/null +++ b/test/language/directive-prologue/func-expr-parse.js @@ -0,0 +1,20 @@ +// Copyright (c) 2018 Mike Pennisi. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: use-strict-directive +es5id: 10.1.1-22-s +description: > + Strict Mode - Function code of a FunctionExpression contains Use + Strict Directive which appears at the start of the block +negative: + phase: early + type: SyntaxError +flags: [noStrict] +---*/ + +(function() { + "use strict"; + + var static; +}); diff --git a/test/language/directive-prologue/10.1.1-22-s.js b/test/language/directive-prologue/func-expr-runtime.js similarity index 76% rename from test/language/directive-prologue/10.1.1-22-s.js rename to test/language/directive-prologue/func-expr-runtime.js index fbfd7790b14..9ad085997a8 100644 --- a/test/language/directive-prologue/10.1.1-22-s.js +++ b/test/language/directive-prologue/func-expr-runtime.js @@ -2,6 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- +esid: use-strict-directive es5id: 10.1.1-22-s description: > Strict Mode - Function code of a FunctionExpression contains Use @@ -9,8 +10,8 @@ description: > flags: [noStrict] ---*/ -assert.throws(SyntaxError, function () { +assert.throws(ReferenceError, function () { "use strict"; - eval("var public = 1;"); + test262unresolvable = null; }); diff --git a/test/language/directive-prologue/10.1.1-17-s.js b/test/language/directive-prologue/get-accsr-inside-func-expr-runtime.js similarity index 84% rename from test/language/directive-prologue/10.1.1-17-s.js rename to test/language/directive-prologue/get-accsr-inside-func-expr-runtime.js index f3a448869b9..11e4628d85d 100644 --- a/test/language/directive-prologue/10.1.1-17-s.js +++ b/test/language/directive-prologue/get-accsr-inside-func-expr-runtime.js @@ -2,6 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- +esid: use-strict-directive es5id: 10.1.1-17-s description: > Strict Mode - Function code that is part of a Accessor @@ -10,12 +11,12 @@ description: > flags: [noStrict] ---*/ -assert.throws(SyntaxError, function() { +assert.throws(ReferenceError, function() { "use strict"; var obj = {}; Object.defineProperty(obj, "accProperty", { get: function () { - eval("public = 1;"); + test262unresolvable = null; return 11; } }); diff --git a/test/language/directive-prologue/10.1.1-27-s.js b/test/language/directive-prologue/get-accsr-not-first-runtime.js similarity index 83% rename from test/language/directive-prologue/10.1.1-27-s.js rename to test/language/directive-prologue/get-accsr-not-first-runtime.js index 23ad02baec8..8f2d9bc5ff9 100644 --- a/test/language/directive-prologue/10.1.1-27-s.js +++ b/test/language/directive-prologue/get-accsr-not-first-runtime.js @@ -2,6 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- +esid: use-strict-directive es5id: 10.1.1-27-s description: > Strict Mode - Function code of Accessor PropertyAssignment @@ -13,11 +14,11 @@ flags: [noStrict] var obj = {}; Object.defineProperty(obj, "accProperty", { get: function () { - eval("public = 1;"); + test262unresolvable = null; "use strict"; return 11; } }); assert.sameValue(obj.accProperty, 11, 'obj.accProperty'); -assert.sameValue(public, 1, 'public'); +assert.sameValue(test262unresolvable, null); diff --git a/test/language/directive-prologue/10.1.1-25-s.js b/test/language/directive-prologue/get-accsr-runtime.js similarity index 83% rename from test/language/directive-prologue/10.1.1-25-s.js rename to test/language/directive-prologue/get-accsr-runtime.js index e726cd7f813..47e6893b808 100644 --- a/test/language/directive-prologue/10.1.1-25-s.js +++ b/test/language/directive-prologue/get-accsr-runtime.js @@ -2,6 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- +esid: use-strict-directive es5id: 10.1.1-25-s description: > Strict Mode - Function code of Accessor PropertyAssignment @@ -11,12 +12,12 @@ flags: [noStrict] ---*/ -assert.throws(SyntaxError, function() { +assert.throws(ReferenceError, function() { var obj = {}; Object.defineProperty(obj, "accProperty", { get: function () { "use strict"; - eval("var public = 1;"); + test262unresolvable = null; return 11; } }); diff --git a/test/language/directive-prologue/10.1.1-18-s.js b/test/language/directive-prologue/set-accsr-inside-func-expr-runtime.js similarity index 85% rename from test/language/directive-prologue/10.1.1-18-s.js rename to test/language/directive-prologue/set-accsr-inside-func-expr-runtime.js index e10da762e72..1038aa05854 100644 --- a/test/language/directive-prologue/10.1.1-18-s.js +++ b/test/language/directive-prologue/set-accsr-inside-func-expr-runtime.js @@ -2,6 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- +esid: use-strict-directive es5id: 10.1.1-18-s description: > Strict Mode - Function code that is part of a Accessor @@ -12,13 +13,13 @@ flags: [noStrict] var data = "data"; -assert.throws(SyntaxError, function() { +assert.throws(ReferenceError, function() { "use strict"; var obj = {}; Object.defineProperty(obj, "accProperty", { set: function (value) { - eval("var public = 1;"); + test262unresolvable = null; data = value; } }); diff --git a/test/language/directive-prologue/10.1.1-26-s.js b/test/language/directive-prologue/set-accsr-not-first-runtime.js similarity index 85% rename from test/language/directive-prologue/10.1.1-26-s.js rename to test/language/directive-prologue/set-accsr-not-first-runtime.js index 103fed211c8..3a460656222 100644 --- a/test/language/directive-prologue/10.1.1-26-s.js +++ b/test/language/directive-prologue/set-accsr-not-first-runtime.js @@ -2,6 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- +esid: use-strict-directive es5id: 10.1.1-26-s description: > Strict Mode - Function code of Accessor PropertyAssignment @@ -12,12 +13,12 @@ flags: [noStrict] var data = "data"; -assert.throws(SyntaxError, function() { +assert.throws(ReferenceError, function() { var obj = {}; Object.defineProperty(obj, "accProperty", { set: function (value) { "use strict"; - eval("var public = 1;"); + test262unresolvable = null; data = value; } }); diff --git a/test/language/directive-prologue/set-accsr-runtime.js b/test/language/directive-prologue/set-accsr-runtime.js new file mode 100644 index 00000000000..e282c89ec98 --- /dev/null +++ b/test/language/directive-prologue/set-accsr-runtime.js @@ -0,0 +1,25 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: use-strict-directive +es5id: 10.1.1-25-s +description: > + Strict Mode - Function code of Accessor PropertyAssignment + contains Use Strict Directive which appears at the start of the + block(getter) +flags: [noStrict] +---*/ + + +assert.throws(ReferenceError, function() { + var obj = {}; + Object.defineProperty(obj, "accProperty", { + set: function () { + "use strict"; + test262unresolvable = null; + return 11; + } + }); + obj.accProperty = "overrideData"; +});