mirror of
https://github.com/tc39/test262.git
synced 2025-07-21 21:14:45 +02:00
Merge pull request #410 from anba/remove-runTestCase-builtins
Replace runTestCase in test/built-ins
This commit is contained in:
commit
d58c8b9a99
@ -7,15 +7,12 @@ description: >
|
|||||||
Date Time String Format - specified default values will be set for
|
Date Time String Format - specified default values will be set for
|
||||||
all optional fields(MM, DD, mm, ss and time zone) when they are
|
all optional fields(MM, DD, mm, ss and time zone) when they are
|
||||||
absent
|
absent
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var result = false;
|
var result = false;
|
||||||
var expectedDateTimeStr = new Date(1970, 0, 1, 0, 0, 0, 0).toISOString();
|
var expectedDateTimeStr = new Date(1970, 0, 1, 0, 0, 0, 0).toISOString();
|
||||||
var dateObj = new Date("1970");
|
var dateObj = new Date("1970");
|
||||||
var dateStr = dateObj.toISOString();
|
var dateStr = dateObj.toISOString();
|
||||||
result = dateStr === expectedDateTimeStr;
|
result = dateStr === expectedDateTimeStr;
|
||||||
return result;
|
|
||||||
}
|
assert(result, 'result !== true');
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -4,12 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
es5id: 15.9.4.4-0-3
|
es5id: 15.9.4.4-0-3
|
||||||
description: Date.now must exist as a function
|
description: Date.now must exist as a function
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var fun = Date.now;
|
var fun = Date.now;
|
||||||
return (typeof (fun) === "function");
|
|
||||||
}
|
assert.sameValue(typeof (fun), "function", 'typeof (fun)');
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,16 +7,12 @@ description: >
|
|||||||
Date.prototype.toISOString - RangeError is not thrown when value
|
Date.prototype.toISOString - RangeError is not thrown when value
|
||||||
of date is Date(1970, 0, 100000001, 0, 0, 0, -1), the time zone is
|
of date is Date(1970, 0, 100000001, 0, 0, 0, -1), the time zone is
|
||||||
UTC(0)
|
UTC(0)
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var timeZoneMinutes = new Date().getTimezoneOffset() * (-1);
|
var timeZoneMinutes = new Date().getTimezoneOffset() * (-1);
|
||||||
var date, dateStr;
|
var date, dateStr;
|
||||||
|
|
||||||
date = new Date(1970, 0, 100000001, 0, 0 + timeZoneMinutes - 60, 0, -1);
|
date = new Date(1970, 0, 100000001, 0, 0 + timeZoneMinutes - 60, 0, -1);
|
||||||
dateStr = date.toISOString();
|
dateStr = date.toISOString();
|
||||||
|
|
||||||
return dateStr[dateStr.length - 1] === "Z";
|
assert.sameValue(dateStr[dateStr.length - 1], "Z", 'dateStr[dateStr.length - 1]');
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,16 +7,12 @@ description: >
|
|||||||
Date.prototype.toISOString - RangeError is not thrown when value
|
Date.prototype.toISOString - RangeError is not thrown when value
|
||||||
of date is Date(1970, 0, 100000001, 0, 0, 0, 0), the time zone is
|
of date is Date(1970, 0, 100000001, 0, 0, 0, 0), the time zone is
|
||||||
UTC(0)
|
UTC(0)
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var timeZoneMinutes = new Date().getTimezoneOffset() * (-1);
|
var timeZoneMinutes = new Date().getTimezoneOffset() * (-1);
|
||||||
var date, dateStr;
|
var date, dateStr;
|
||||||
|
|
||||||
date = new Date(1970, 0, 100000001, 0, 0 + timeZoneMinutes - 60, 0, 0);
|
date = new Date(1970, 0, 100000001, 0, 0 + timeZoneMinutes - 60, 0, 0);
|
||||||
dateStr = date.toISOString();
|
dateStr = date.toISOString();
|
||||||
|
|
||||||
return dateStr[dateStr.length - 1] === "Z";
|
assert.sameValue(dateStr[dateStr.length - 1], "Z", 'dateStr[dateStr.length - 1]');
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,13 +6,9 @@ es5id: 15.9.5.43-0-4
|
|||||||
description: >
|
description: >
|
||||||
Date.prototype.toISOString - format of returned string is
|
Date.prototype.toISOString - format of returned string is
|
||||||
'YYYY-MM-DDTHH:mm:ss.sssZ', the time zone is UTC(0)
|
'YYYY-MM-DDTHH:mm:ss.sssZ', the time zone is UTC(0)
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var date = new Date(1999, 9, 10, 10, 10, 10, 10);
|
var date = new Date(1999, 9, 10, 10, 10, 10, 10);
|
||||||
var localDate = new Date(date.getTime() - date.getTimezoneOffset() * 60000);
|
var localDate = new Date(date.getTime() - date.getTimezoneOffset() * 60000);
|
||||||
|
|
||||||
return localDate.toISOString() === "1999-10-10T10:10:10.010Z";
|
assert.sameValue(localDate.toISOString(), "1999-10-10T10:10:10.010Z", 'localDate.toISOString()');
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,11 +6,8 @@ es5id: 15.9.5.43-0-5
|
|||||||
description: >
|
description: >
|
||||||
Date.prototype.toISOString - The returned string is the UTC time
|
Date.prototype.toISOString - The returned string is the UTC time
|
||||||
zone(0)
|
zone(0)
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var dateStr = (new Date()).toISOString();
|
var dateStr = (new Date()).toISOString();
|
||||||
return dateStr[dateStr.length - 1] === "Z";
|
|
||||||
}
|
assert.sameValue(dateStr[dateStr.length - 1], "Z", 'dateStr[dateStr.length - 1]');
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -4,13 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
es5id: 15.9.5.44-0-1
|
es5id: 15.9.5.44-0-1
|
||||||
description: Date.prototype.toJSON must exist as a function
|
description: Date.prototype.toJSON must exist as a function
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var f = Date.prototype.toJSON;
|
var f = Date.prototype.toJSON;
|
||||||
if (typeof(f) === "function") {
|
|
||||||
return true;
|
assert.sameValue(typeof(f), "function", 'typeof(f)');
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -4,12 +4,6 @@
|
|||||||
/*---
|
/*---
|
||||||
es5id: 15.9.5.44-0-2
|
es5id: 15.9.5.44-0-2
|
||||||
description: Date.prototype.toJSON must exist as a function taking 1 parameter
|
description: Date.prototype.toJSON must exist as a function taking 1 parameter
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
assert.sameValue(Date.prototype.toJSON.length, 1, 'Date.prototype.toJSON.length');
|
||||||
if (Date.prototype.toJSON.length === 1) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,12 +7,9 @@ description: >
|
|||||||
Error.prototype.toString return the result of concatenating
|
Error.prototype.toString return the result of concatenating
|
||||||
'name', ':', a single space character, and 'msg' when 'name' and
|
'name', ':', a single space character, and 'msg' when 'name' and
|
||||||
'msg' are non-empty string
|
'msg' are non-empty string
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var errObj = new Error("ErrorMessage");
|
var errObj = new Error("ErrorMessage");
|
||||||
errObj.name = "ErrorName";
|
errObj.name = "ErrorName";
|
||||||
return errObj.toString() === "ErrorName: ErrorMessage";
|
|
||||||
}
|
assert.sameValue(errObj.toString(), "ErrorName: ErrorMessage", 'errObj.toString()');
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,11 +6,8 @@ es5id: 15.11.4.4-6-1
|
|||||||
description: >
|
description: >
|
||||||
Error.prototype.toString - 'Error' is returned when 'name' is
|
Error.prototype.toString - 'Error' is returned when 'name' is
|
||||||
absent and empty string is returned when 'msg' is undefined
|
absent and empty string is returned when 'msg' is undefined
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var errObj = new Error();
|
var errObj = new Error();
|
||||||
return errObj.toString() === "Error";
|
|
||||||
}
|
assert.sameValue(errObj.toString(), "Error", 'errObj.toString()');
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,11 +7,8 @@ description: >
|
|||||||
Error.prototype.toString - 'Error' is returned when 'name' is
|
Error.prototype.toString - 'Error' is returned when 'name' is
|
||||||
absent and value of 'msg' is returned when 'msg' is non-empty
|
absent and value of 'msg' is returned when 'msg' is non-empty
|
||||||
string
|
string
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var errObj = new Error("ErrorMessage");
|
var errObj = new Error("ErrorMessage");
|
||||||
return errObj.toString() === "Error: ErrorMessage";
|
|
||||||
}
|
assert.sameValue(errObj.toString(), "Error: ErrorMessage", 'errObj.toString()');
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,12 +6,9 @@ es5id: 15.11.4.4-8-1
|
|||||||
description: >
|
description: >
|
||||||
Error.prototype.toString return the value of 'msg' when 'name' is
|
Error.prototype.toString return the value of 'msg' when 'name' is
|
||||||
empty string and 'msg' isn't undefined
|
empty string and 'msg' isn't undefined
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var errObj = new Error("ErrorMessage");
|
var errObj = new Error("ErrorMessage");
|
||||||
errObj.name = "";
|
errObj.name = "";
|
||||||
return errObj.toString() === "ErrorMessage";
|
|
||||||
}
|
assert.sameValue(errObj.toString(), "ErrorMessage", 'errObj.toString()');
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,12 +6,9 @@ es5id: 15.11.4.4-9-1
|
|||||||
description: >
|
description: >
|
||||||
Error.prototype.toString return 'name' when 'name' is non-empty
|
Error.prototype.toString return 'name' when 'name' is non-empty
|
||||||
string and 'msg' is empty string
|
string and 'msg' is empty string
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var errObj = new Error();
|
var errObj = new Error();
|
||||||
errObj.name = "ErrorName";
|
errObj.name = "ErrorName";
|
||||||
return errObj.toString() === "ErrorName";
|
|
||||||
}
|
assert.sameValue(errObj.toString(), "ErrorName", 'errObj.toString()');
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -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);
|
|
||||||
|
@ -6,17 +6,11 @@ es5id: 15.1.1.2-0
|
|||||||
description: >
|
description: >
|
||||||
Global.Infinity is a data property with default attribute values
|
Global.Infinity is a data property with default attribute values
|
||||||
(false)
|
(false)
|
||||||
includes:
|
includes: [fnGlobalObject.js]
|
||||||
- runTestCase.js
|
|
||||||
- fnGlobalObject.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var desc = Object.getOwnPropertyDescriptor(fnGlobalObject(), 'Infinity');
|
var desc = Object.getOwnPropertyDescriptor(fnGlobalObject(), 'Infinity');
|
||||||
if (desc.writable === false &&
|
|
||||||
desc.enumerable === false &&
|
assert.sameValue(desc.writable, false, 'desc.writable');
|
||||||
desc.configurable === false) {
|
assert.sameValue(desc.enumerable, false, 'desc.enumerable');
|
||||||
return true;
|
assert.sameValue(desc.configurable, false, 'desc.configurable');
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -8,13 +8,8 @@ info: >
|
|||||||
4.2 calls out JSON as one of the built-in objects.
|
4.2 calls out JSON as one of the built-in objects.
|
||||||
es5id: 15.12-0-1
|
es5id: 15.12-0-1
|
||||||
description: JSON must be a built-in object
|
description: JSON must be a built-in object
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var o = JSON;
|
var o = JSON;
|
||||||
if (typeof(o) === "object") {
|
|
||||||
return true;
|
assert.sameValue(typeof(o), "object", 'typeof(o)');
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -10,18 +10,13 @@ info: >
|
|||||||
JSON, and we should not be able to enumerate them.
|
JSON, and we should not be able to enumerate them.
|
||||||
es5id: 15.12-0-4
|
es5id: 15.12-0-4
|
||||||
description: JSON object's properties must be non enumerable
|
description: JSON object's properties must be non enumerable
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var o = JSON;
|
var o = JSON;
|
||||||
var i = 0;
|
var i = 0;
|
||||||
for (var p in o) {
|
for (var p in o) {
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i === 0) {
|
|
||||||
return true;
|
assert.sameValue(i, 0, 'i');
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -4,16 +4,10 @@
|
|||||||
/*---
|
/*---
|
||||||
es5id: 15.12.1.1-0-9
|
es5id: 15.12.1.1-0-9
|
||||||
description: Whitespace characters can appear before/after any JSONtoken
|
description: Whitespace characters can appear before/after any JSONtoken
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
JSON.parse('\t\r \n{\t\r \n'+
|
JSON.parse('\t\r \n{\t\r \n'+
|
||||||
'"property"\t\r \n:\t\r \n{\t\r \n}\t\r \n,\t\r \n' +
|
'"property"\t\r \n:\t\r \n{\t\r \n}\t\r \n,\t\r \n' +
|
||||||
'"prop2"\t\r \n:\t\r \n'+
|
'"prop2"\t\r \n:\t\r \n'+
|
||||||
'[\t\r \ntrue\t\r \n,\t\r \nnull\t\r \n,123.456\t\r \n]'+
|
'[\t\r \ntrue\t\r \n,\t\r \nnull\t\r \n,123.456\t\r \n]'+
|
||||||
'\t\r \n}\t\r \n'); // should JOSN parse without error
|
'\t\r \n}\t\r \n'); // should JOSN parse without error
|
||||||
return true;
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -15,14 +15,8 @@ info: >
|
|||||||
taking 2 parameters.
|
taking 2 parameters.
|
||||||
es5id: 15.12.2-0-1
|
es5id: 15.12.2-0-1
|
||||||
description: JSON.parse must exist as a function
|
description: JSON.parse must exist as a function
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var f = JSON.parse;
|
var f = JSON.parse;
|
||||||
|
|
||||||
if (typeof(f) === "function") {
|
assert.sameValue(typeof(f), "function", 'typeof(f)');
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -15,14 +15,9 @@ info: >
|
|||||||
taking 2 parameters.
|
taking 2 parameters.
|
||||||
es5id: 15.12.2-0-2
|
es5id: 15.12.2-0-2
|
||||||
description: JSON.parse must exist as a function taking 2 parameters
|
description: JSON.parse must exist as a function taking 2 parameters
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var f = JSON.parse;
|
var f = JSON.parse;
|
||||||
|
|
||||||
if (typeof(f) === "function" && f.length === 2) {
|
assert.sameValue(typeof(f), "function", 'typeof(f)');
|
||||||
return true;
|
assert.sameValue(f.length, 2, 'f.length');
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -8,12 +8,9 @@ info: >
|
|||||||
should be able to delete (8.6.2.5) the stringify and parse properties.
|
should be able to delete (8.6.2.5) the stringify and parse properties.
|
||||||
es5id: 15.12.2-0-3
|
es5id: 15.12.2-0-3
|
||||||
description: JSON.parse must be deletable (configurable)
|
description: JSON.parse must be deletable (configurable)
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var o = JSON;
|
var o = JSON;
|
||||||
var desc = Object.getOwnPropertyDescriptor(o, "parse");
|
var desc = Object.getOwnPropertyDescriptor(o, "parse");
|
||||||
return desc.configurable === true;
|
|
||||||
}
|
assert.sameValue(desc.configurable, true, 'desc.configurable');
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -15,14 +15,8 @@ info: >
|
|||||||
taking 3 parameters.
|
taking 3 parameters.
|
||||||
es5id: 15.12.3-0-1
|
es5id: 15.12.3-0-1
|
||||||
description: JSON.stringify must exist as be a function
|
description: JSON.stringify must exist as be a function
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var f = JSON.stringify;
|
var f = JSON.stringify;
|
||||||
|
|
||||||
if (typeof(f) === "function") {
|
assert.sameValue(typeof(f), "function", 'typeof(f)');
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -15,14 +15,9 @@ info: >
|
|||||||
taking 3 parameters.
|
taking 3 parameters.
|
||||||
es5id: 15.12.3-0-2
|
es5id: 15.12.3-0-2
|
||||||
description: JSON.stringify must exist as be a function taking 3 parameters
|
description: JSON.stringify must exist as be a function taking 3 parameters
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var f = JSON.stringify;
|
var f = JSON.stringify;
|
||||||
|
|
||||||
if (typeof(f) === "function" && f.length === 3) {
|
assert.sameValue(typeof(f), "function", 'typeof(f)');
|
||||||
return true;
|
assert.sameValue(f.length, 3, 'f.length');
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -8,14 +8,9 @@ info: >
|
|||||||
should be able to delete (8.6.2.5) the stringify and parse properties.
|
should be able to delete (8.6.2.5) the stringify and parse properties.
|
||||||
es5id: 15.12.3-0-3
|
es5id: 15.12.3-0-3
|
||||||
description: JSON.stringify must be deletable (configurable)
|
description: JSON.stringify must be deletable (configurable)
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var o = JSON;
|
var o = JSON;
|
||||||
var desc = Object.getOwnPropertyDescriptor(o, "stringify");
|
var desc = Object.getOwnPropertyDescriptor(o, "stringify");
|
||||||
if (desc.configurable === true) {
|
|
||||||
return true;
|
assert.sameValue(desc.configurable, true, 'desc.configurable');
|
||||||
}
|
|
||||||
}
|
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,11 +7,8 @@ description: >
|
|||||||
JSON.stringify - stringifying an object where property name is the
|
JSON.stringify - stringifying an object where property name is the
|
||||||
union of all null character (The abstract operation Quote(value)
|
union of all null character (The abstract operation Quote(value)
|
||||||
step 2.c)
|
step 2.c)
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var result = true;
|
var result = true;
|
||||||
|
|
||||||
var expectedNullChars = new Array();
|
var expectedNullChars = new Array();
|
||||||
@ -53,6 +50,5 @@ function testcase() {
|
|||||||
var str = JSON.stringify({ "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F": "John" });
|
var str = JSON.stringify({ "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F": "John" });
|
||||||
result = (result && str.indexOf(expectedNullChars[index]) !== -1);
|
result = (result && str.indexOf(expectedNullChars[index]) !== -1);
|
||||||
}
|
}
|
||||||
return result;
|
|
||||||
}
|
assert(result, 'result !== true');
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,11 +7,8 @@ description: >
|
|||||||
JSON.stringify - stringifying an object where property name starts
|
JSON.stringify - stringifying an object where property name starts
|
||||||
with the union of all null character (The abstract operation
|
with the union of all null character (The abstract operation
|
||||||
Quote(value) step 2.c)
|
Quote(value) step 2.c)
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var result = true;
|
var result = true;
|
||||||
|
|
||||||
var expectedNullChars = new Array();
|
var expectedNullChars = new Array();
|
||||||
@ -53,6 +50,5 @@ function testcase() {
|
|||||||
var str = JSON.stringify({ "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001Fname": "John" });
|
var str = JSON.stringify({ "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001Fname": "John" });
|
||||||
result = (result && str.indexOf(expectedNullChars[index]) !== -1);
|
result = (result && str.indexOf(expectedNullChars[index]) !== -1);
|
||||||
}
|
}
|
||||||
return result;
|
|
||||||
}
|
assert(result, 'result !== true');
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,11 +7,8 @@ description: >
|
|||||||
JSON.stringify - stringifying an object where property name ends
|
JSON.stringify - stringifying an object where property name ends
|
||||||
with the union of all null character (The abstract operation
|
with the union of all null character (The abstract operation
|
||||||
Quote(value) step 2.c)
|
Quote(value) step 2.c)
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var result = true;
|
var result = true;
|
||||||
|
|
||||||
var expectedNullChars = new Array();
|
var expectedNullChars = new Array();
|
||||||
@ -53,6 +50,5 @@ function testcase() {
|
|||||||
var str = JSON.stringify({ "name\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F": "John" });
|
var str = JSON.stringify({ "name\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F": "John" });
|
||||||
result = (result && str.indexOf(expectedNullChars[index]) !== -1);
|
result = (result && str.indexOf(expectedNullChars[index]) !== -1);
|
||||||
}
|
}
|
||||||
return result;
|
|
||||||
}
|
assert(result, 'result !== true');
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,11 +7,8 @@ description: >
|
|||||||
JSON.stringify - stringifying an object where property name starts
|
JSON.stringify - stringifying an object where property name starts
|
||||||
and ends with the union of all null character (The abstract
|
and ends with the union of all null character (The abstract
|
||||||
operation Quote(value) step 2.c)
|
operation Quote(value) step 2.c)
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var result = true;
|
var result = true;
|
||||||
|
|
||||||
var expectedNullChars = new Array();
|
var expectedNullChars = new Array();
|
||||||
@ -53,6 +50,5 @@ function testcase() {
|
|||||||
var str = JSON.stringify({ "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001Fname\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F": "John" });
|
var str = JSON.stringify({ "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001Fname\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F": "John" });
|
||||||
result = (result && str.indexOf(expectedNullChars[index]) !== -1 && str.indexOf(expectedNullChars[index]) !== -1);
|
result = (result && str.indexOf(expectedNullChars[index]) !== -1 && str.indexOf(expectedNullChars[index]) !== -1);
|
||||||
}
|
}
|
||||||
return result;
|
|
||||||
}
|
assert(result, 'result !== true');
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,11 +7,8 @@ description: >
|
|||||||
JSON.stringify - stringifying an object where property name
|
JSON.stringify - stringifying an object where property name
|
||||||
middles with the union of all null character (The abstract
|
middles with the union of all null character (The abstract
|
||||||
operation Quote(value) step 2.c)
|
operation Quote(value) step 2.c)
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var result = true;
|
var result = true;
|
||||||
|
|
||||||
var expectedNullChars = new Array();
|
var expectedNullChars = new Array();
|
||||||
@ -53,6 +50,5 @@ function testcase() {
|
|||||||
var str = JSON.stringify({ "na\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001Fme": "John" });
|
var str = JSON.stringify({ "na\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001Fme": "John" });
|
||||||
result = (result && str.indexOf(expectedNullChars[index]) !== -1);
|
result = (result && str.indexOf(expectedNullChars[index]) !== -1);
|
||||||
}
|
}
|
||||||
return result;
|
|
||||||
}
|
assert(result, 'result !== true');
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,11 +7,8 @@ description: >
|
|||||||
JSON.stringify - stringifying an object where property value is
|
JSON.stringify - stringifying an object where property value is
|
||||||
the union of all null character (The abstract operation
|
the union of all null character (The abstract operation
|
||||||
Quote(value) step 2.c)
|
Quote(value) step 2.c)
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var result = true;
|
var result = true;
|
||||||
|
|
||||||
var expectedNullChars = new Array();
|
var expectedNullChars = new Array();
|
||||||
@ -53,6 +50,5 @@ function testcase() {
|
|||||||
var str = JSON.stringify({ "name": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F" });
|
var str = JSON.stringify({ "name": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F" });
|
||||||
result = (result && str.indexOf(expectedNullChars[index]) !== -1);
|
result = (result && str.indexOf(expectedNullChars[index]) !== -1);
|
||||||
}
|
}
|
||||||
return result;
|
|
||||||
}
|
assert(result, 'result !== true');
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,11 +7,8 @@ description: >
|
|||||||
JSON.stringify - stringifying an object where property value
|
JSON.stringify - stringifying an object where property value
|
||||||
starts with the union of all null character (The abstract
|
starts with the union of all null character (The abstract
|
||||||
operation Quote(value) step 2.c)
|
operation Quote(value) step 2.c)
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
|
|
||||||
var result = true;
|
var result = true;
|
||||||
|
|
||||||
var expectedNullChars = new Array();
|
var expectedNullChars = new Array();
|
||||||
@ -53,6 +50,5 @@ function testcase() {
|
|||||||
var str = JSON.stringify({ "name": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001FJohn" });
|
var str = JSON.stringify({ "name": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001FJohn" });
|
||||||
result = (result && str.indexOf(expectedNullChars[index]) !== -1);
|
result = (result && str.indexOf(expectedNullChars[index]) !== -1);
|
||||||
}
|
}
|
||||||
return result;
|
|
||||||
}
|
assert(result, 'result !== true');
|
||||||
runTestCase(testcase);
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user