mirror of
https://github.com/tc39/test262.git
synced 2025-07-23 14:04:51 +02:00
Merge pull request #305 from jugglinmike/browser-only-strict
Update browser runner to honor `onlyStrict` flag
This commit is contained in:
commit
e4a25da86a
@ -113,7 +113,7 @@ This tag is used to identify the author of a test case.
|
|||||||
|
|
||||||
This tag is for boolean properties associated with the test.
|
This tag is for boolean properties associated with the test.
|
||||||
|
|
||||||
- **`onlyStrict`** - only run the test in strict mode (*not supported by the browser runner*)
|
- **`onlyStrict`** - only run the test in strict mode
|
||||||
- **`noStrict`** - only run the test in "sloppy" mode
|
- **`noStrict`** - only run the test in "sloppy" mode
|
||||||
- **`module`** - interpret the source text as [module
|
- **`module`** - interpret the source text as [module
|
||||||
code](http://www.ecma-international.org/ecma-262/6.0/#sec-modules)
|
code](http://www.ecma-international.org/ecma-262/6.0/#sec-modules)
|
||||||
|
@ -235,11 +235,7 @@ function BrowserRunner() {
|
|||||||
|
|
||||||
//Run the code
|
//Run the code
|
||||||
idoc.writeln("<script type='text/javascript'>");
|
idoc.writeln("<script type='text/javascript'>");
|
||||||
if (! instance.supportsWindowOnerror) {
|
idoc.writeln(this.compileSource(test, code));
|
||||||
idoc.writeln("try {eval(\"" + this.convertForEval(code) + "\");} catch(e) {window.onerror(e.toString(), null, null);}");
|
|
||||||
} else {
|
|
||||||
idoc.writeln(code);
|
|
||||||
}
|
|
||||||
idoc.writeln("</script>");
|
idoc.writeln("</script>");
|
||||||
|
|
||||||
idoc.writeln("<script type='text/javascript'>");
|
idoc.writeln("<script type='text/javascript'>");
|
||||||
@ -269,6 +265,30 @@ function BrowserRunner() {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Transform the test source code according to the test metadata and the
|
||||||
|
* capabilities of the current environment.
|
||||||
|
*
|
||||||
|
* @param {object} test - a test object as retrieved by TestLoader
|
||||||
|
* @param {string} code - unmodified test source code
|
||||||
|
*
|
||||||
|
* @returns {string} the transformed source code
|
||||||
|
*/
|
||||||
|
BrowserRunner.prototype.compileSource = function(test, code) {
|
||||||
|
var flags = test.flags;
|
||||||
|
|
||||||
|
if (flags && flags.indexOf("onlyStrict") > -1) {
|
||||||
|
code = "'use strict';\n" + code;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.supportsWindowOnerror) {
|
||||||
|
code = "try {eval(\"" + this.convertForEval(code) +
|
||||||
|
"\");} catch(e) {window.onerror(e.toString(), null, null);}";
|
||||||
|
}
|
||||||
|
|
||||||
|
return code;
|
||||||
|
};
|
||||||
|
|
||||||
/* Loads tests from the sections specified in testcases.json.
|
/* Loads tests from the sections specified in testcases.json.
|
||||||
* Public Methods:
|
* Public Methods:
|
||||||
* * getNextTest() - Start loading the next test.
|
* * getNextTest() - Start loading the next test.
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
/*---
|
/*---
|
||||||
es5id: 15.4.4.16-5-1-s
|
es5id: 15.4.4.16-5-1-s
|
||||||
description: Array.prototype.every - thisArg not passed to strict callbackfn
|
description: Array.prototype.every - thisArg not passed to strict callbackfn
|
||||||
flags: [onlyStrict]
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
/*---
|
/*---
|
||||||
es5id: 15.4.4.20-5-1-s
|
es5id: 15.4.4.20-5-1-s
|
||||||
description: Array.prototype.filter - thisArg not passed to strict callbackfn
|
description: Array.prototype.filter - thisArg not passed to strict callbackfn
|
||||||
flags: [onlyStrict]
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -8,6 +8,6 @@ description: >
|
|||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
var a = [];
|
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[0], "");
|
||||||
assert.sameValue(a[1], a[0]);
|
assert.sameValue(a[1], a[0]);
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
/*---
|
/*---
|
||||||
es5id: 15.4.4.18-5-1-s
|
es5id: 15.4.4.18-5-1-s
|
||||||
description: Array.prototype.forEach - thisArg not passed to strict callbackfn
|
description: Array.prototype.forEach - thisArg not passed to strict callbackfn
|
||||||
flags: [onlyStrict]
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
/*---
|
/*---
|
||||||
es5id: 15.4.4.19-5-1-s
|
es5id: 15.4.4.19-5-1-s
|
||||||
description: Array.prototype.map - thisArg not passed to strict callbackfn
|
description: Array.prototype.map - thisArg not passed to strict callbackfn
|
||||||
flags: [onlyStrict]
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ es5id: 15.4.4.21-9-c-ii-4-s
|
|||||||
description: >
|
description: >
|
||||||
Array.prototype.reduce - undefined passed as thisValue to strict
|
Array.prototype.reduce - undefined passed as thisValue to strict
|
||||||
callbackfn
|
callbackfn
|
||||||
flags: [onlyStrict]
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ es5id: 15.4.4.22-9-c-ii-4-s
|
|||||||
description: >
|
description: >
|
||||||
Array.prototype.reduceRight - undefined passed as thisValue to
|
Array.prototype.reduceRight - undefined passed as thisValue to
|
||||||
strict callbackfn
|
strict callbackfn
|
||||||
flags: [onlyStrict]
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
/*---
|
/*---
|
||||||
es5id: 15.4.4.17-5-1-s
|
es5id: 15.4.4.17-5-1-s
|
||||||
description: Array.prototype.some - thisArg not passed to strict callbackfn
|
description: Array.prototype.some - thisArg not passed to strict callbackfn
|
||||||
flags: [onlyStrict]
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
info: Call the comparefn passing undefined as the this value (step 13b)
|
info: Call the comparefn passing undefined as the this value (step 13b)
|
||||||
es5id: 15.4.4.11_A8
|
es5id: 15.4.4.11_A8
|
||||||
description: comparefn tests that its this value is undefined
|
description: comparefn tests that its this value is undefined
|
||||||
flags: [onlyStrict]
|
flags: [noStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var global = this;
|
var global = this;
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
// 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.
|
|
||||||
|
|
||||||
/*---
|
|
||||||
es5id: 15.3.2.1-10-4gs
|
|
||||||
description: >
|
|
||||||
Strict Mode - SyntaxError is thrown if a function using the
|
|
||||||
Function constructor has two identical parameters in (global)
|
|
||||||
strict mode
|
|
||||||
negative: Test262Error
|
|
||||||
flags: [onlyStrict]
|
|
||||||
includes: [Test262Error.js]
|
|
||||||
---*/
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
throw new Test262Error();
|
|
||||||
var _15_3_2_1_10_4_fun = new Function('param_1', 'param_2', 'param_1', '"use strict"; return 0;');
|
|
@ -10,10 +10,9 @@ description: >
|
|||||||
Strict Mode - SyntaxError is thrown if a function using the
|
Strict Mode - SyntaxError is thrown if a function using the
|
||||||
Function constructor has two identical parameters in (local)
|
Function constructor has two identical parameters in (local)
|
||||||
strict mode
|
strict mode
|
||||||
negative: Test262Error
|
flags: [noStrict]
|
||||||
flags: [onlyStrict]
|
|
||||||
includes: [Test262Error.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
throw new Test262Error();
|
assert.throws(SyntaxError, function() {
|
||||||
var _15_3_2_1_10_6_fun = new Function('param_1', 'param_2', 'param_1', '"use strict";return 0;');
|
new Function('param_1', 'param_2', 'param_1', '"use strict";return 0;');
|
||||||
|
});
|
||||||
|
@ -9,7 +9,7 @@ es5id: 15.3.2.1-11-1-s
|
|||||||
description: >
|
description: >
|
||||||
Duplicate seperate parameter name in Function constructor throws
|
Duplicate seperate parameter name in Function constructor throws
|
||||||
SyntaxError in strict mode
|
SyntaxError in strict mode
|
||||||
flags: [onlyStrict]
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@ includes: [runTestCase.js]
|
|||||||
|
|
||||||
function testcase()
|
function testcase()
|
||||||
{
|
{
|
||||||
"use strict";
|
|
||||||
try {
|
try {
|
||||||
Function('a','a','return;');
|
Function('a','a','return;');
|
||||||
return true;
|
return true;
|
||||||
|
@ -9,7 +9,7 @@ es5id: 15.3.2.1-11-3-s
|
|||||||
description: >
|
description: >
|
||||||
Function constructor having a formal parameter named 'eval' throws
|
Function constructor having a formal parameter named 'eval' throws
|
||||||
SyntaxError if function body is strict mode
|
SyntaxError if function body is strict mode
|
||||||
flags: [onlyStrict]
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@ includes: [runTestCase.js]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
"use strict";
|
|
||||||
try {
|
try {
|
||||||
Function('eval', 'return;');
|
Function('eval', 'return;');
|
||||||
return true;
|
return true;
|
||||||
|
@ -9,7 +9,7 @@ es5id: 15.3.2.1-11-5-s
|
|||||||
description: >
|
description: >
|
||||||
Duplicate combined parameter name in Function constructor throws
|
Duplicate combined parameter name in Function constructor throws
|
||||||
SyntaxError in strict mode
|
SyntaxError in strict mode
|
||||||
flags: [onlyStrict]
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@ includes: [runTestCase.js]
|
|||||||
|
|
||||||
function testcase()
|
function testcase()
|
||||||
{
|
{
|
||||||
"use strict";
|
|
||||||
try {
|
try {
|
||||||
Function('a,a','return a;');
|
Function('a,a','return a;');
|
||||||
return true;
|
return true;
|
||||||
|
@ -15,7 +15,6 @@ includes: [runTestCase.js]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
"use strict";
|
|
||||||
try {
|
try {
|
||||||
Function('arguments', 'return;');
|
Function('arguments', 'return;');
|
||||||
return true;
|
return true;
|
||||||
|
@ -16,7 +16,6 @@ includes: [runTestCase.js]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
"use strict";
|
|
||||||
|
|
||||||
var foo = new Function("baz", "qux", "baz", "return 0;");
|
var foo = new Function("baz", "qux", "baz", "return 0;");
|
||||||
return true;
|
return true;
|
||||||
|
@ -7,17 +7,14 @@
|
|||||||
/*---
|
/*---
|
||||||
es5id: 15.3.2.1-11-9-s
|
es5id: 15.3.2.1-11-9-s
|
||||||
description: >
|
description: >
|
||||||
Strict Mode - SyntaxError is thrown if a function is created using
|
Strict Mode - No SyntaxError is thrown if a function is created using
|
||||||
the Function constructor that has three identical parameters and
|
the Function constructor that has three identical parameters and
|
||||||
there is no explicit 'use strict' in the function constructor's
|
there is no explicit 'use strict' in the function constructor's
|
||||||
body
|
body
|
||||||
flags: [onlyStrict]
|
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
"use strict";
|
|
||||||
|
|
||||||
var foo = new Function("baz", "baz", "baz", "return 0;");
|
var foo = new Function("baz", "baz", "baz", "return 0;");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -9,12 +9,12 @@ es5id: 15.3.5-1gs
|
|||||||
description: >
|
description: >
|
||||||
StrictMode - error is thrown when reading the 'caller' property of
|
StrictMode - error is thrown when reading the 'caller' property of
|
||||||
a function object
|
a function object
|
||||||
negative: Test262Error
|
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
includes: [Test262Error.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
function _15_3_5_1_gs() {}
|
function _15_3_5_1_gs() {}
|
||||||
throw new Test262Error();
|
|
||||||
_15_3_5_1_gs.caller;
|
assert.throws(TypeError, function() {
|
||||||
|
_15_3_5_1_gs.caller;
|
||||||
|
});
|
||||||
|
@ -13,7 +13,6 @@ negative: TypeError
|
|||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
"use strict";
|
|
||||||
function _15_3_5_1_gs() {}
|
function _15_3_5_1_gs() {}
|
||||||
_15_3_5_1_gs.caller;
|
_15_3_5_1_gs.caller;
|
||||||
throw NotEarlyError;
|
throw NotEarlyError;
|
||||||
|
@ -13,7 +13,6 @@ negative: TypeError
|
|||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
"use strict";
|
|
||||||
eval("gNonStrict();");
|
eval("gNonStrict();");
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@ negative: TypeError
|
|||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
"use strict";
|
|
||||||
var my_eval = eval;
|
var my_eval = eval;
|
||||||
my_eval("gNonStrict();");
|
my_eval("gNonStrict();");
|
||||||
|
|
||||||
|
@ -14,7 +14,6 @@ negative: TypeError
|
|||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
"use strict";
|
|
||||||
function f() {
|
function f() {
|
||||||
return gNonStrict();
|
return gNonStrict();
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,6 @@ negative: TypeError
|
|||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
"use strict";
|
|
||||||
var f = function () {
|
var f = function () {
|
||||||
return gNonStrict();
|
return gNonStrict();
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,6 @@ negative: TypeError
|
|||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
"use strict";
|
|
||||||
var obj = new (function () {
|
var obj = new (function () {
|
||||||
return gNonStrict();
|
return gNonStrict();
|
||||||
});
|
});
|
||||||
|
@ -13,7 +13,6 @@ negative: TypeError
|
|||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
"use strict";
|
|
||||||
function f() {
|
function f() {
|
||||||
return gNonStrict();
|
return gNonStrict();
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,6 @@ negative: TypeError
|
|||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
"use strict";
|
|
||||||
function f1() {
|
function f1() {
|
||||||
function f() {
|
function f() {
|
||||||
return gNonStrict();
|
return gNonStrict();
|
||||||
|
@ -14,7 +14,6 @@ negative: TypeError
|
|||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
"use strict";
|
|
||||||
function f1() {
|
function f1() {
|
||||||
var f = function () {
|
var f = function () {
|
||||||
return gNonStrict();
|
return gNonStrict();
|
||||||
|
@ -14,7 +14,6 @@ negative: TypeError
|
|||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
"use strict";
|
|
||||||
function f1() {
|
function f1() {
|
||||||
return (function () {
|
return (function () {
|
||||||
return gNonStrict();
|
return gNonStrict();
|
||||||
|
@ -14,7 +14,6 @@ negative: TypeError
|
|||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
"use strict";
|
|
||||||
var f1 = function () {
|
var f1 = function () {
|
||||||
function f() {
|
function f() {
|
||||||
return gNonStrict();
|
return gNonStrict();
|
||||||
|
@ -14,7 +14,6 @@ negative: TypeError
|
|||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
"use strict";
|
|
||||||
var f1 = function () {
|
var f1 = function () {
|
||||||
var f = function () {
|
var f = function () {
|
||||||
return gNonStrict();
|
return gNonStrict();
|
||||||
|
@ -14,7 +14,6 @@ negative: TypeError
|
|||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
"use strict";
|
|
||||||
var f1 = function () {
|
var f1 = function () {
|
||||||
return (function () {
|
return (function () {
|
||||||
return gNonStrict();
|
return gNonStrict();
|
||||||
|
@ -14,7 +14,6 @@ negative: TypeError
|
|||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
"use strict";
|
|
||||||
(function () {
|
(function () {
|
||||||
function f() {
|
function f() {
|
||||||
return gNonStrict();
|
return gNonStrict();
|
||||||
|
@ -14,7 +14,6 @@ negative: TypeError
|
|||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
"use strict";
|
|
||||||
(function () {
|
(function () {
|
||||||
var f = function () {
|
var f = function () {
|
||||||
return gNonStrict();
|
return gNonStrict();
|
||||||
|
@ -14,7 +14,6 @@ negative: TypeError
|
|||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
"use strict";
|
|
||||||
(function () {
|
(function () {
|
||||||
return (function () {
|
return (function () {
|
||||||
return gNonStrict();
|
return gNonStrict();
|
||||||
|
@ -13,7 +13,6 @@ negative: TypeError
|
|||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
"use strict";
|
|
||||||
var f = function () {
|
var f = function () {
|
||||||
return gNonStrict();
|
return gNonStrict();
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,6 @@ negative: TypeError
|
|||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
"use strict";
|
|
||||||
var o = { get foo() { return gNonStrict(); } }
|
var o = { get foo() { return gNonStrict(); } }
|
||||||
o.foo;
|
o.foo;
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@ negative: TypeError
|
|||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
"use strict";
|
|
||||||
var o = { set foo(stuff) { return gNonStrict(); } }
|
var o = { set foo(stuff) { return gNonStrict(); } }
|
||||||
o.foo = 7;
|
o.foo = 7;
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@ negative: TypeError
|
|||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
"use strict";
|
|
||||||
var o = {};
|
var o = {};
|
||||||
Object.defineProperty(o, "foo", { get: function() { return gNonStrict(); } });
|
Object.defineProperty(o, "foo", { get: function() { return gNonStrict(); } });
|
||||||
o.foo;
|
o.foo;
|
||||||
|
@ -13,7 +13,6 @@ negative: TypeError
|
|||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
"use strict";
|
|
||||||
var o = {};
|
var o = {};
|
||||||
Object.defineProperty(o, "foo", { set: function(stuff) { return gNonStrict(); } });
|
Object.defineProperty(o, "foo", { set: function(stuff) { return gNonStrict(); } });
|
||||||
o.foo = 9;
|
o.foo = 9;
|
||||||
|
@ -14,7 +14,6 @@ negative: TypeError
|
|||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
"use strict";
|
|
||||||
(function () {
|
(function () {
|
||||||
return gNonStrict();
|
return gNonStrict();
|
||||||
})();
|
})();
|
||||||
|
@ -13,7 +13,6 @@ negative: TypeError
|
|||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
"use strict";
|
|
||||||
var f = Function("return gNonStrict();");
|
var f = Function("return gNonStrict();");
|
||||||
f();
|
f();
|
||||||
|
|
||||||
|
@ -14,7 +14,6 @@ negative: TypeError
|
|||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
"use strict";
|
|
||||||
var f = new Function("return gNonStrict();");
|
var f = new Function("return gNonStrict();");
|
||||||
f();
|
f();
|
||||||
|
|
||||||
|
@ -15,8 +15,6 @@ includes: [runTestCase.js]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
"use strict";
|
|
||||||
|
|
||||||
function fun() {
|
function fun() {
|
||||||
return (this instanceof String);
|
return (this instanceof String);
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,6 @@ includes: [runTestCase.js]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
"use strict";
|
|
||||||
function fun() {
|
function fun() {
|
||||||
return (this instanceof Number);
|
return (this instanceof Number);
|
||||||
}
|
}
|
||||||
|
@ -15,8 +15,6 @@ includes: [runTestCase.js]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
"use strict";
|
|
||||||
|
|
||||||
function fun() {
|
function fun() {
|
||||||
return (this instanceof Boolean);
|
return (this instanceof Boolean);
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,6 @@ includes: [runTestCase.js]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
"use strict";
|
|
||||||
function fun() {
|
function fun() {
|
||||||
return (this instanceof String);
|
return (this instanceof String);
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,6 @@ includes: [runTestCase.js]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
"use strict";
|
|
||||||
function fun() {
|
function fun() {
|
||||||
return (this instanceof Number);
|
return (this instanceof Number);
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,6 @@ includes: [runTestCase.js]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
"use strict";
|
|
||||||
function fun() {
|
function fun() {
|
||||||
return (this instanceof Boolean);
|
return (this instanceof Boolean);
|
||||||
}
|
}
|
||||||
|
@ -17,8 +17,6 @@ flags: [onlyStrict]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
(function (a, b, c) {
|
(function (a, b, c) {
|
||||||
"use strict";
|
|
||||||
|
|
||||||
Object.defineProperty(arguments, "0", {
|
Object.defineProperty(arguments, "0", {
|
||||||
value: 20,
|
value: 20,
|
||||||
writable: false,
|
writable: false,
|
||||||
|
@ -10,10 +10,8 @@ description: >
|
|||||||
Check that all the own property names reported by
|
Check that all the own property names reported by
|
||||||
Object.getOwnPropertyNames on a strict function are names that
|
Object.getOwnPropertyNames on a strict function are names that
|
||||||
hasOwnProperty agrees are own properties.
|
hasOwnProperty agrees are own properties.
|
||||||
flags: [onlyStrict]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
"use strict";
|
|
||||||
function foo() {}
|
function foo() {}
|
||||||
|
|
||||||
var names = Object.getOwnPropertyNames(foo);
|
var names = Object.getOwnPropertyNames(foo);
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
info: Call replaceValue passing undefined as the this value
|
info: Call replaceValue passing undefined as the this value
|
||||||
es5id: 15.5.4.11_A12
|
es5id: 15.5.4.11_A12
|
||||||
description: replaceValue tests that its this value is undefined
|
description: replaceValue tests that its this value is undefined
|
||||||
flags: [onlyStrict]
|
flags: [noStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var global = this;
|
var global = this;
|
||||||
|
@ -14,8 +14,6 @@ includes: [runTestCase.js]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
"use strict";
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
NaN = 12;
|
NaN = 12;
|
||||||
return false;
|
return false;
|
||||||
|
@ -14,7 +14,6 @@ includes: [runTestCase.js]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
"use strict";
|
|
||||||
try {
|
try {
|
||||||
undefined = 12;
|
undefined = 12;
|
||||||
return false;
|
return false;
|
||||||
|
@ -15,7 +15,6 @@ includes: [runTestCase.js]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
"use strict";
|
|
||||||
var objBak = Object;
|
var objBak = Object;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -15,8 +15,6 @@ includes: [runTestCase.js]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
"use strict";
|
|
||||||
|
|
||||||
var numBak = Number;
|
var numBak = Number;
|
||||||
try {
|
try {
|
||||||
Number = 12;
|
Number = 12;
|
||||||
|
@ -6,7 +6,6 @@ description: >
|
|||||||
Objects whose specified property is not writable satisfy the assertion in
|
Objects whose specified property is not writable satisfy the assertion in
|
||||||
strict mode.
|
strict mode.
|
||||||
includes: [propertyHelper.js]
|
includes: [propertyHelper.js]
|
||||||
flags: [onlyStrict]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var obj = {};
|
var obj = {};
|
||||||
|
@ -6,7 +6,6 @@ description: >
|
|||||||
Objects whose specified property is not writable do not satisfy the
|
Objects whose specified property is not writable do not satisfy the
|
||||||
assertion in strict mode.
|
assertion in strict mode.
|
||||||
includes: [propertyHelper.js]
|
includes: [propertyHelper.js]
|
||||||
flags: [onlyStrict]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var threw = false;
|
var threw = false;
|
||||||
|
@ -12,7 +12,6 @@ includes: [runTestCase.js]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
"use strict";
|
|
||||||
try {
|
try {
|
||||||
(function fun() {
|
(function fun() {
|
||||||
eval("arguments = 10");
|
eval("arguments = 10");
|
||||||
|
@ -11,7 +11,6 @@ negative: SyntaxError
|
|||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
"use strict";
|
|
||||||
throw NotEarlyError;
|
throw NotEarlyError;
|
||||||
|
|
||||||
function f_10_5_1_gs(){
|
function f_10_5_1_gs(){
|
||||||
|
@ -12,8 +12,6 @@ includes: [runTestCase.js]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
"use strict";
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
eval("(function _10_5_7_b_1_fun() { arguments = 10;} ());");
|
eval("(function _10_5_7_b_1_fun() { arguments = 10;} ());");
|
||||||
return false;
|
return false;
|
||||||
|
@ -6,14 +6,11 @@
|
|||||||
|
|
||||||
/*---
|
/*---
|
||||||
es5id: 10.5-7-b-2-s
|
es5id: 10.5-7-b-2-s
|
||||||
description: Strict Mode - arguments object index assignment is allowed
|
description: Arguments object index assignment is allowed
|
||||||
flags: [onlyStrict]
|
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
"use strict";
|
|
||||||
|
|
||||||
function _10_5_7_b_2_fun() {
|
function _10_5_7_b_2_fun() {
|
||||||
arguments[7] = 12;
|
arguments[7] = 12;
|
||||||
return arguments[7] === 12;
|
return arguments[7] === 12;
|
||||||
|
@ -7,15 +7,11 @@
|
|||||||
/*---
|
/*---
|
||||||
es5id: 10.5-7-b-3-s
|
es5id: 10.5-7-b-3-s
|
||||||
description: >
|
description: >
|
||||||
Strict Mode - Adding property to the arguments object successful
|
Adding property to the arguments object successful under strict mode
|
||||||
under strict mode
|
|
||||||
flags: [onlyStrict]
|
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
"use strict";
|
|
||||||
|
|
||||||
function _10_5_7_b_3_fun() {
|
function _10_5_7_b_3_fun() {
|
||||||
arguments[1] = 12;
|
arguments[1] = 12;
|
||||||
return arguments[0] === 30 && arguments[1] === 12;
|
return arguments[0] === 30 && arguments[1] === 12;
|
||||||
|
@ -7,15 +7,11 @@
|
|||||||
/*---
|
/*---
|
||||||
es5id: 10.5-7-b-4-s
|
es5id: 10.5-7-b-4-s
|
||||||
description: >
|
description: >
|
||||||
Strict Mode - Deleting property of the arguments object successful
|
Deleting property of the arguments object successful under strict mode
|
||||||
under strict mode
|
|
||||||
flags: [onlyStrict]
|
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
"use strict";
|
|
||||||
|
|
||||||
function _10_5_7_b_4_fun() {
|
function _10_5_7_b_4_fun() {
|
||||||
var _10_5_7_b_4_1 = arguments[0] === 30 && arguments[1] === 12;
|
var _10_5_7_b_4_1 = arguments[0] === 30 && arguments[1] === 12;
|
||||||
delete arguments[1];
|
delete arguments[1];
|
||||||
|
@ -16,7 +16,6 @@ includes: [runTestCase.js]
|
|||||||
function testcase() {
|
function testcase() {
|
||||||
function foo(a,b,c)
|
function foo(a,b,c)
|
||||||
{
|
{
|
||||||
'use strict';
|
|
||||||
a = 1; b = 'str'; c = 2.1;
|
a = 1; b = 'str'; c = 2.1;
|
||||||
return (arguments[0] === 10 && arguments[1] === 'sss' && arguments[2] === 1);
|
return (arguments[0] === 10 && arguments[1] === 'sss' && arguments[2] === 1);
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,6 @@ function testcase() {
|
|||||||
|
|
||||||
function foo(a,b,c)
|
function foo(a,b,c)
|
||||||
{
|
{
|
||||||
'use strict';
|
|
||||||
arguments[0] = 1; arguments[1] = 'str'; arguments[2] = 2.1;
|
arguments[0] = 1; arguments[1] = 'str'; arguments[2] = 2.1;
|
||||||
return 10 === a && 'sss' === b && 1 === c;
|
return 10 === a && 'sss' === b && 1 === c;
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,6 @@ includes: [runTestCase.js]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
'use strict';
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
arguments.caller;
|
arguments.caller;
|
||||||
|
@ -12,8 +12,6 @@ includes: [runTestCase.js]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
|
|
||||||
'use strict';
|
|
||||||
var desc = Object.getOwnPropertyDescriptor(arguments,"caller");
|
var desc = Object.getOwnPropertyDescriptor(arguments,"caller");
|
||||||
return desc!== undefined;
|
return desc!== undefined;
|
||||||
}
|
}
|
||||||
|
@ -12,8 +12,6 @@ includes: [runTestCase.js]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
|
|
||||||
'use strict';
|
|
||||||
var desc = Object.getOwnPropertyDescriptor(arguments,"caller");
|
var desc = Object.getOwnPropertyDescriptor(arguments,"caller");
|
||||||
|
|
||||||
return (desc.configurable === false &&
|
return (desc.configurable === false &&
|
||||||
|
@ -14,7 +14,6 @@ includes: [runTestCase.js]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
'use strict';
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
arguments.callee;
|
arguments.callee;
|
||||||
|
@ -6,14 +6,11 @@
|
|||||||
|
|
||||||
/*---
|
/*---
|
||||||
es5id: 10.6-13-c-2-s
|
es5id: 10.6-13-c-2-s
|
||||||
description: arguments.callee is exists in strict mode
|
description: arguments.callee is exists
|
||||||
flags: [onlyStrict]
|
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
|
|
||||||
'use strict';
|
|
||||||
var desc = Object.getOwnPropertyDescriptor(arguments,"callee");
|
var desc = Object.getOwnPropertyDescriptor(arguments,"callee");
|
||||||
return desc !== undefined;
|
return desc !== undefined;
|
||||||
}
|
}
|
||||||
|
@ -12,8 +12,6 @@ includes: [runTestCase.js]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
|
|
||||||
'use strict';
|
|
||||||
var desc = Object.getOwnPropertyDescriptor(arguments,"callee");
|
var desc = Object.getOwnPropertyDescriptor(arguments,"callee");
|
||||||
return (desc.configurable === false &&
|
return (desc.configurable === false &&
|
||||||
desc.enumerable === false &&
|
desc.enumerable === false &&
|
||||||
|
@ -12,7 +12,6 @@ includes: [runTestCase.js]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
"use strict";
|
|
||||||
var argObj = function () {
|
var argObj = function () {
|
||||||
return arguments;
|
return arguments;
|
||||||
} ();
|
} ();
|
||||||
|
@ -14,8 +14,6 @@ includes: [runTestCase.js]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
"use strict";
|
|
||||||
|
|
||||||
var argObj = function () {
|
var argObj = function () {
|
||||||
return arguments;
|
return arguments;
|
||||||
} ();
|
} ();
|
||||||
|
@ -14,8 +14,6 @@ includes: [runTestCase.js]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
"use strict";
|
|
||||||
|
|
||||||
var argObj = function () {
|
var argObj = function () {
|
||||||
return arguments;
|
return arguments;
|
||||||
} ();
|
} ();
|
||||||
|
@ -7,15 +7,11 @@
|
|||||||
/*---
|
/*---
|
||||||
es5id: 10.6-14-c-1-s
|
es5id: 10.6-14-c-1-s
|
||||||
description: >
|
description: >
|
||||||
Strict Mode - [[Enumerable]] attribute value in 'callee' is false
|
[[Enumerable]] attribute value in 'callee' is false
|
||||||
under strict mode
|
|
||||||
flags: [onlyStrict]
|
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
"use strict";
|
|
||||||
|
|
||||||
var argObj = function () {
|
var argObj = function () {
|
||||||
return arguments;
|
return arguments;
|
||||||
} ();
|
} ();
|
||||||
|
@ -14,8 +14,6 @@ includes: [runTestCase.js]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
"use strict";
|
|
||||||
|
|
||||||
var argObj = function () {
|
var argObj = function () {
|
||||||
return arguments;
|
return arguments;
|
||||||
} ();
|
} ();
|
||||||
|
@ -12,7 +12,6 @@ description: >
|
|||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
"use strict";
|
|
||||||
function f_10_6_1_gs(){
|
function f_10_6_1_gs(){
|
||||||
return arguments.callee;
|
return arguments.callee;
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,6 @@ negative: .
|
|||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
"use strict";
|
|
||||||
function f_10_6_1_gs(){
|
function f_10_6_1_gs(){
|
||||||
return arguments.callee;
|
return arguments.callee;
|
||||||
}
|
}
|
||||||
|
@ -9,12 +9,10 @@ es5id: 10.6-6-3
|
|||||||
description: >
|
description: >
|
||||||
'length' property of arguments object for 0 argument function
|
'length' property of arguments object for 0 argument function
|
||||||
exists
|
exists
|
||||||
flags: [onlyStrict]
|
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
'use strict';
|
|
||||||
return (function () {return arguments.length !== undefined})();
|
return (function () {return arguments.length !== undefined})();
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
runTestCase(testcase);
|
||||||
|
@ -9,12 +9,10 @@ es5id: 10.6-6-4
|
|||||||
description: >
|
description: >
|
||||||
'length' property of arguments object for 0 argument function call
|
'length' property of arguments object for 0 argument function call
|
||||||
is 0 even with formal parameters
|
is 0 even with formal parameters
|
||||||
flags: [onlyStrict]
|
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
'use strict';
|
|
||||||
return (function (a,b,c) {return arguments.length === 0})();
|
return (function (a,b,c) {return arguments.length === 0})();
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
runTestCase(testcase);
|
||||||
|
@ -14,8 +14,7 @@ includes: [runTestCase.js]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
"use strict";
|
eval("function fun(x){ return x }");
|
||||||
eval("(function fun(x){ return x })(10)");
|
|
||||||
return typeof (fun) === "undefined";
|
return typeof (fun) === "undefined";
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
runTestCase(testcase);
|
||||||
|
@ -9,7 +9,6 @@ es5id: 10.4.2-3-c-1-s
|
|||||||
description: >
|
description: >
|
||||||
Direct eval code in strict mode - cannot instantiate variable in
|
Direct eval code in strict mode - cannot instantiate variable in
|
||||||
the variable environment of the calling context
|
the variable environment of the calling context
|
||||||
flags: [onlyStrict]
|
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -16,7 +16,6 @@ includes: [runTestCase.js]
|
|||||||
function testcase() {
|
function testcase() {
|
||||||
var _10_4_2_3_c_2_s = 0;
|
var _10_4_2_3_c_2_s = 0;
|
||||||
function _10_4_2_3_c_2_sFunc() {
|
function _10_4_2_3_c_2_sFunc() {
|
||||||
'use strict';
|
|
||||||
eval("var _10_4_2_3_c_2_s = 1");
|
eval("var _10_4_2_3_c_2_s = 1");
|
||||||
return _10_4_2_3_c_2_s===0;
|
return _10_4_2_3_c_2_s===0;
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,6 @@ includes: [runTestCase.js]
|
|||||||
var _10_4_2_3_c_3_s = 0;
|
var _10_4_2_3_c_3_s = 0;
|
||||||
function testcase() {
|
function testcase() {
|
||||||
function _10_4_2_3_c_3_sFunc() {
|
function _10_4_2_3_c_3_sFunc() {
|
||||||
'use strict';
|
|
||||||
eval("var _10_4_2_3_c_3_s = 1");
|
eval("var _10_4_2_3_c_3_s = 1");
|
||||||
return _10_4_2_3_c_3_s===0;
|
return _10_4_2_3_c_3_s===0;
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,6 @@ negative: ReferenceError
|
|||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
"use strict";
|
|
||||||
eval("var x = 7;");
|
eval("var x = 7;");
|
||||||
x = 9;
|
x = 9;
|
||||||
throw NotEarlyError;
|
throw NotEarlyError;
|
||||||
|
@ -14,8 +14,6 @@ includes: [runTestCase.js]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
"use strict";
|
|
||||||
|
|
||||||
eval("function _10_4_2_1_2_fun(){}");
|
eval("function _10_4_2_1_2_fun(){}");
|
||||||
return typeof _10_4_2_1_2_fun === "undefined";
|
return typeof _10_4_2_1_2_fun === "undefined";
|
||||||
}
|
}
|
||||||
|
@ -8,14 +8,11 @@
|
|||||||
es5id: 10.4.2.1-4-s
|
es5id: 10.4.2.1-4-s
|
||||||
description: >
|
description: >
|
||||||
Strict Mode - Strict mode eval code cannot instantiate functions
|
Strict Mode - Strict mode eval code cannot instantiate functions
|
||||||
in the variable environment of the caller to eval which is
|
in the variable environment of the caller to eval.
|
||||||
contained in strict mode code
|
|
||||||
flags: [onlyStrict]
|
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
|
|
||||||
eval("'use strict'; function _10_4_2_1_4_fun(){}");
|
eval("'use strict'; function _10_4_2_1_4_fun(){}");
|
||||||
return typeof _10_4_2_1_4_fun === "undefined";
|
return typeof _10_4_2_1_4_fun === "undefined";
|
||||||
}
|
}
|
||||||
|
@ -6,10 +6,8 @@ es5id: 10.4.2.1_A1
|
|||||||
description: >
|
description: >
|
||||||
Strict indirect eval should not leak top level declarations into
|
Strict indirect eval should not leak top level declarations into
|
||||||
the global scope
|
the global scope
|
||||||
flags: [onlyStrict]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
"use strict";
|
|
||||||
if (!('foo' in this)) {
|
if (!('foo' in this)) {
|
||||||
(1,eval)('"use strict"; var foo = 88;');
|
(1,eval)('"use strict"; var foo = 88;');
|
||||||
if ('foo' in this) {
|
if ('foo' in this) {
|
||||||
|
@ -9,13 +9,11 @@ info: PutValue operates only on references (see step 3.a).
|
|||||||
es5id: 11.13.1-1-6-s
|
es5id: 11.13.1-1-6-s
|
||||||
description: >
|
description: >
|
||||||
simple assignment throws ReferenceError if LeftHandSide is an
|
simple assignment throws ReferenceError if LeftHandSide is an
|
||||||
unresolvable reference in strict mode (base obj undefined)
|
unresolvable reference (base obj undefined)
|
||||||
flags: [onlyStrict]
|
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
'use strict';
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
__ES3_1_test_suite_test_11_13_1_unique_id_0__.x = 42;
|
__ES3_1_test_suite_test_11_13_1_unique_id_0__.x = 42;
|
||||||
|
@ -15,7 +15,6 @@ includes: [runTestCase.js]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
"use strict";
|
|
||||||
var obj = {};
|
var obj = {};
|
||||||
Object.defineProperty(obj, "prop", {
|
Object.defineProperty(obj, "prop", {
|
||||||
value: 10,
|
value: 10,
|
||||||
|
@ -15,7 +15,6 @@ includes: [runTestCase.js]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
"use strict";
|
|
||||||
var obj = {};
|
var obj = {};
|
||||||
Object.defineProperty(obj, "prop", {
|
Object.defineProperty(obj, "prop", {
|
||||||
get: function () {
|
get: function () {
|
||||||
|
@ -16,7 +16,6 @@ includes: [runTestCase.js]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
"use strict";
|
|
||||||
var obj = {};
|
var obj = {};
|
||||||
Object.preventExtensions(obj);
|
Object.preventExtensions(obj);
|
||||||
|
|
||||||
|
@ -14,8 +14,6 @@ includes: [runTestCase.js]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
'use strict';
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Number.MAX_VALUE = 42;
|
Number.MAX_VALUE = 42;
|
||||||
return false;
|
return false;
|
||||||
|
@ -15,7 +15,6 @@ includes: [runTestCase.js]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
"use strict";
|
|
||||||
var blah = eval;
|
var blah = eval;
|
||||||
try {
|
try {
|
||||||
eval("var eval = 20;");
|
eval("var eval = 20;");
|
||||||
|
@ -13,5 +13,4 @@ negative: TypeError
|
|||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
"use strict";
|
|
||||||
Math.PI = 20;
|
Math.PI = 20;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user