mirror of
https://github.com/tc39/test262.git
synced 2025-07-12 16:44:49 +02:00
Replace runTestCase with assert helpers [test/language/function-code]
This commit is contained in:
parent
73d5292b77
commit
789224fbaa
@ -7,12 +7,9 @@ description: >
|
|||||||
Strict Mode - checking 'this' (non-strict function passed as arg
|
Strict Mode - checking 'this' (non-strict function passed as arg
|
||||||
to String.prototype.replace from strict context)
|
to String.prototype.replace from strict context)
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes:
|
includes: [fnGlobalObject.js]
|
||||||
- runTestCase.js
|
|
||||||
- fnGlobalObject.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var x = 3;
|
var x = 3;
|
||||||
|
|
||||||
function f() {
|
function f() {
|
||||||
@ -20,6 +17,5 @@ function f() {
|
|||||||
return "a";
|
return "a";
|
||||||
}
|
}
|
||||||
|
|
||||||
return (function() {"use strict"; return "ab".replace("b", f)==="aa";}()) && (x===fnGlobalObject());
|
assert.sameValue(function() {"use strict"; return "ab".replace("b", f);}(), "aa");
|
||||||
}
|
assert.sameValue(x, fnGlobalObject(), 'x');
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,18 +6,15 @@ es5id: 10.4.3-1-102-s
|
|||||||
description: >
|
description: >
|
||||||
Strict Mode - checking 'this' (strict anonymous function passed as
|
Strict Mode - checking 'this' (strict anonymous function passed as
|
||||||
arg to String.prototype.replace)
|
arg to String.prototype.replace)
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var x = 3;
|
var x = 3;
|
||||||
|
|
||||||
return ("ab".replace("b", (function () {
|
assert.sameValue("ab".replace("b", (function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
return function () {
|
return function () {
|
||||||
x = this;
|
x = this;
|
||||||
return "a";
|
return "a";
|
||||||
}
|
}
|
||||||
})())==="aa") && (x===undefined);
|
})()), "aa");
|
||||||
}
|
assert.sameValue(x, undefined, 'x');
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,14 +6,9 @@ es5id: 10.4.3-1-103
|
|||||||
description: >
|
description: >
|
||||||
Non strict mode should ToObject thisArg if not an object.
|
Non strict mode should ToObject thisArg if not an object.
|
||||||
Abstract equality operator should succeed.
|
Abstract equality operator should succeed.
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase(){
|
|
||||||
Object.defineProperty(Object.prototype, "x", { get: function () { return this; } });
|
Object.defineProperty(Object.prototype, "x", { get: function () { return this; } });
|
||||||
if((5).x == 0) return false;
|
|
||||||
if(!((5).x == 5)) return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
runTestCase(testcase);
|
assert.sameValue((5).x == 0, false, '(5).x == 0');
|
||||||
|
assert((5).x == 5, '(5).x == 5');
|
||||||
|
@ -7,13 +7,8 @@ description: >
|
|||||||
Strict mode should not ToObject thisArg if not an object. Strict
|
Strict mode should not ToObject thisArg if not an object. Strict
|
||||||
equality operator should succeed.
|
equality operator should succeed.
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase(){
|
|
||||||
Object.defineProperty(Object.prototype, "x", { get: function () { return this; } });
|
Object.defineProperty(Object.prototype, "x", { get: function () { return this; } });
|
||||||
if(!((5).x === 5)) return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
runTestCase(testcase);
|
assert((5).x === 5, '(5).x === 5');
|
||||||
|
@ -10,14 +10,9 @@ description: >
|
|||||||
Non strict mode should ToObject thisArg if not an object. Return
|
Non strict mode should ToObject thisArg if not an object. Return
|
||||||
type should be object and strict equality should fail.
|
type should be object and strict equality should fail.
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase(){
|
|
||||||
Object.defineProperty(Object.prototype, "x", { get: function () { return this; } });
|
Object.defineProperty(Object.prototype, "x", { get: function () { return this; } });
|
||||||
if((5).x === 5) return false;
|
|
||||||
if(!(typeof (5).x === "object")) return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
runTestCase(testcase);
|
assert.sameValue((5).x === 5, false, '(5).x === 5');
|
||||||
|
assert.sameValue(typeof (5).x, "object", 'typeof (5).x');
|
||||||
|
@ -10,13 +10,8 @@ description: >
|
|||||||
Strict mode should not ToObject thisArg if not an object. Return
|
Strict mode should not ToObject thisArg if not an object. Return
|
||||||
type should be 'number'.
|
type should be 'number'.
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase(){
|
|
||||||
Object.defineProperty(Object.prototype, "x", { get: function () { return this; } });
|
Object.defineProperty(Object.prototype, "x", { get: function () { return this; } });
|
||||||
if(!(typeof (5).x === "number")) return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
runTestCase(testcase);
|
assert.sameValue(typeof (5).x, "number", 'typeof (5).x');
|
||||||
|
@ -7,12 +7,8 @@ description: >
|
|||||||
Strict Mode - checking 'this' (Anonymous FunctionExpression
|
Strict Mode - checking 'this' (Anonymous FunctionExpression
|
||||||
defined within strict mode)
|
defined within strict mode)
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
assert.sameValue((function () {
|
||||||
return (function () {
|
|
||||||
return typeof this;
|
return typeof this;
|
||||||
})() === "undefined";
|
})(), "undefined");
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,13 +7,9 @@ description: >
|
|||||||
Strict Mode - checking 'this' (Anonymous FunctionExpression
|
Strict Mode - checking 'this' (Anonymous FunctionExpression
|
||||||
includes strict directive prologue)
|
includes strict directive prologue)
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
assert.sameValue((function () {
|
||||||
return (function () {
|
|
||||||
"use strict";
|
"use strict";
|
||||||
return typeof this;
|
return typeof this;
|
||||||
})() === "undefined";
|
})(), "undefined");
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -5,12 +5,11 @@
|
|||||||
es5id: 10.4.3-1-17-s
|
es5id: 10.4.3-1-17-s
|
||||||
description: Strict Mode - checking 'this' (eval used within strict mode)
|
description: Strict Mode - checking 'this' (eval used within strict mode)
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
includes:
|
includes: [fnGlobalObject.js]
|
||||||
- runTestCase.js
|
|
||||||
- fnGlobalObject.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
return (eval("typeof this") === "undefined") && (eval("this") !== fnGlobalObject());
|
assert.sameValue(eval("typeof this"), "undefined", 'eval("typeof this")');
|
||||||
|
assert.notSameValue(eval("this"), fnGlobalObject(), 'eval("this")');
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
testcase();
|
||||||
|
@ -7,13 +7,11 @@ description: >
|
|||||||
Strict Mode - checking 'this' (indirect eval used within strict
|
Strict Mode - checking 'this' (indirect eval used within strict
|
||||||
mode)
|
mode)
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
includes:
|
includes: [fnGlobalObject.js]
|
||||||
- runTestCase.js
|
|
||||||
- fnGlobalObject.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
var my_eval = eval;
|
var my_eval = eval;
|
||||||
return my_eval("this") === fnGlobalObject();
|
assert.sameValue(my_eval("this"), fnGlobalObject(), 'my_eval("this")');
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
testcase();
|
||||||
|
@ -7,13 +7,11 @@ description: >
|
|||||||
Strict Mode - checking 'this' (indirect eval includes strict
|
Strict Mode - checking 'this' (indirect eval includes strict
|
||||||
directive prologue)
|
directive prologue)
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes:
|
includes: [fnGlobalObject.js]
|
||||||
- runTestCase.js
|
|
||||||
- fnGlobalObject.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
var my_eval = eval;
|
var my_eval = eval;
|
||||||
return my_eval("\"use strict\";\nthis") === fnGlobalObject();
|
assert.sameValue(my_eval("\"use strict\";\nthis"), fnGlobalObject());
|
||||||
}
|
}
|
||||||
runTestCase(testcase);
|
testcase();
|
||||||
|
@ -7,15 +7,12 @@ description: >
|
|||||||
Strict Mode - checking 'this' (FunctionDeclaration defined within
|
Strict Mode - checking 'this' (FunctionDeclaration defined within
|
||||||
an Anonymous FunctionExpression inside strict mode)
|
an Anonymous FunctionExpression inside strict mode)
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
(function () {
|
||||||
return (function () {
|
|
||||||
function f() {
|
function f() {
|
||||||
return typeof this;
|
return typeof this;
|
||||||
}
|
}
|
||||||
return (f()==="undefined") && ((typeof this)==="undefined");
|
assert.sameValue(f(), "undefined", 'f()');
|
||||||
|
assert.sameValue(typeof this, "undefined", 'typeof this');
|
||||||
})();
|
})();
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,15 +7,12 @@ description: >
|
|||||||
Strict Mode - checking 'this' (FunctionExpression defined within
|
Strict Mode - checking 'this' (FunctionExpression defined within
|
||||||
an Anonymous FunctionExpression inside strict mode)
|
an Anonymous FunctionExpression inside strict mode)
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
(function () {
|
||||||
return (function () {
|
|
||||||
var f = function () {
|
var f = function () {
|
||||||
return typeof this;
|
return typeof this;
|
||||||
}
|
}
|
||||||
return (f()==="undefined") && ((typeof this)==="undefined");
|
assert.sameValue(f(), "undefined", 'f()');
|
||||||
|
assert.sameValue(typeof this, "undefined", 'typeof this');
|
||||||
})();
|
})();
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,14 +7,11 @@ description: >
|
|||||||
Strict Mode - checking 'this' (Anonymous FunctionExpression
|
Strict Mode - checking 'this' (Anonymous FunctionExpression
|
||||||
defined within an Anonymous FunctionExpression inside strict mode)
|
defined within an Anonymous FunctionExpression inside strict mode)
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
(function () {
|
||||||
return (function () {
|
assert.sameValue((function () {
|
||||||
return ((function () {
|
|
||||||
return typeof this;
|
return typeof this;
|
||||||
})()==="undefined") && ((typeof this)==="undefined");
|
})(), "undefined");
|
||||||
|
assert.sameValue(typeof this, "undefined", 'typeof this');
|
||||||
})();
|
})();
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,16 +7,13 @@ description: >
|
|||||||
Strict Mode - checking 'this' (FunctionDeclaration defined within
|
Strict Mode - checking 'this' (FunctionDeclaration defined within
|
||||||
an Anonymous FunctionExpression with a strict directive prologue)
|
an Anonymous FunctionExpression with a strict directive prologue)
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
(function () {
|
||||||
return (function () {
|
|
||||||
"use strict";
|
"use strict";
|
||||||
function f() {
|
function f() {
|
||||||
return typeof this;
|
return typeof this;
|
||||||
}
|
}
|
||||||
return (f()==="undefined") && ((typeof this)==="undefined");
|
assert.sameValue(f(), "undefined", 'f()');
|
||||||
|
assert.sameValue(typeof this, "undefined", 'typeof this');
|
||||||
})();
|
})();
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,16 +7,13 @@ description: >
|
|||||||
Strict Mode - checking 'this' (FunctionExpression defined within
|
Strict Mode - checking 'this' (FunctionExpression defined within
|
||||||
an Anonymous FunctionExpression with a strict directive prologue)
|
an Anonymous FunctionExpression with a strict directive prologue)
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
(function () {
|
||||||
return (function () {
|
|
||||||
"use strict";
|
"use strict";
|
||||||
var f = function () {
|
var f = function () {
|
||||||
return typeof this;
|
return typeof this;
|
||||||
}
|
}
|
||||||
return (f()==="undefined") && ((typeof this)==="undefined");
|
assert.sameValue(f(), "undefined", 'f()');
|
||||||
|
assert.sameValue(typeof this, "undefined", 'typeof this');
|
||||||
})();
|
})();
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -8,15 +8,12 @@ description: >
|
|||||||
defined within an Anonymous FunctionExpression with a strict
|
defined within an Anonymous FunctionExpression with a strict
|
||||||
directive prologue)
|
directive prologue)
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
(function () {
|
||||||
return (function () {
|
|
||||||
"use strict";
|
"use strict";
|
||||||
return ((function () {
|
assert.sameValue((function () {
|
||||||
return typeof this;
|
return typeof this;
|
||||||
})()==="undefined") && ((typeof this)==="undefined");
|
})(), "undefined");
|
||||||
|
assert.sameValue(typeof this, "undefined", 'typeof this');
|
||||||
})();
|
})();
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,18 +7,14 @@ description: >
|
|||||||
Strict Mode - checking 'this' (FunctionDeclaration with a strict
|
Strict Mode - checking 'this' (FunctionDeclaration with a strict
|
||||||
directive prologue defined within an Anonymous FunctionExpression)
|
directive prologue defined within an Anonymous FunctionExpression)
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes:
|
includes: [fnGlobalObject.js]
|
||||||
- runTestCase.js
|
|
||||||
- fnGlobalObject.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
(function () {
|
||||||
return (function () {
|
|
||||||
function f() {
|
function f() {
|
||||||
"use strict";
|
"use strict";
|
||||||
return typeof this;
|
return typeof this;
|
||||||
}
|
}
|
||||||
return (f()==="undefined") && (this===fnGlobalObject());
|
assert.sameValue(f(), "undefined", 'f()');
|
||||||
|
assert.sameValue(this, fnGlobalObject(), 'this');
|
||||||
})();
|
})();
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,18 +7,14 @@ description: >
|
|||||||
Strict Mode - checking 'this' (FunctionExpression with a strict
|
Strict Mode - checking 'this' (FunctionExpression with a strict
|
||||||
directive prologue defined within an Anonymous FunctionExpression)
|
directive prologue defined within an Anonymous FunctionExpression)
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes:
|
includes: [fnGlobalObject.js]
|
||||||
- runTestCase.js
|
|
||||||
- fnGlobalObject.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
(function () {
|
||||||
return (function () {
|
|
||||||
var f = function () {
|
var f = function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
return typeof this;
|
return typeof this;
|
||||||
}
|
}
|
||||||
return (f()==="undefined") && (this===fnGlobalObject());
|
assert.sameValue(f(), "undefined", 'f()');
|
||||||
|
assert.sameValue(this, fnGlobalObject(), 'this');
|
||||||
})();
|
})();
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -8,17 +8,13 @@ description: >
|
|||||||
strict directive prologue defined within an Anonymous
|
strict directive prologue defined within an Anonymous
|
||||||
FunctionExpression)
|
FunctionExpression)
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes:
|
includes: [fnGlobalObject.js]
|
||||||
- runTestCase.js
|
|
||||||
- fnGlobalObject.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
(function () {
|
||||||
return (function () {
|
assert.sameValue((function () {
|
||||||
return ((function () {
|
|
||||||
"use strict";
|
"use strict";
|
||||||
return typeof this;
|
return typeof this;
|
||||||
})()==="undefined") && (this===fnGlobalObject());
|
})(), "undefined");
|
||||||
|
assert.sameValue(this, fnGlobalObject(), 'this');
|
||||||
})();
|
})();
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -5,11 +5,7 @@
|
|||||||
es5id: 10.4.3-1-63-s
|
es5id: 10.4.3-1-63-s
|
||||||
description: >
|
description: >
|
||||||
checking 'this' (strict function declaration called by non-strict eval)
|
checking 'this' (strict function declaration called by non-strict eval)
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
function f() { "use strict"; return this===undefined;};
|
function f() { "use strict"; return this===undefined;};
|
||||||
return eval("f();");
|
assert(eval("f();"));
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,13 +6,8 @@ es5id: 10.4.3-1-64-s
|
|||||||
description: >
|
description: >
|
||||||
checking 'this' (strict function declaration called by non-strict Function
|
checking 'this' (strict function declaration called by non-strict Function
|
||||||
constructor)
|
constructor)
|
||||||
includes:
|
includes: [fnGlobalObject.js]
|
||||||
- runTestCase.js
|
|
||||||
- fnGlobalObject.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
fnGlobalObject().f = function() { "use strict"; return this===undefined;};
|
fnGlobalObject().f = function() { "use strict"; return this===undefined;};
|
||||||
return Function("return f();")();
|
assert(Function("return f();")());
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,13 +6,8 @@ es5id: 10.4.3-1-65-s
|
|||||||
description: >
|
description: >
|
||||||
checking 'this' (strict function declaration called by non-strict new'ed
|
checking 'this' (strict function declaration called by non-strict new'ed
|
||||||
Function constructor)
|
Function constructor)
|
||||||
includes:
|
includes: [fnGlobalObject.js]
|
||||||
- runTestCase.js
|
|
||||||
- fnGlobalObject.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
fnGlobalObject().f = function() { "use strict"; return this===undefined;};
|
fnGlobalObject().f = function() { "use strict"; return this===undefined;};
|
||||||
return (new Function("return f();"))();
|
assert((new Function("return f();"))());
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,11 +7,7 @@ description: >
|
|||||||
Strict Mode - checking 'this' (non-strict function declaration
|
Strict Mode - checking 'this' (non-strict function declaration
|
||||||
called by strict eval)
|
called by strict eval)
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
function f() { return this!==undefined;};
|
function f() { return this!==undefined;};
|
||||||
return (function () {"use strict"; return eval("f();");})();
|
assert((function () {"use strict"; return eval("f();");})());
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,13 +7,8 @@ description: >
|
|||||||
Strict Mode - checking 'this' (non-strict function declaration
|
Strict Mode - checking 'this' (non-strict function declaration
|
||||||
called by strict Function constructor)
|
called by strict Function constructor)
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes:
|
includes: [fnGlobalObject.js]
|
||||||
- runTestCase.js
|
|
||||||
- fnGlobalObject.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
fnGlobalObject().f = function() {return this!==undefined;};
|
fnGlobalObject().f = function() {return this!==undefined;};
|
||||||
return (function () {return Function("\"use strict\";return f();")();})();
|
assert((function () {return Function("\"use strict\";return f();")();})());
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,13 +7,8 @@ description: >
|
|||||||
Strict Mode - checking 'this' (non-strict function declaration
|
Strict Mode - checking 'this' (non-strict function declaration
|
||||||
called by strict new'ed Function constructor)
|
called by strict new'ed Function constructor)
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes:
|
includes: [fnGlobalObject.js]
|
||||||
- runTestCase.js
|
|
||||||
- fnGlobalObject.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
fnGlobalObject().f = function() { return this!==undefined;};
|
fnGlobalObject().f = function() { return this!==undefined;};
|
||||||
return (function () {return new Function("\"use strict\";return f();")();})();
|
assert((function () {return new Function("\"use strict\";return f();")();})());
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,11 +7,7 @@ description: >
|
|||||||
Strict Mode - checking 'this' (non-strict function declaration
|
Strict Mode - checking 'this' (non-strict function declaration
|
||||||
called by strict Function.prototype.apply())
|
called by strict Function.prototype.apply())
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
function f() { return this!==undefined;};
|
function f() { return this!==undefined;};
|
||||||
return (function () {"use strict"; return f.apply();})();
|
assert((function () {"use strict"; return f.apply();})());
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,13 +7,8 @@ description: >
|
|||||||
Strict Mode - checking 'this' (non-strict function declaration
|
Strict Mode - checking 'this' (non-strict function declaration
|
||||||
called by strict Function.prototype.apply(null))
|
called by strict Function.prototype.apply(null))
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes:
|
includes: [fnGlobalObject.js]
|
||||||
- runTestCase.js
|
|
||||||
- fnGlobalObject.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
function f() { return this===fnGlobalObject();};
|
function f() { return this===fnGlobalObject();};
|
||||||
return (function () {"use strict"; return f.apply(null);})();
|
assert((function () {"use strict"; return f.apply(null);})());
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,13 +7,8 @@ description: >
|
|||||||
Strict Mode - checking 'this' (non-strict function declaration
|
Strict Mode - checking 'this' (non-strict function declaration
|
||||||
called by strict Function.prototype.apply(undefined))
|
called by strict Function.prototype.apply(undefined))
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes:
|
includes: [fnGlobalObject.js]
|
||||||
- runTestCase.js
|
|
||||||
- fnGlobalObject.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
function f() { return this===fnGlobalObject()};
|
function f() { return this===fnGlobalObject()};
|
||||||
return (function () {"use strict"; return f.apply(undefined);})();
|
assert((function () {"use strict"; return f.apply(undefined);})());
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,12 +7,8 @@ description: >
|
|||||||
Strict Mode - checking 'this' (non-strict function declaration
|
Strict Mode - checking 'this' (non-strict function declaration
|
||||||
called by strict Function.prototype.apply(someObject))
|
called by strict Function.prototype.apply(someObject))
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var o = {};
|
var o = {};
|
||||||
function f() { return this===o;};
|
function f() { return this===o;};
|
||||||
return (function () {"use strict"; return f.apply(o);})();
|
assert((function () {"use strict"; return f.apply(o);})());
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,13 +7,8 @@ description: >
|
|||||||
Strict Mode - checking 'this' (non-strict function declaration
|
Strict Mode - checking 'this' (non-strict function declaration
|
||||||
called by strict Function.prototype.apply(globalObject))
|
called by strict Function.prototype.apply(globalObject))
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes:
|
includes: [fnGlobalObject.js]
|
||||||
- runTestCase.js
|
|
||||||
- fnGlobalObject.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
function f() { return this;};
|
function f() { return this;};
|
||||||
return (function () {"use strict"; return f.apply(fnGlobalObject()); })() === fnGlobalObject();
|
assert.sameValue((function () {"use strict"; return f.apply(fnGlobalObject()); })(), fnGlobalObject());
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,13 +7,8 @@ description: >
|
|||||||
Strict Mode - checking 'this' (non-strict function declaration
|
Strict Mode - checking 'this' (non-strict function declaration
|
||||||
called by strict Function.prototype.call())
|
called by strict Function.prototype.call())
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes:
|
includes: [fnGlobalObject.js]
|
||||||
- runTestCase.js
|
|
||||||
- fnGlobalObject.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
function f() { return this===fnGlobalObject();};
|
function f() { return this===fnGlobalObject();};
|
||||||
return (function () {"use strict"; return f.call(); })();
|
assert((function () {"use strict"; return f.call(); })());
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,13 +7,8 @@ description: >
|
|||||||
Strict Mode - checking 'this' (non-strict function declaration
|
Strict Mode - checking 'this' (non-strict function declaration
|
||||||
called by strict Function.prototype.call(null))
|
called by strict Function.prototype.call(null))
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes:
|
includes: [fnGlobalObject.js]
|
||||||
- runTestCase.js
|
|
||||||
- fnGlobalObject.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
function f() { return this===fnGlobalObject();};
|
function f() { return this===fnGlobalObject();};
|
||||||
return (function () {"use strict"; return f.call(null); })();
|
assert((function () {"use strict"; return f.call(null); })());
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,13 +7,8 @@ description: >
|
|||||||
Strict Mode - checking 'this' (non-strict function declaration
|
Strict Mode - checking 'this' (non-strict function declaration
|
||||||
called by strict Function.prototype.call(undefined))
|
called by strict Function.prototype.call(undefined))
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes:
|
includes: [fnGlobalObject.js]
|
||||||
- runTestCase.js
|
|
||||||
- fnGlobalObject.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
function f() { return this===fnGlobalObject();};
|
function f() { return this===fnGlobalObject();};
|
||||||
return (function () {"use strict"; return f.call(undefined);})();
|
assert((function () {"use strict"; return f.call(undefined);})());
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,12 +7,8 @@ description: >
|
|||||||
Strict Mode - checking 'this' (non-strict function declaration
|
Strict Mode - checking 'this' (non-strict function declaration
|
||||||
called by strict Function.prototype.call(someObject))
|
called by strict Function.prototype.call(someObject))
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var o = {};
|
var o = {};
|
||||||
function f() { return this===o;};
|
function f() { return this===o;};
|
||||||
return (function () {"use strict"; return f.call(o); })();
|
assert((function () {"use strict"; return f.call(o); })());
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,13 +7,8 @@ description: >
|
|||||||
Strict Mode - checking 'this' (non-strict function declaration
|
Strict Mode - checking 'this' (non-strict function declaration
|
||||||
called by strict Function.prototype.call(globalObject))
|
called by strict Function.prototype.call(globalObject))
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes:
|
includes: [fnGlobalObject.js]
|
||||||
- runTestCase.js
|
|
||||||
- fnGlobalObject.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
function f() { return this===fnGlobalObject();};
|
function f() { return this===fnGlobalObject();};
|
||||||
return (function () {"use strict"; return f.call(fnGlobalObject());})();
|
assert((function () {"use strict"; return f.call(fnGlobalObject());})());
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,13 +7,8 @@ description: >
|
|||||||
Strict Mode - checking 'this' (non-strict function declaration
|
Strict Mode - checking 'this' (non-strict function declaration
|
||||||
called by strict Function.prototype.bind()())
|
called by strict Function.prototype.bind()())
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes:
|
includes: [fnGlobalObject.js]
|
||||||
- runTestCase.js
|
|
||||||
- fnGlobalObject.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
function f() { return this===fnGlobalObject();};
|
function f() { return this===fnGlobalObject();};
|
||||||
return (function () {"use strict"; return f.bind()(); })();
|
assert((function () {"use strict"; return f.bind()(); })());
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,13 +7,8 @@ description: >
|
|||||||
Strict Mode - checking 'this' (non-strict function declaration
|
Strict Mode - checking 'this' (non-strict function declaration
|
||||||
called by strict Function.prototype.bind(null)())
|
called by strict Function.prototype.bind(null)())
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes:
|
includes: [fnGlobalObject.js]
|
||||||
- runTestCase.js
|
|
||||||
- fnGlobalObject.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
function f() { return this===fnGlobalObject();};
|
function f() { return this===fnGlobalObject();};
|
||||||
return (function () {"use strict"; return f.bind(null)(); })();
|
assert((function () {"use strict"; return f.bind(null)(); })());
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,13 +7,8 @@ description: >
|
|||||||
Strict Mode - checking 'this' (non-strict function declaration
|
Strict Mode - checking 'this' (non-strict function declaration
|
||||||
called by strict Function.prototype.bind(undefined)())
|
called by strict Function.prototype.bind(undefined)())
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes:
|
includes: [fnGlobalObject.js]
|
||||||
- runTestCase.js
|
|
||||||
- fnGlobalObject.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
function f() { return this===fnGlobalObject();};
|
function f() { return this===fnGlobalObject();};
|
||||||
return (function () {"use strict"; return f.bind(undefined)();})();
|
assert((function () {"use strict"; return f.bind(undefined)();})());
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,12 +7,8 @@ description: >
|
|||||||
Strict Mode - checking 'this' (non-strict function declaration
|
Strict Mode - checking 'this' (non-strict function declaration
|
||||||
called by strict Function.prototype.bind(someObject)())
|
called by strict Function.prototype.bind(someObject)())
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var o = {};
|
var o = {};
|
||||||
function f() { return this===o;};
|
function f() { return this===o;};
|
||||||
return (function () {"use strict"; return f.bind(o)();})();
|
assert((function () {"use strict"; return f.bind(o)();})());
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,13 +7,8 @@ description: >
|
|||||||
Strict Mode - checking 'this' (non-strict function declaration
|
Strict Mode - checking 'this' (non-strict function declaration
|
||||||
called by strict Function.prototype.bind(globalObject)())
|
called by strict Function.prototype.bind(globalObject)())
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
includes:
|
includes: [fnGlobalObject.js]
|
||||||
- runTestCase.js
|
|
||||||
- fnGlobalObject.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
function f() { return this===fnGlobalObject();};
|
function f() { return this===fnGlobalObject();};
|
||||||
return (function () {"use strict"; return f.bind(fnGlobalObject())();})();
|
assert((function () {"use strict"; return f.bind(fnGlobalObject())();})());
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user