Skip to content
Snippets Groups Projects
Commit 29ecced6 authored by Mike Pennisi's avatar Mike Pennisi
Browse files

Update handling of directive prologues

Some tests specifically concern the application of the `use strict`
directive as it appears in JavaScript source code. These tests should
*not* be run with the `onlyStrict` flag because relying on the test
runner to enable strict mode makes the semantics of the source code
irrelevant. Update these tests to use the `noStrict` flag.

Other tests concern language semantics that are only valid in strict
mode, but the mechanism for enabling strictness is inconseqential.
Update these tests to use the `onlyStrict` flag and remove any redundant
`use strict` directive prologues contained within.

Still other tests are valid both within and outside of strict mode.
In keeping with the majority of other tests, do not specify any
restrictions on the environments in which these tests may be run.
parent 6231fe20
No related branches found
No related tags found
No related merge requests found
Showing
with 14 additions and 21 deletions
......@@ -7,7 +7,7 @@
/*---
es5id: 15.4.4.16-5-1-s
description: Array.prototype.every - thisArg not passed to strict callbackfn
flags: [onlyStrict]
flags: [noStrict]
includes: [runTestCase.js]
---*/
......
......@@ -7,7 +7,7 @@
/*---
es5id: 15.4.4.20-5-1-s
description: Array.prototype.filter - thisArg not passed to strict callbackfn
flags: [onlyStrict]
flags: [noStrict]
includes: [runTestCase.js]
---*/
......
......@@ -8,6 +8,6 @@ description: >
flags: [onlyStrict]
---*/
var a = [];
[1, 2].findIndex(function() { "use strict"; a.push(this); }, "");
[1, 2].findIndex(function() { a.push(this); }, "");
assert.sameValue(a[0], "");
assert.sameValue(a[1], a[0]);
......@@ -7,7 +7,7 @@
/*---
es5id: 15.4.4.18-5-1-s
description: Array.prototype.forEach - thisArg not passed to strict callbackfn
flags: [onlyStrict]
flags: [noStrict]
includes: [runTestCase.js]
---*/
......
......@@ -7,7 +7,7 @@
/*---
es5id: 15.4.4.19-5-1-s
description: Array.prototype.map - thisArg not passed to strict callbackfn
flags: [onlyStrict]
flags: [noStrict]
includes: [runTestCase.js]
---*/
......
......@@ -9,7 +9,7 @@ es5id: 15.4.4.21-9-c-ii-4-s
description: >
Array.prototype.reduce - undefined passed as thisValue to strict
callbackfn
flags: [onlyStrict]
flags: [noStrict]
includes: [runTestCase.js]
---*/
......
......@@ -9,7 +9,7 @@ es5id: 15.4.4.22-9-c-ii-4-s
description: >
Array.prototype.reduceRight - undefined passed as thisValue to
strict callbackfn
flags: [onlyStrict]
flags: [noStrict]
includes: [runTestCase.js]
---*/
......
......@@ -7,7 +7,7 @@
/*---
es5id: 15.4.4.17-5-1-s
description: Array.prototype.some - thisArg not passed to strict callbackfn
flags: [onlyStrict]
flags: [noStrict]
includes: [runTestCase.js]
---*/
......
......@@ -5,7 +5,7 @@
info: Call the comparefn passing undefined as the this value (step 13b)
es5id: 15.4.4.11_A8
description: comparefn tests that its this value is undefined
flags: [onlyStrict]
flags: [noStrict]
---*/
var global = this;
......
......@@ -10,7 +10,7 @@ description: >
Strict Mode - SyntaxError is thrown if a function using the
Function constructor has two identical parameters in (local)
strict mode
flags: [onlyStrict]
flags: [noStrict]
---*/
assert.throws(SyntaxError, function() {
......
......@@ -9,7 +9,7 @@ es5id: 15.3.2.1-11-1-s
description: >
Duplicate seperate parameter name in Function constructor throws
SyntaxError in strict mode
flags: [onlyStrict]
flags: [noStrict]
includes: [runTestCase.js]
---*/
......
......@@ -15,7 +15,6 @@ includes: [runTestCase.js]
function testcase()
{
"use strict";
try {
Function('a','a','return;');
return true;
......
......@@ -9,7 +9,7 @@ es5id: 15.3.2.1-11-3-s
description: >
Function constructor having a formal parameter named 'eval' throws
SyntaxError if function body is strict mode
flags: [onlyStrict]
flags: [noStrict]
includes: [runTestCase.js]
---*/
......
......@@ -15,7 +15,6 @@ includes: [runTestCase.js]
---*/
function testcase() {
"use strict";
try {
Function('eval', 'return;');
return true;
......
......@@ -9,7 +9,7 @@ es5id: 15.3.2.1-11-5-s
description: >
Duplicate combined parameter name in Function constructor throws
SyntaxError in strict mode
flags: [onlyStrict]
flags: [noStrict]
includes: [runTestCase.js]
---*/
......
......@@ -15,7 +15,6 @@ includes: [runTestCase.js]
function testcase()
{
"use strict";
try {
Function('a,a','return a;');
return true;
......
......@@ -15,7 +15,6 @@ includes: [runTestCase.js]
---*/
function testcase() {
"use strict";
try {
Function('arguments', 'return;');
return true;
......
......@@ -16,7 +16,6 @@ includes: [runTestCase.js]
---*/
function testcase() {
"use strict";
var foo = new Function("baz", "qux", "baz", "return 0;");
return true;
......
......@@ -11,13 +11,10 @@ description: >
the Function constructor that has three identical parameters and
there is no explicit 'use strict' in the function constructor's
body
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
"use strict";
var foo = new Function("baz", "baz", "baz", "return 0;");
return true;
}
......
......@@ -12,6 +12,7 @@ description: >
flags: [onlyStrict]
---*/
"use strict";
function _15_3_5_1_gs() {}
assert.throws(TypeError, function() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment