mirror of
https://github.com/tc39/test262.git
synced 2025-07-28 16:34:27 +02:00
Replace runTestCase with assert helpers [test/built-ins/Function]
This commit is contained in:
parent
b1ecdd00e8
commit
60a2879133
@ -6,12 +6,6 @@ es5id: 15.3.2.1-11-1
|
|||||||
description: >
|
description: >
|
||||||
Duplicate separate parameter name in Function constructor allowed
|
Duplicate separate parameter name in Function constructor allowed
|
||||||
if body not strict
|
if body not strict
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase()
|
|
||||||
{
|
|
||||||
Function('a','a','return;');
|
Function('a','a','return;');
|
||||||
return true;
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,11 +6,6 @@ es5id: 15.3.2.1-11-3
|
|||||||
description: >
|
description: >
|
||||||
Function constructor may have a formal parameter named 'eval' if
|
Function constructor may have a formal parameter named 'eval' if
|
||||||
body is not strict mode
|
body is not strict mode
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
Function('eval', 'return;');
|
Function('eval', 'return;');
|
||||||
return true;
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,12 +6,6 @@ es5id: 15.3.2.1-11-5
|
|||||||
description: >
|
description: >
|
||||||
Duplicate combined parameter name in Function constructor allowed
|
Duplicate combined parameter name in Function constructor allowed
|
||||||
if body is not strict
|
if body is not strict
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase()
|
|
||||||
{
|
|
||||||
Function('a,a','return;');
|
Function('a,a','return;');
|
||||||
return true;
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -9,13 +9,6 @@ description: >
|
|||||||
which are separated by a unique parameter name and there is no
|
which are separated by a unique parameter name and there is no
|
||||||
explicit 'use strict' in the function constructor's body
|
explicit 'use strict' in the function constructor's body
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var foo = new Function("baz", "qux", "baz", "return 0;");
|
var foo = new Function("baz", "qux", "baz", "return 0;");
|
||||||
return true;
|
|
||||||
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -8,11 +8,6 @@ description: >
|
|||||||
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
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var foo = new Function("baz", "baz", "baz", "return 0;");
|
var foo = new Function("baz", "baz", "baz", "return 0;");
|
||||||
return true;
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -4,17 +4,11 @@
|
|||||||
/*---
|
/*---
|
||||||
es5id: 15.3.3.2-1
|
es5id: 15.3.3.2-1
|
||||||
description: Function.length - data property with value 1
|
description: Function.length - data property with value 1
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var desc = Object.getOwnPropertyDescriptor(Function,"length");
|
var desc = Object.getOwnPropertyDescriptor(Function,"length");
|
||||||
if(desc.value === 1 &&
|
|
||||||
desc.writable === false &&
|
|
||||||
desc.enumerable === false &&
|
|
||||||
desc.configurable === true)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
}
|
assert.sameValue(desc.value, 1, 'desc.value');
|
||||||
runTestCase(testcase);
|
assert.sameValue(desc.writable, false, 'desc.writable');
|
||||||
|
assert.sameValue(desc.enumerable, false, 'desc.enumerable');
|
||||||
|
assert.sameValue(desc.configurable, true, 'desc.configurable');
|
||||||
|
@ -8,13 +8,10 @@ description: >
|
|||||||
to wrapper objects when the function is called with an array of
|
to wrapper objects when the function is called with an array of
|
||||||
arguments
|
arguments
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
function fun() {
|
function fun() {
|
||||||
return (this instanceof String);
|
return (this instanceof String);
|
||||||
}
|
}
|
||||||
return !fun.apply("", Array);
|
|
||||||
}
|
assert.sameValue(fun.apply("", Array), false, 'fun.apply("", Array)');
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -8,13 +8,10 @@ description: >
|
|||||||
to wrapper objects when the function is called with an array of
|
to wrapper objects when the function is called with an array of
|
||||||
arguments
|
arguments
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
function fun() {
|
function fun() {
|
||||||
return (this instanceof Number);
|
return (this instanceof Number);
|
||||||
}
|
}
|
||||||
return !fun.apply(-12, Array);
|
|
||||||
}
|
assert.sameValue(fun.apply(-12, Array), false, 'fun.apply(-12, Array)');
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -8,13 +8,10 @@ description: >
|
|||||||
to wrapper objects when the function is called with an array of
|
to wrapper objects when the function is called with an array of
|
||||||
arguments
|
arguments
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
function fun() {
|
function fun() {
|
||||||
return (this instanceof Boolean);
|
return (this instanceof Boolean);
|
||||||
}
|
}
|
||||||
return !fun.apply(false, Array);
|
|
||||||
}
|
assert.sameValue(fun.apply(false, Array), false, 'fun.apply(false, Array)');
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -4,14 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
es5id: 15.3.4.5-0-1
|
es5id: 15.3.4.5-0-1
|
||||||
description: Function.prototype.bind must exist as a function
|
description: Function.prototype.bind must exist as a function
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var f = Function.prototype.bind;
|
var f = Function.prototype.bind;
|
||||||
|
|
||||||
if (typeof(f) === "function") {
|
assert.sameValue(typeof(f), "function", 'typeof(f)');
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -4,12 +4,6 @@
|
|||||||
/*---
|
/*---
|
||||||
es5id: 15.3.4.5-0-2
|
es5id: 15.3.4.5-0-2
|
||||||
description: Function.prototype.bind must exist as a function taking 1 parameter
|
description: Function.prototype.bind must exist as a function taking 1 parameter
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
assert.sameValue(Function.prototype.bind.length, 1, 'Function.prototype.bind.length');
|
||||||
if (Function.prototype.bind.length === 1) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,14 +6,10 @@ es5id: 15.3.4.5-10-1
|
|||||||
description: >
|
description: >
|
||||||
Function.prototype.bind - internal property [[Class]] of 'F' is
|
Function.prototype.bind - internal property [[Class]] of 'F' is
|
||||||
set as Function
|
set as Function
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var foo = function () { };
|
var foo = function () { };
|
||||||
|
|
||||||
var obj = foo.bind({});
|
var obj = foo.bind({});
|
||||||
return Object.prototype.toString.call(obj) === "[object Function]";
|
|
||||||
}
|
assert.sameValue(Object.prototype.toString.call(obj), "[object Function]", 'Object.prototype.toString.call(obj)');
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -4,16 +4,11 @@
|
|||||||
/*---
|
/*---
|
||||||
es5id: 15.3.4.5-13.b-1
|
es5id: 15.3.4.5-13.b-1
|
||||||
description: Function.prototype.bind, bound fn has a 'length' own property
|
description: Function.prototype.bind, bound fn has a 'length' own property
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
function foo() { }
|
function foo() { }
|
||||||
var o = {};
|
var o = {};
|
||||||
|
|
||||||
var bf = foo.bind(o);
|
var bf = foo.bind(o);
|
||||||
if (bf.hasOwnProperty('length')) {
|
|
||||||
return true;
|
assert(bf.hasOwnProperty('length'), 'bf.hasOwnProperty("length") !== true');
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,16 +6,11 @@ es5id: 15.3.4.5-13.b-2
|
|||||||
description: >
|
description: >
|
||||||
Function.prototype.bind, 'length' set to remaining number of
|
Function.prototype.bind, 'length' set to remaining number of
|
||||||
expected args
|
expected args
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
function foo(x, y) { }
|
function foo(x, y) { }
|
||||||
var o = {};
|
var o = {};
|
||||||
|
|
||||||
var bf = foo.bind(o);
|
var bf = foo.bind(o);
|
||||||
if (bf.length === 2) {
|
|
||||||
return true;
|
assert.sameValue(bf.length, 2, 'bf.length');
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,16 +6,11 @@ es5id: 15.3.4.5-13.b-3
|
|||||||
description: >
|
description: >
|
||||||
Function.prototype.bind, 'length' set to remaining number of
|
Function.prototype.bind, 'length' set to remaining number of
|
||||||
expected args (all args prefilled)
|
expected args (all args prefilled)
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
function foo(x, y) { }
|
function foo(x, y) { }
|
||||||
var o = {};
|
var o = {};
|
||||||
|
|
||||||
var bf = foo.bind(o, 42, 101);
|
var bf = foo.bind(o, 42, 101);
|
||||||
if (bf.length === 0) {
|
|
||||||
return true;
|
assert.sameValue(bf.length, 0, 'bf.length');
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,16 +6,11 @@ es5id: 15.3.4.5-13.b-4
|
|||||||
description: >
|
description: >
|
||||||
Function.prototype.bind, 'length' set to remaining number of
|
Function.prototype.bind, 'length' set to remaining number of
|
||||||
expected args (target takes 0 args)
|
expected args (target takes 0 args)
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
function foo() { }
|
function foo() { }
|
||||||
var o = {};
|
var o = {};
|
||||||
|
|
||||||
var bf = foo.bind(o);
|
var bf = foo.bind(o);
|
||||||
if (bf.length === 0) {
|
|
||||||
return true;
|
assert.sameValue(bf.length, 0, 'bf.length');
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,16 +6,11 @@ es5id: 15.3.4.5-13.b-5
|
|||||||
description: >
|
description: >
|
||||||
Function.prototype.bind, 'length' set to remaining number of
|
Function.prototype.bind, 'length' set to remaining number of
|
||||||
expected args (target provided extra args)
|
expected args (target provided extra args)
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
function foo() { }
|
function foo() { }
|
||||||
var o = {};
|
var o = {};
|
||||||
|
|
||||||
var bf = foo.bind(o, 42);
|
var bf = foo.bind(o, 42);
|
||||||
if (bf.length === 0) {
|
|
||||||
return true;
|
assert.sameValue(bf.length, 0, 'bf.length');
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,16 +6,11 @@ es5id: 15.3.4.5-13.b-6
|
|||||||
description: >
|
description: >
|
||||||
Function.prototype.bind, 'length' set to remaining number of
|
Function.prototype.bind, 'length' set to remaining number of
|
||||||
expected args
|
expected args
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
function foo(x, y) { }
|
function foo(x, y) { }
|
||||||
var o = {};
|
var o = {};
|
||||||
|
|
||||||
var bf = foo.bind(o, 42);
|
var bf = foo.bind(o, 42);
|
||||||
if (bf.length === 1) {
|
|
||||||
return true;
|
assert.sameValue(bf.length, 1, 'bf.length');
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -4,19 +4,14 @@
|
|||||||
/*---
|
/*---
|
||||||
es5id: 15.3.4.5-15-1
|
es5id: 15.3.4.5-15-1
|
||||||
description: Function.prototype.bind, 'length' is a data valued own property
|
description: Function.prototype.bind, 'length' is a data valued own property
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
function foo() { }
|
function foo() { }
|
||||||
var o = {};
|
var o = {};
|
||||||
|
|
||||||
var bf = foo.bind(o);
|
var bf = foo.bind(o);
|
||||||
var desc = Object.getOwnPropertyDescriptor(bf, 'length');
|
var desc = Object.getOwnPropertyDescriptor(bf, 'length');
|
||||||
if (desc.hasOwnProperty('value') === true &&
|
|
||||||
desc.hasOwnProperty('get') === false &&
|
assert.sameValue(desc.hasOwnProperty('value'), true, 'desc.hasOwnProperty("value")');
|
||||||
desc.hasOwnProperty('set') === false) {
|
assert.sameValue(desc.hasOwnProperty('get'), false, 'desc.hasOwnProperty("get")');
|
||||||
return true;
|
assert.sameValue(desc.hasOwnProperty('set'), false, 'desc.hasOwnProperty("set")');
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -5,20 +5,15 @@
|
|||||||
es5id: 15.3.4.5-15-2
|
es5id: 15.3.4.5-15-2
|
||||||
description: >
|
description: >
|
||||||
Function.prototype.bind, 'length' is a data valued own property
|
Function.prototype.bind, 'length' is a data valued own property
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
function foo() { }
|
function foo() { }
|
||||||
var o = {};
|
var o = {};
|
||||||
|
|
||||||
var bf = foo.bind(o);
|
var bf = foo.bind(o);
|
||||||
var desc = Object.getOwnPropertyDescriptor(bf, 'length');
|
var desc = Object.getOwnPropertyDescriptor(bf, 'length');
|
||||||
if (desc.value === 0 &&
|
|
||||||
desc.enumerable === false &&
|
assert.sameValue(desc.value, 0, 'desc.value');
|
||||||
desc.writable === false &&
|
assert.sameValue(desc.enumerable, false, 'desc.enumerable');
|
||||||
desc.configurable == true) {
|
assert.sameValue(desc.writable, false, 'desc.writable');
|
||||||
return true;
|
assert.sameValue(desc.configurable, true, 'desc.configurable');
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,11 +6,8 @@ es5id: 15.3.4.5-15-4
|
|||||||
description: >
|
description: >
|
||||||
Function.prototype.bind - The [[Enumerable]] attribute of length
|
Function.prototype.bind - The [[Enumerable]] attribute of length
|
||||||
property in F set as false
|
property in F set as false
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var canEnumerable = false;
|
var canEnumerable = false;
|
||||||
var hasProperty = false;
|
var hasProperty = false;
|
||||||
function foo() { }
|
function foo() { }
|
||||||
@ -21,6 +18,6 @@ function testcase() {
|
|||||||
canEnumerable = true;
|
canEnumerable = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return hasProperty && !canEnumerable;
|
|
||||||
}
|
assert(hasProperty, 'hasProperty !== true');
|
||||||
runTestCase(testcase);
|
assert.sameValue(canEnumerable, false, 'canEnumerable');
|
||||||
|
@ -6,11 +6,8 @@ es5id: 15.3.4.5-15-5
|
|||||||
description: >
|
description: >
|
||||||
Function.prototype.bind - The [[Configurable]] attribute of length
|
Function.prototype.bind - The [[Configurable]] attribute of length
|
||||||
property in F set as false
|
property in F set as false
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var canConfigurable = false;
|
var canConfigurable = false;
|
||||||
var hasProperty = false;
|
var hasProperty = false;
|
||||||
function foo() { }
|
function foo() { }
|
||||||
@ -18,6 +15,6 @@ function testcase() {
|
|||||||
hasProperty = obj.hasOwnProperty("length");
|
hasProperty = obj.hasOwnProperty("length");
|
||||||
delete obj.caller;
|
delete obj.caller;
|
||||||
canConfigurable = !obj.hasOwnProperty("length");
|
canConfigurable = !obj.hasOwnProperty("length");
|
||||||
return hasProperty && !canConfigurable;
|
|
||||||
}
|
assert(hasProperty, 'hasProperty !== true');
|
||||||
runTestCase(testcase);
|
assert.sameValue(canConfigurable, false, 'canConfigurable');
|
||||||
|
@ -4,17 +4,12 @@
|
|||||||
/*---
|
/*---
|
||||||
es5id: 15.3.4.5-16-1
|
es5id: 15.3.4.5-16-1
|
||||||
description: Function.prototype.bind, [[Extensible]] of the bound fn is true
|
description: Function.prototype.bind, [[Extensible]] of the bound fn is true
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
function foo() { }
|
function foo() { }
|
||||||
var o = {};
|
var o = {};
|
||||||
|
|
||||||
var bf = foo.bind(o);
|
var bf = foo.bind(o);
|
||||||
var ex = Object.isExtensible(bf);
|
var ex = Object.isExtensible(bf);
|
||||||
if (ex === true) {
|
|
||||||
return true;
|
assert.sameValue(ex, true, 'ex');
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,14 +6,10 @@ es5id: 15.3.4.5-16-2
|
|||||||
description: >
|
description: >
|
||||||
Function.prototype.bind - The [[Extensible]] attribute of internal
|
Function.prototype.bind - The [[Extensible]] attribute of internal
|
||||||
property in F set as true
|
property in F set as true
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
function foo() { }
|
function foo() { }
|
||||||
var obj = foo.bind({});
|
var obj = foo.bind({});
|
||||||
obj.property = 12;
|
obj.property = 12;
|
||||||
return obj.hasOwnProperty("property");
|
|
||||||
}
|
assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true');
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,14 +7,9 @@ info: >
|
|||||||
is not callable.
|
is not callable.
|
||||||
es5id: 15.3.4.5-2-3
|
es5id: 15.3.4.5-2-3
|
||||||
description: Function.prototype.bind allows Target to be a constructor (Number)
|
description: Function.prototype.bind allows Target to be a constructor (Number)
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var bnc = Number.bind(null);
|
var bnc = Number.bind(null);
|
||||||
var n = bnc(42);
|
var n = bnc(42);
|
||||||
if (n === 42) {
|
|
||||||
return true;
|
assert.sameValue(n, 42, 'n');
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,14 +7,9 @@ info: >
|
|||||||
is not callable.
|
is not callable.
|
||||||
es5id: 15.3.4.5-2-4
|
es5id: 15.3.4.5-2-4
|
||||||
description: Function.prototype.bind allows Target to be a constructor (String)
|
description: Function.prototype.bind allows Target to be a constructor (String)
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var bsc = String.bind(null);
|
var bsc = String.bind(null);
|
||||||
var s = bsc("hello world");
|
var s = bsc("hello world");
|
||||||
if (s === "hello world") {
|
|
||||||
return true;
|
assert.sameValue(s, "hello world", 's');
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,14 +7,9 @@ info: >
|
|||||||
is not callable.
|
is not callable.
|
||||||
es5id: 15.3.4.5-2-5
|
es5id: 15.3.4.5-2-5
|
||||||
description: Function.prototype.bind allows Target to be a constructor (Boolean)
|
description: Function.prototype.bind allows Target to be a constructor (Boolean)
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var bbc = Boolean.bind(null);
|
var bbc = Boolean.bind(null);
|
||||||
var b = bbc(true);
|
var b = bbc(true);
|
||||||
if (b === true) {
|
|
||||||
return true;
|
assert.sameValue(b, true, 'b');
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,14 +7,9 @@ info: >
|
|||||||
is not callable.
|
is not callable.
|
||||||
es5id: 15.3.4.5-2-6
|
es5id: 15.3.4.5-2-6
|
||||||
description: Function.prototype.bind allows Target to be a constructor (Object)
|
description: Function.prototype.bind allows Target to be a constructor (Object)
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var boc = Object.bind(null);
|
var boc = Object.bind(null);
|
||||||
var o = boc(42);
|
var o = boc(42);
|
||||||
if (o == 42) {
|
|
||||||
return true;
|
assert((o == 42), '(o == 42) !== true');
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,15 +7,13 @@ info: >
|
|||||||
is not callable.
|
is not callable.
|
||||||
es5id: 15.3.4.5-2-8
|
es5id: 15.3.4.5-2-8
|
||||||
description: Function.prototype.bind allows Target to be a constructor (Array)
|
description: Function.prototype.bind allows Target to be a constructor (Array)
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var bac = Array.bind(null);
|
var bac = Array.bind(null);
|
||||||
var a = bac(42);
|
var a = bac(42);
|
||||||
a.prop = "verifyPropertyExist";
|
a.prop = "verifyPropertyExist";
|
||||||
a[41] = 41;
|
a[41] = 41;
|
||||||
|
|
||||||
return a.prop === "verifyPropertyExist" && a[41] === 41 && a.length === 42;
|
assert.sameValue(a.prop, "verifyPropertyExist", 'a.prop');
|
||||||
}
|
assert.sameValue(a[41], 41, 'a[41]');
|
||||||
runTestCase(testcase);
|
assert.sameValue(a.length, 42, 'a.length');
|
||||||
|
@ -4,14 +4,9 @@
|
|||||||
/*---
|
/*---
|
||||||
es5id: 15.3.4.5-2-9
|
es5id: 15.3.4.5-2-9
|
||||||
description: Function.prototype.bind allows Target to be a constructor (Date)
|
description: Function.prototype.bind allows Target to be a constructor (Date)
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var bdc = Date.bind(null);
|
var bdc = Date.bind(null);
|
||||||
var s = bdc(0, 0, 0);
|
var s = bdc(0, 0, 0);
|
||||||
if (typeof(s) === 'string') {
|
|
||||||
return true;
|
assert.sameValue(typeof(s), 'string', 'typeof(s)');
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -4,17 +4,13 @@
|
|||||||
/*---
|
/*---
|
||||||
es5id: 15.3.4.5-3-1
|
es5id: 15.3.4.5-3-1
|
||||||
description: Function.prototype.bind - each arg is defined in A in list order
|
description: Function.prototype.bind - each arg is defined in A in list order
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var foo = function (x, y) {
|
var foo = function (x, y) {
|
||||||
return new Boolean((x + y) === "ab" && arguments[0] === "a" &&
|
return new Boolean((x + y) === "ab" && arguments[0] === "a" &&
|
||||||
arguments[1] === "b" && arguments.length === 2);
|
arguments[1] === "b" && arguments.length === 2);
|
||||||
};
|
};
|
||||||
|
|
||||||
var obj = foo.bind({}, "a", "b");
|
var obj = foo.bind({}, "a", "b");
|
||||||
return obj()==true;
|
|
||||||
}
|
assert((obj() == true), '(obj() == true) !== true');
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -4,15 +4,11 @@
|
|||||||
/*---
|
/*---
|
||||||
es5id: 15.3.4.5-6-1
|
es5id: 15.3.4.5-6-1
|
||||||
description: Function.prototype.bind - F can get own data property
|
description: Function.prototype.bind - F can get own data property
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var foo = function () { };
|
var foo = function () { };
|
||||||
|
|
||||||
var obj = foo.bind({});
|
var obj = foo.bind({});
|
||||||
obj.property = 12;
|
obj.property = 12;
|
||||||
return obj.property === 12;
|
|
||||||
}
|
assert.sameValue(obj.property, 12, 'obj.property');
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -4,14 +4,10 @@
|
|||||||
/*---
|
/*---
|
||||||
es5id: 15.3.4.5-6-12
|
es5id: 15.3.4.5-6-12
|
||||||
description: Function.prototype.bind - F cannot get property which doesn't exist
|
description: Function.prototype.bind - F cannot get property which doesn't exist
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var foo = function () { };
|
var foo = function () { };
|
||||||
|
|
||||||
var obj = foo.bind({});
|
var obj = foo.bind({});
|
||||||
return typeof (obj.property) === "undefined";
|
|
||||||
}
|
assert.sameValue(typeof (obj.property), "undefined", 'typeof (obj.property)');
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -4,11 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
es5id: 15.3.4.5-6-5
|
es5id: 15.3.4.5-6-5
|
||||||
description: Function.prototype.bind - F can get own accessor property
|
description: Function.prototype.bind - F can get own accessor property
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var foo = function () { };
|
var foo = function () { };
|
||||||
|
|
||||||
var obj = foo.bind({});
|
var obj = foo.bind({});
|
||||||
@ -17,6 +14,5 @@ function testcase() {
|
|||||||
return 12;
|
return 12;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return obj.property === 12;
|
|
||||||
}
|
assert.sameValue(obj.property, 12, 'obj.property');
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,17 +6,14 @@ es5id: 15.3.4.5-6-9
|
|||||||
description: >
|
description: >
|
||||||
Function.prototype.bind - F can get own accessor property without
|
Function.prototype.bind - F can get own accessor property without
|
||||||
a get function
|
a get function
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var foo = function () { };
|
var foo = function () { };
|
||||||
|
|
||||||
var obj = foo.bind({});
|
var obj = foo.bind({});
|
||||||
Object.defineProperty(obj, "property", {
|
Object.defineProperty(obj, "property", {
|
||||||
set: function () {}
|
set: function () {}
|
||||||
});
|
});
|
||||||
return obj.hasOwnProperty("property") && typeof (obj.property) === "undefined";
|
|
||||||
}
|
assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true');
|
||||||
runTestCase(testcase);
|
assert.sameValue(typeof (obj.property), "undefined", 'typeof (obj.property)');
|
||||||
|
@ -4,16 +4,11 @@
|
|||||||
/*---
|
/*---
|
||||||
es5id: 15.3.4.5-8-1
|
es5id: 15.3.4.5-8-1
|
||||||
description: Function.prototype.bind, type of bound function must be 'function'
|
description: Function.prototype.bind, type of bound function must be 'function'
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
function foo() { }
|
function foo() { }
|
||||||
var o = {};
|
var o = {};
|
||||||
|
|
||||||
var bf = foo.bind(o);
|
var bf = foo.bind(o);
|
||||||
if (typeof(bf) === 'function') {
|
|
||||||
return true;
|
assert.sameValue(typeof(bf), 'function', 'typeof(bf)');
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,17 +6,12 @@ es5id: 15.3.4.5-8-2
|
|||||||
description: >
|
description: >
|
||||||
Function.prototype.bind, [[Class]] of bound function must be
|
Function.prototype.bind, [[Class]] of bound function must be
|
||||||
'Function'
|
'Function'
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
function foo() { }
|
function foo() { }
|
||||||
var o = {};
|
var o = {};
|
||||||
|
|
||||||
var bf = foo.bind(o);
|
var bf = foo.bind(o);
|
||||||
var s = Object.prototype.toString.call(bf);
|
var s = Object.prototype.toString.call(bf);
|
||||||
if (s === '[object Function]') {
|
|
||||||
return true;
|
assert.sameValue(s, '[object Function]', 's');
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -4,16 +4,11 @@
|
|||||||
/*---
|
/*---
|
||||||
es5id: 15.3.4.5-9-1
|
es5id: 15.3.4.5-9-1
|
||||||
description: Function.prototype.bind, [[Prototype]] is Function.prototype
|
description: Function.prototype.bind, [[Prototype]] is Function.prototype
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
function foo() { }
|
function foo() { }
|
||||||
var o = {};
|
var o = {};
|
||||||
|
|
||||||
var bf = foo.bind(o);
|
var bf = foo.bind(o);
|
||||||
if (Function.prototype.isPrototypeOf(bf)) {
|
|
||||||
return true;
|
assert(Function.prototype.isPrototypeOf(bf), 'Function.prototype.isPrototypeOf(bf) !== true');
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,16 +6,11 @@ es5id: 15.3.4.5-9-2
|
|||||||
description: >
|
description: >
|
||||||
Function.prototype.bind, [[Prototype]] is Function.prototype
|
Function.prototype.bind, [[Prototype]] is Function.prototype
|
||||||
(using getPrototypeOf)
|
(using getPrototypeOf)
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
function foo() { }
|
function foo() { }
|
||||||
var o = {};
|
var o = {};
|
||||||
|
|
||||||
var bf = foo.bind(o);
|
var bf = foo.bind(o);
|
||||||
if (Object.getPrototypeOf(bf) === Function.prototype) {
|
|
||||||
return true;
|
assert.sameValue(Object.getPrototypeOf(bf), Function.prototype, 'Object.getPrototypeOf(bf)');
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,16 +7,12 @@ description: >
|
|||||||
[[Call]] - 'F''s [[BoundArgs]] is used as the former part of
|
[[Call]] - 'F''s [[BoundArgs]] is used as the former part of
|
||||||
arguments of calling the [[Call]] internal method of 'F''s
|
arguments of calling the [[Call]] internal method of 'F''s
|
||||||
[[TargetFunction]] when 'F' is called
|
[[TargetFunction]] when 'F' is called
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var func = function (x, y, z) {
|
var func = function (x, y, z) {
|
||||||
return x + y + z;
|
return x + y + z;
|
||||||
};
|
};
|
||||||
|
|
||||||
var newFunc = Function.prototype.bind.call(func, {}, "a", "b", "c");
|
var newFunc = Function.prototype.bind.call(func, {}, "a", "b", "c");
|
||||||
|
|
||||||
return newFunc() === "abc";
|
assert.sameValue(newFunc(), "abc", 'newFunc()');
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-10
|
|||||||
description: >
|
description: >
|
||||||
[[Call]] - length of parameters of 'target' is 1, length of
|
[[Call]] - length of parameters of 'target' is 1, length of
|
||||||
'boundArgs' is 0, length of 'ExtraArgs' is 0, and with 'boundThis'
|
'boundArgs' is 0, length of 'ExtraArgs' is 0, and with 'boundThis'
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var obj = { prop: "abc" };
|
var obj = { prop: "abc" };
|
||||||
|
|
||||||
var func = function (x) {
|
var func = function (x) {
|
||||||
@ -18,6 +16,4 @@ function testcase() {
|
|||||||
|
|
||||||
var newFunc = Function.prototype.bind.call(func, obj);
|
var newFunc = Function.prototype.bind.call(func, obj);
|
||||||
|
|
||||||
return newFunc();
|
assert(newFunc(), 'newFunc() !== true');
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-11
|
|||||||
description: >
|
description: >
|
||||||
[[Call]] - length of parameters of 'target' is 1, length of
|
[[Call]] - length of parameters of 'target' is 1, length of
|
||||||
'boundArgs' is 0, length of 'ExtraArgs' is 1, and with 'boundThis'
|
'boundArgs' is 0, length of 'ExtraArgs' is 1, and with 'boundThis'
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var obj = { prop: "abc" };
|
var obj = { prop: "abc" };
|
||||||
|
|
||||||
var func = function (x) {
|
var func = function (x) {
|
||||||
@ -18,6 +16,4 @@ function testcase() {
|
|||||||
|
|
||||||
var newFunc = Function.prototype.bind.call(func, obj);
|
var newFunc = Function.prototype.bind.call(func, obj);
|
||||||
|
|
||||||
return newFunc(1);
|
assert(newFunc(1), 'newFunc(1) !== true');
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-12
|
|||||||
description: >
|
description: >
|
||||||
[[Call]] - length of parameters of 'target' is 1, length of
|
[[Call]] - length of parameters of 'target' is 1, length of
|
||||||
'boundArgs' is 0, length of 'ExtraArgs' is 2, and with 'boundThis'
|
'boundArgs' is 0, length of 'ExtraArgs' is 2, and with 'boundThis'
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var obj = { prop: "abc" };
|
var obj = { prop: "abc" };
|
||||||
|
|
||||||
var func = function (x) {
|
var func = function (x) {
|
||||||
@ -19,6 +17,4 @@ function testcase() {
|
|||||||
|
|
||||||
var newFunc = Function.prototype.bind.call(func, obj);
|
var newFunc = Function.prototype.bind.call(func, obj);
|
||||||
|
|
||||||
return newFunc(1, 2);
|
assert(newFunc(1, 2), 'newFunc(1, 2) !== true');
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-13
|
|||||||
description: >
|
description: >
|
||||||
[[Call]] - length of parameters of 'target' is 1, length of
|
[[Call]] - length of parameters of 'target' is 1, length of
|
||||||
'boundArgs' is 1, length of 'ExtraArgs' is 0, and with 'boundThis'
|
'boundArgs' is 1, length of 'ExtraArgs' is 0, and with 'boundThis'
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var obj = { prop: "abc" };
|
var obj = { prop: "abc" };
|
||||||
|
|
||||||
var func = function (x) {
|
var func = function (x) {
|
||||||
@ -19,6 +17,4 @@ function testcase() {
|
|||||||
|
|
||||||
var newFunc = Function.prototype.bind.call(func, obj, 1);
|
var newFunc = Function.prototype.bind.call(func, obj, 1);
|
||||||
|
|
||||||
return newFunc();
|
assert(newFunc(), 'newFunc() !== true');
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-14
|
|||||||
description: >
|
description: >
|
||||||
[[Call]] - length of parameters of 'target' is 1, length of
|
[[Call]] - length of parameters of 'target' is 1, length of
|
||||||
'boundArgs' is 1, length of 'ExtraArgs' is 1, and with 'boundThis'
|
'boundArgs' is 1, length of 'ExtraArgs' is 1, and with 'boundThis'
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var obj = { prop: "abc" };
|
var obj = { prop: "abc" };
|
||||||
|
|
||||||
var func = function (x) {
|
var func = function (x) {
|
||||||
@ -19,6 +17,4 @@ function testcase() {
|
|||||||
|
|
||||||
var newFunc = Function.prototype.bind.call(func, obj, 1);
|
var newFunc = Function.prototype.bind.call(func, obj, 1);
|
||||||
|
|
||||||
return newFunc(2);
|
assert(newFunc(2), 'newFunc(2) !== true');
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-15
|
|||||||
description: >
|
description: >
|
||||||
[[Call]] - length of parameters of 'target' is 1, length of
|
[[Call]] - length of parameters of 'target' is 1, length of
|
||||||
'boundArgs' is 2, length of 'ExtraArgs' is 0, and with 'boundThis'
|
'boundArgs' is 2, length of 'ExtraArgs' is 0, and with 'boundThis'
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var obj = { prop: "abc" };
|
var obj = { prop: "abc" };
|
||||||
|
|
||||||
var func = function (x) {
|
var func = function (x) {
|
||||||
@ -19,6 +17,4 @@ function testcase() {
|
|||||||
|
|
||||||
var newFunc = Function.prototype.bind.call(func, obj, 1, 2);
|
var newFunc = Function.prototype.bind.call(func, obj, 1, 2);
|
||||||
|
|
||||||
return newFunc();
|
assert(newFunc(), 'newFunc() !== true');
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,10 +7,8 @@ description: >
|
|||||||
[[Call]] - 'F''s [[BoundThis]] is used as the 'this' value of
|
[[Call]] - 'F''s [[BoundThis]] is used as the 'this' value of
|
||||||
calling the [[Call]] internal method of 'F''s [[TargetFunction]]
|
calling the [[Call]] internal method of 'F''s [[TargetFunction]]
|
||||||
when 'F' is called
|
when 'F' is called
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var obj = { "prop": "a" };
|
var obj = { "prop": "a" };
|
||||||
|
|
||||||
var func = function () {
|
var func = function () {
|
||||||
@ -19,6 +17,4 @@ function testcase() {
|
|||||||
|
|
||||||
var newFunc = Function.prototype.bind.call(func, obj);
|
var newFunc = Function.prototype.bind.call(func, obj);
|
||||||
|
|
||||||
return newFunc() === obj;
|
assert.sameValue(newFunc(), obj, 'newFunc()');
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,16 +7,12 @@ description: >
|
|||||||
[[Call]] - the provided arguments is used as the latter part of
|
[[Call]] - the provided arguments is used as the latter part of
|
||||||
arguments of calling the [[Call]] internal method of 'F''s
|
arguments of calling the [[Call]] internal method of 'F''s
|
||||||
[[TargetFunction]] when 'F' is called
|
[[TargetFunction]] when 'F' is called
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var func = function (x, y, z) {
|
var func = function (x, y, z) {
|
||||||
return z;
|
return z;
|
||||||
};
|
};
|
||||||
|
|
||||||
var newFunc = Function.prototype.bind.call(func, {}, "a", "b");
|
var newFunc = Function.prototype.bind.call(func, {}, "a", "b");
|
||||||
|
|
||||||
return newFunc("c") === "c";
|
assert.sameValue(newFunc("c"), "c", 'newFunc("c")');
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,16 +7,12 @@ description: >
|
|||||||
[[Call]] - length of parameters of 'target' is 0, length of
|
[[Call]] - length of parameters of 'target' is 0, length of
|
||||||
'boundArgs' is 0, length of 'ExtraArgs' is 0, and without
|
'boundArgs' is 0, length of 'ExtraArgs' is 0, and without
|
||||||
'boundThis'
|
'boundThis'
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var func = function () {
|
var func = function () {
|
||||||
return arguments.length === 0;
|
return arguments.length === 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
var newFunc = Function.prototype.bind.call(func);
|
var newFunc = Function.prototype.bind.call(func);
|
||||||
|
|
||||||
return newFunc();
|
assert(newFunc(), 'newFunc() !== true');
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,16 +7,12 @@ description: >
|
|||||||
[[Call]] - length of parameters of 'target' is 0, length of
|
[[Call]] - length of parameters of 'target' is 0, length of
|
||||||
'boundArgs' is 0, length of 'ExtraArgs' is 1, and without
|
'boundArgs' is 0, length of 'ExtraArgs' is 1, and without
|
||||||
'boundThis'
|
'boundThis'
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var func = function () {
|
var func = function () {
|
||||||
return arguments[0] === 1;
|
return arguments[0] === 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
var newFunc = Function.prototype.bind.call(func);
|
var newFunc = Function.prototype.bind.call(func);
|
||||||
|
|
||||||
return newFunc(1);
|
assert(newFunc(1), 'newFunc(1) !== true');
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-6
|
|||||||
description: >
|
description: >
|
||||||
[[Call]] - length of parameters of 'target' is 0, length of
|
[[Call]] - length of parameters of 'target' is 0, length of
|
||||||
'boundArgs' is 0, length of 'ExtraArgs' is 0, and with 'boundThis'
|
'boundArgs' is 0, length of 'ExtraArgs' is 0, and with 'boundThis'
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var obj = { prop: "abc" };
|
var obj = { prop: "abc" };
|
||||||
|
|
||||||
var func = function () {
|
var func = function () {
|
||||||
@ -18,6 +16,4 @@ function testcase() {
|
|||||||
|
|
||||||
var newFunc = Function.prototype.bind.call(func, obj);
|
var newFunc = Function.prototype.bind.call(func, obj);
|
||||||
|
|
||||||
return newFunc();
|
assert(newFunc(), 'newFunc() !== true');
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-7
|
|||||||
description: >
|
description: >
|
||||||
[[Call]] - length of parameters of 'target' is 0, length of
|
[[Call]] - length of parameters of 'target' is 0, length of
|
||||||
'boundArgs' is 1, length of 'ExtraArgs' is 0, and with 'boundThis'
|
'boundArgs' is 1, length of 'ExtraArgs' is 0, and with 'boundThis'
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var obj = { prop: "abc" };
|
var obj = { prop: "abc" };
|
||||||
|
|
||||||
var func = function () {
|
var func = function () {
|
||||||
@ -18,6 +16,4 @@ function testcase() {
|
|||||||
|
|
||||||
var newFunc = Function.prototype.bind.call(func, obj, 1);
|
var newFunc = Function.prototype.bind.call(func, obj, 1);
|
||||||
|
|
||||||
return newFunc();
|
assert(newFunc(), 'newFunc() !== true');
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-8
|
|||||||
description: >
|
description: >
|
||||||
[[Call]] - length of parameters of 'target' is 0, length of
|
[[Call]] - length of parameters of 'target' is 0, length of
|
||||||
'boundArgs' is 0, length of 'ExtraArgs' is 1, and with 'boundThis'
|
'boundArgs' is 0, length of 'ExtraArgs' is 1, and with 'boundThis'
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var obj = { prop: "abc" };
|
var obj = { prop: "abc" };
|
||||||
|
|
||||||
var func = function () {
|
var func = function () {
|
||||||
@ -18,6 +16,4 @@ function testcase() {
|
|||||||
|
|
||||||
var newFunc = Function.prototype.bind.call(func, obj);
|
var newFunc = Function.prototype.bind.call(func, obj);
|
||||||
|
|
||||||
return newFunc(1);
|
assert(newFunc(1), 'newFunc(1) !== true');
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-9
|
|||||||
description: >
|
description: >
|
||||||
[[Call]] - length of parameters of 'target' is 0, length of
|
[[Call]] - length of parameters of 'target' is 0, length of
|
||||||
'boundArgs' is 1, length of 'ExtraArgs' is 1, and with 'boundThis'
|
'boundArgs' is 1, length of 'ExtraArgs' is 1, and with 'boundThis'
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var obj = { prop: "abc" };
|
var obj = { prop: "abc" };
|
||||||
|
|
||||||
var func = function () {
|
var func = function () {
|
||||||
@ -18,6 +16,4 @@ function testcase() {
|
|||||||
|
|
||||||
var newFunc = Function.prototype.bind.call(func, obj, 1);
|
var newFunc = Function.prototype.bind.call(func, obj, 1);
|
||||||
|
|
||||||
return newFunc(2);
|
assert(newFunc(2), 'newFunc(2) !== true');
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,10 +7,8 @@ description: >
|
|||||||
[[Construct]] - 'F''s [[BoundArgs]] is used as the former part of
|
[[Construct]] - 'F''s [[BoundArgs]] is used as the former part of
|
||||||
arguments of calling the [[Construct]] internal method of 'F''s
|
arguments of calling the [[Construct]] internal method of 'F''s
|
||||||
[[TargetFunction]] when 'F' is called as constructor
|
[[TargetFunction]] when 'F' is called as constructor
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var func = function (x, y, z) {
|
var func = function (x, y, z) {
|
||||||
var objResult = {};
|
var objResult = {};
|
||||||
objResult.returnValue = x + y + z;
|
objResult.returnValue = x + y + z;
|
||||||
@ -22,7 +20,7 @@ function testcase() {
|
|||||||
|
|
||||||
var newInstance = new NewFunc();
|
var newInstance = new NewFunc();
|
||||||
|
|
||||||
return newInstance.hasOwnProperty("returnValue") && newInstance.returnValue === "abc" &&
|
assert(newInstance.hasOwnProperty("returnValue"), 'newInstance.hasOwnProperty("returnValue") !== true');
|
||||||
newInstance.hasOwnProperty("returnVerifyResult") && newInstance.returnVerifyResult === true;
|
assert.sameValue(newInstance.returnValue, "abc", 'newInstance.returnValue');
|
||||||
}
|
assert(newInstance.hasOwnProperty("returnVerifyResult"), 'newInstance.hasOwnProperty("returnVerifyResult") !== true');
|
||||||
runTestCase(testcase);
|
assert.sameValue(newInstance.returnVerifyResult, true, 'newInstance.returnVerifyResult');
|
||||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-10
|
|||||||
description: >
|
description: >
|
||||||
[[Construct]] - length of parameters of 'target' is 1, length of
|
[[Construct]] - length of parameters of 'target' is 1, length of
|
||||||
'boundArgs' is 0, length of 'ExtraArgs' is 1
|
'boundArgs' is 0, length of 'ExtraArgs' is 1
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var func = function (x) {
|
var func = function (x) {
|
||||||
return new Boolean(arguments.length === 1 && x === 1 && arguments[0] === 1);
|
return new Boolean(arguments.length === 1 && x === 1 && arguments[0] === 1);
|
||||||
};
|
};
|
||||||
@ -18,6 +16,4 @@ function testcase() {
|
|||||||
|
|
||||||
var newInstance = new NewFunc(1);
|
var newInstance = new NewFunc(1);
|
||||||
|
|
||||||
return newInstance.valueOf() === true;
|
assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()');
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-11
|
|||||||
description: >
|
description: >
|
||||||
[[Construct]] - length of parameters of 'target' is 1, length of
|
[[Construct]] - length of parameters of 'target' is 1, length of
|
||||||
'boundArgs' is 0, length of 'ExtraArgs' is 2
|
'boundArgs' is 0, length of 'ExtraArgs' is 2
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var func = function (x) {
|
var func = function (x) {
|
||||||
return new Boolean(arguments.length === 2 && x === 1 && arguments[1] === 2 && arguments[0] === 1);
|
return new Boolean(arguments.length === 2 && x === 1 && arguments[1] === 2 && arguments[0] === 1);
|
||||||
};
|
};
|
||||||
@ -18,6 +16,4 @@ function testcase() {
|
|||||||
|
|
||||||
var newInstance = new NewFunc(1, 2);
|
var newInstance = new NewFunc(1, 2);
|
||||||
|
|
||||||
return newInstance.valueOf() === true;
|
assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()');
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-12
|
|||||||
description: >
|
description: >
|
||||||
[[Construct]] - length of parameters of 'target' is 1, length of
|
[[Construct]] - length of parameters of 'target' is 1, length of
|
||||||
'boundArgs' is 1, length of 'ExtraArgs' is 0
|
'boundArgs' is 1, length of 'ExtraArgs' is 0
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var func = function (x) {
|
var func = function (x) {
|
||||||
return new Boolean(arguments.length === 1 && x === 1 && arguments[0] === 1);
|
return new Boolean(arguments.length === 1 && x === 1 && arguments[0] === 1);
|
||||||
};
|
};
|
||||||
@ -18,6 +16,4 @@ function testcase() {
|
|||||||
|
|
||||||
var newInstance = new NewFunc();
|
var newInstance = new NewFunc();
|
||||||
|
|
||||||
return newInstance.valueOf() === true;
|
assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()');
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-13
|
|||||||
description: >
|
description: >
|
||||||
[[Construct]] - length of parameters of 'target' is 1, length of
|
[[Construct]] - length of parameters of 'target' is 1, length of
|
||||||
'boundArgs' is 1, length of 'ExtraArgs' is 1
|
'boundArgs' is 1, length of 'ExtraArgs' is 1
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var func = function (x) {
|
var func = function (x) {
|
||||||
return new Boolean(arguments.length === 2 && x === 1 && arguments[1] === 2 && arguments[0] === 1);
|
return new Boolean(arguments.length === 2 && x === 1 && arguments[1] === 2 && arguments[0] === 1);
|
||||||
};
|
};
|
||||||
@ -18,6 +16,4 @@ function testcase() {
|
|||||||
|
|
||||||
var newInstance = new NewFunc(2);
|
var newInstance = new NewFunc(2);
|
||||||
|
|
||||||
return newInstance.valueOf() === true;
|
assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()');
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-14
|
|||||||
description: >
|
description: >
|
||||||
[[Construct]] - length of parameters of 'target' is 1, length of
|
[[Construct]] - length of parameters of 'target' is 1, length of
|
||||||
'boundArgs' is 2, length of 'ExtraArgs' is 0
|
'boundArgs' is 2, length of 'ExtraArgs' is 0
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var func = function (x) {
|
var func = function (x) {
|
||||||
return new Boolean(arguments.length === 2 && x === 1 && arguments[1] === 2 && arguments[0] === 1);
|
return new Boolean(arguments.length === 2 && x === 1 && arguments[1] === 2 && arguments[0] === 1);
|
||||||
};
|
};
|
||||||
@ -18,6 +16,4 @@ function testcase() {
|
|||||||
|
|
||||||
var newInstance = new NewFunc();
|
var newInstance = new NewFunc();
|
||||||
|
|
||||||
return newInstance.valueOf() === true;
|
assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()');
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,10 +7,8 @@ description: >
|
|||||||
[[Construct]] - the provided arguments is used as the latter part
|
[[Construct]] - the provided arguments is used as the latter part
|
||||||
of arguments of calling the [[Construct]] internal method of 'F''s
|
of arguments of calling the [[Construct]] internal method of 'F''s
|
||||||
[[TargetFunction]] when 'F' is called as constructor
|
[[TargetFunction]] when 'F' is called as constructor
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var func = function (x, y, z) {
|
var func = function (x, y, z) {
|
||||||
var objResult = {};
|
var objResult = {};
|
||||||
objResult.returnValue = x + y + z;
|
objResult.returnValue = x + y + z;
|
||||||
@ -22,7 +20,7 @@ function testcase() {
|
|||||||
|
|
||||||
var newInstance = new NewFunc("a", "b", "c");
|
var newInstance = new NewFunc("a", "b", "c");
|
||||||
|
|
||||||
return newInstance.hasOwnProperty("returnValue") && newInstance.returnValue === "abc" &&
|
assert(newInstance.hasOwnProperty("returnValue"), 'newInstance.hasOwnProperty("returnValue") !== true');
|
||||||
newInstance.hasOwnProperty("returnVerifyResult") && newInstance.returnVerifyResult === true;
|
assert.sameValue(newInstance.returnValue, "abc", 'newInstance.returnValue');
|
||||||
}
|
assert(newInstance.hasOwnProperty("returnVerifyResult"), 'newInstance.hasOwnProperty("returnVerifyResult") !== true');
|
||||||
runTestCase(testcase);
|
assert.sameValue(newInstance.returnVerifyResult, true, 'newInstance.returnVerifyResult');
|
||||||
|
@ -7,10 +7,8 @@ description: >
|
|||||||
[[Construct]] - length of parameters of 'target' is 0, length of
|
[[Construct]] - length of parameters of 'target' is 0, length of
|
||||||
'boundArgs' is 0, length of 'ExtraArgs' is 0, and without
|
'boundArgs' is 0, length of 'ExtraArgs' is 0, and without
|
||||||
'boundThis'
|
'boundThis'
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var func = function () {
|
var func = function () {
|
||||||
return new Boolean(arguments.length === 0);
|
return new Boolean(arguments.length === 0);
|
||||||
};
|
};
|
||||||
@ -19,6 +17,4 @@ function testcase() {
|
|||||||
|
|
||||||
var newInstance = new NewFunc();
|
var newInstance = new NewFunc();
|
||||||
|
|
||||||
return newInstance.valueOf() === true;
|
assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()');
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,10 +7,8 @@ description: >
|
|||||||
[[Construct]] - length of parameters of 'target' is 0, length of
|
[[Construct]] - length of parameters of 'target' is 0, length of
|
||||||
'boundArgs' is 0, length of 'ExtraArgs' is 1, and without
|
'boundArgs' is 0, length of 'ExtraArgs' is 1, and without
|
||||||
'boundThis'
|
'boundThis'
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var func = function () {
|
var func = function () {
|
||||||
return new Boolean(arguments[0] === 1 && arguments.length === 1);
|
return new Boolean(arguments[0] === 1 && arguments.length === 1);
|
||||||
};
|
};
|
||||||
@ -19,6 +17,4 @@ function testcase() {
|
|||||||
|
|
||||||
var newInstance = new NewFunc(1);
|
var newInstance = new NewFunc(1);
|
||||||
|
|
||||||
return newInstance.valueOf() === true;
|
assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()');
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-6
|
|||||||
description: >
|
description: >
|
||||||
[[Construct]] - length of parameters of 'target' is 0, length of
|
[[Construct]] - length of parameters of 'target' is 0, length of
|
||||||
'boundArgs' is 1, length of 'ExtraArgs' is 0
|
'boundArgs' is 1, length of 'ExtraArgs' is 0
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var func = function () {
|
var func = function () {
|
||||||
return new Boolean(arguments.length === 1 && arguments[0] === 1);
|
return new Boolean(arguments.length === 1 && arguments[0] === 1);
|
||||||
};
|
};
|
||||||
@ -18,6 +16,4 @@ function testcase() {
|
|||||||
|
|
||||||
var newInstance = new NewFunc();
|
var newInstance = new NewFunc();
|
||||||
|
|
||||||
return newInstance.valueOf() === true;
|
assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()');
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-7
|
|||||||
description: >
|
description: >
|
||||||
[[Construct]] - length of parameters of 'target' is 0, length of
|
[[Construct]] - length of parameters of 'target' is 0, length of
|
||||||
'boundArgs' is 0, length of 'ExtraArgs' is 1
|
'boundArgs' is 0, length of 'ExtraArgs' is 1
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var func = function () {
|
var func = function () {
|
||||||
return new Boolean(arguments.length === 1 && arguments[0] === 1);
|
return new Boolean(arguments.length === 1 && arguments[0] === 1);
|
||||||
};
|
};
|
||||||
@ -18,6 +16,4 @@ function testcase() {
|
|||||||
|
|
||||||
var newInstance = new NewFunc(1);
|
var newInstance = new NewFunc(1);
|
||||||
|
|
||||||
return newInstance.valueOf() === true;
|
assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()');
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-8
|
|||||||
description: >
|
description: >
|
||||||
[[Construct]] - length of parameters of 'target' is 0, length of
|
[[Construct]] - length of parameters of 'target' is 0, length of
|
||||||
'boundArgs' is 1, length of 'ExtraArgs' is 1
|
'boundArgs' is 1, length of 'ExtraArgs' is 1
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var func = function () {
|
var func = function () {
|
||||||
return new Boolean(arguments.length === 2 && arguments[0] === 1 && arguments[1] === 2);
|
return new Boolean(arguments.length === 2 && arguments[0] === 1 && arguments[1] === 2);
|
||||||
};
|
};
|
||||||
@ -18,6 +16,4 @@ function testcase() {
|
|||||||
|
|
||||||
var newInstance = new NewFunc(2);
|
var newInstance = new NewFunc(2);
|
||||||
|
|
||||||
return newInstance.valueOf() === true;
|
assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()');
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-9
|
|||||||
description: >
|
description: >
|
||||||
[[Construct]] - length of parameters of 'target' is 1, length of
|
[[Construct]] - length of parameters of 'target' is 1, length of
|
||||||
'boundArgs' is 0, length of 'ExtraArgs' is 0
|
'boundArgs' is 0, length of 'ExtraArgs' is 0
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var func = function (x) {
|
var func = function (x) {
|
||||||
return new Boolean(arguments.length === 0 && typeof x === "undefined");
|
return new Boolean(arguments.length === 0 && typeof x === "undefined");
|
||||||
};
|
};
|
||||||
@ -18,6 +16,4 @@ function testcase() {
|
|||||||
|
|
||||||
var newInstance = new NewFunc();
|
var newInstance = new NewFunc();
|
||||||
|
|
||||||
return newInstance.valueOf() === true;
|
assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()');
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -8,13 +8,10 @@ description: >
|
|||||||
to wrapper objects when the function is called without an array of
|
to wrapper objects when the function is called without an array of
|
||||||
arguments
|
arguments
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
function fun() {
|
function fun() {
|
||||||
return (this instanceof String);
|
return (this instanceof String);
|
||||||
}
|
}
|
||||||
return !fun.call("");
|
|
||||||
}
|
assert.sameValue(fun.call(""), false, 'fun.call("")');
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -8,13 +8,10 @@ description: >
|
|||||||
to wrapper objects when the function is called without an array
|
to wrapper objects when the function is called without an array
|
||||||
argument
|
argument
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
function fun() {
|
function fun() {
|
||||||
return (this instanceof Number);
|
return (this instanceof Number);
|
||||||
}
|
}
|
||||||
return !fun.call(-12);
|
|
||||||
}
|
assert.sameValue(fun.call(-12), false, 'fun.call(-12)');
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -8,13 +8,10 @@ description: >
|
|||||||
to wrapper objects when the function is called without an array of
|
to wrapper objects when the function is called without an array of
|
||||||
arguments
|
arguments
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
function fun() {
|
function fun() {
|
||||||
return (this instanceof Boolean);
|
return (this instanceof Boolean);
|
||||||
}
|
}
|
||||||
return !fun.call(false);
|
|
||||||
}
|
assert.sameValue(fun.call(false), false, 'fun.call(false)');
|
||||||
runTestCase(testcase);
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user