mirror of
https://github.com/tc39/test262.git
synced 2025-07-20 12:34:41 +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
|
||||
all optional fields(MM, DD, mm, ss and time zone) when they are
|
||||
absent
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var result = false;
|
||||
var expectedDateTimeStr = new Date(1970, 0, 1, 0, 0, 0, 0).toISOString();
|
||||
var dateObj = new Date("1970");
|
||||
var dateStr = dateObj.toISOString();
|
||||
result = dateStr === expectedDateTimeStr;
|
||||
return result;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(result, 'result !== true');
|
||||
|
@ -4,12 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.9.4.4-0-3
|
||||
description: Date.now must exist as a function
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var fun = Date.now;
|
||||
return (typeof (fun) === "function");
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(typeof (fun), "function", 'typeof (fun)');
|
||||
|
@ -7,16 +7,12 @@ description: >
|
||||
Date.prototype.toISOString - RangeError is not thrown when value
|
||||
of date is Date(1970, 0, 100000001, 0, 0, 0, -1), the time zone is
|
||||
UTC(0)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var timeZoneMinutes = new Date().getTimezoneOffset() * (-1);
|
||||
var date, dateStr;
|
||||
|
||||
date = new Date(1970, 0, 100000001, 0, 0 + timeZoneMinutes - 60, 0, -1);
|
||||
dateStr = date.toISOString();
|
||||
|
||||
return dateStr[dateStr.length - 1] === "Z";
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(dateStr[dateStr.length - 1], "Z", 'dateStr[dateStr.length - 1]');
|
||||
|
@ -7,16 +7,12 @@ description: >
|
||||
Date.prototype.toISOString - RangeError is not thrown when value
|
||||
of date is Date(1970, 0, 100000001, 0, 0, 0, 0), the time zone is
|
||||
UTC(0)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var timeZoneMinutes = new Date().getTimezoneOffset() * (-1);
|
||||
var date, dateStr;
|
||||
|
||||
date = new Date(1970, 0, 100000001, 0, 0 + timeZoneMinutes - 60, 0, 0);
|
||||
dateStr = date.toISOString();
|
||||
|
||||
return dateStr[dateStr.length - 1] === "Z";
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(dateStr[dateStr.length - 1], "Z", 'dateStr[dateStr.length - 1]');
|
||||
|
@ -6,13 +6,9 @@ es5id: 15.9.5.43-0-4
|
||||
description: >
|
||||
Date.prototype.toISOString - format of returned string is
|
||||
'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 localDate = new Date(date.getTime() - date.getTimezoneOffset() * 60000);
|
||||
|
||||
return localDate.toISOString() === "1999-10-10T10:10:10.010Z";
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(localDate.toISOString(), "1999-10-10T10:10:10.010Z", 'localDate.toISOString()');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.9.5.43-0-5
|
||||
description: >
|
||||
Date.prototype.toISOString - The returned string is the UTC time
|
||||
zone(0)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var dateStr = (new Date()).toISOString();
|
||||
return dateStr[dateStr.length - 1] === "Z";
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(dateStr[dateStr.length - 1], "Z", 'dateStr[dateStr.length - 1]');
|
||||
|
@ -4,13 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.9.5.44-0-1
|
||||
description: Date.prototype.toJSON must exist as a function
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var f = Date.prototype.toJSON;
|
||||
if (typeof(f) === "function") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(typeof(f), "function", 'typeof(f)');
|
||||
|
@ -4,12 +4,6 @@
|
||||
/*---
|
||||
es5id: 15.9.5.44-0-2
|
||||
description: Date.prototype.toJSON must exist as a function taking 1 parameter
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
if (Date.prototype.toJSON.length === 1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Date.prototype.toJSON.length, 1, 'Date.prototype.toJSON.length');
|
||||
|
@ -7,12 +7,9 @@ description: >
|
||||
Error.prototype.toString return the result of concatenating
|
||||
'name', ':', a single space character, and 'msg' when 'name' and
|
||||
'msg' are non-empty string
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var errObj = new Error("ErrorMessage");
|
||||
errObj.name = "ErrorName";
|
||||
return errObj.toString() === "ErrorName: ErrorMessage";
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(errObj.toString(), "ErrorName: ErrorMessage", 'errObj.toString()');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.11.4.4-6-1
|
||||
description: >
|
||||
Error.prototype.toString - 'Error' is returned when 'name' is
|
||||
absent and empty string is returned when 'msg' is undefined
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var errObj = new Error();
|
||||
return errObj.toString() === "Error";
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(errObj.toString(), "Error", 'errObj.toString()');
|
||||
|
@ -7,11 +7,8 @@ description: >
|
||||
Error.prototype.toString - 'Error' is returned when 'name' is
|
||||
absent and value of 'msg' is returned when 'msg' is non-empty
|
||||
string
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var errObj = new Error("ErrorMessage");
|
||||
return errObj.toString() === "Error: ErrorMessage";
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(errObj.toString(), "Error: ErrorMessage", 'errObj.toString()');
|
||||
|
@ -6,12 +6,9 @@ es5id: 15.11.4.4-8-1
|
||||
description: >
|
||||
Error.prototype.toString return the value of 'msg' when 'name' is
|
||||
empty string and 'msg' isn't undefined
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var errObj = new Error("ErrorMessage");
|
||||
errObj.name = "";
|
||||
return errObj.toString() === "ErrorMessage";
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(errObj.toString(), "ErrorMessage", 'errObj.toString()');
|
||||
|
@ -6,12 +6,9 @@ es5id: 15.11.4.4-9-1
|
||||
description: >
|
||||
Error.prototype.toString return 'name' when 'name' is non-empty
|
||||
string and 'msg' is empty string
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var errObj = new Error();
|
||||
errObj.name = "ErrorName";
|
||||
return errObj.toString() === "ErrorName";
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(errObj.toString(), "ErrorName", 'errObj.toString()');
|
||||
|
@ -6,12 +6,6 @@ es5id: 15.3.2.1-11-1
|
||||
description: >
|
||||
Duplicate separate parameter name in Function constructor allowed
|
||||
if body not strict
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase()
|
||||
{
|
||||
Function('a','a','return;');
|
||||
return true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
@ -6,11 +6,6 @@ es5id: 15.3.2.1-11-3
|
||||
description: >
|
||||
Function constructor may have a formal parameter named 'eval' if
|
||||
body is not strict mode
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
Function('eval', 'return;');
|
||||
return true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
@ -6,12 +6,6 @@ es5id: 15.3.2.1-11-5
|
||||
description: >
|
||||
Duplicate combined parameter name in Function constructor allowed
|
||||
if body is not strict
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase()
|
||||
{
|
||||
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
|
||||
explicit 'use strict' in the function constructor's body
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
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
|
||||
there is no explicit 'use strict' in the function constructor's
|
||||
body
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var foo = new Function("baz", "baz", "baz", "return 0;");
|
||||
return true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
@ -4,17 +4,11 @@
|
||||
/*---
|
||||
es5id: 15.3.3.2-1
|
||||
description: Function.length - data property with value 1
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var desc = Object.getOwnPropertyDescriptor(Function,"length");
|
||||
if(desc.value === 1 &&
|
||||
desc.writable === false &&
|
||||
desc.enumerable === false &&
|
||||
desc.configurable === true)
|
||||
return true;
|
||||
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(desc.value, 1, 'desc.value');
|
||||
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
|
||||
arguments
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function fun() {
|
||||
return (this instanceof String);
|
||||
}
|
||||
return !fun.apply("", Array);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(fun.apply("", Array), false, 'fun.apply("", Array)');
|
||||
|
@ -8,13 +8,10 @@ description: >
|
||||
to wrapper objects when the function is called with an array of
|
||||
arguments
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function fun() {
|
||||
return (this instanceof Number);
|
||||
}
|
||||
return !fun.apply(-12, Array);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(fun.apply(-12, Array), false, 'fun.apply(-12, Array)');
|
||||
|
@ -8,13 +8,10 @@ description: >
|
||||
to wrapper objects when the function is called with an array of
|
||||
arguments
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function fun() {
|
||||
return (this instanceof Boolean);
|
||||
}
|
||||
return !fun.apply(false, Array);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(fun.apply(false, Array), false, 'fun.apply(false, Array)');
|
||||
|
@ -4,14 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.3.4.5-0-1
|
||||
description: Function.prototype.bind must exist as a function
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var f = Function.prototype.bind;
|
||||
|
||||
if (typeof(f) === "function") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(typeof(f), "function", 'typeof(f)');
|
||||
|
@ -4,12 +4,6 @@
|
||||
/*---
|
||||
es5id: 15.3.4.5-0-2
|
||||
description: Function.prototype.bind must exist as a function taking 1 parameter
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
if (Function.prototype.bind.length === 1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Function.prototype.bind.length, 1, 'Function.prototype.bind.length');
|
||||
|
@ -6,14 +6,10 @@ es5id: 15.3.4.5-10-1
|
||||
description: >
|
||||
Function.prototype.bind - internal property [[Class]] of 'F' is
|
||||
set as Function
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var foo = function () { };
|
||||
|
||||
var obj = foo.bind({});
|
||||
return Object.prototype.toString.call(obj) === "[object Function]";
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(Object.prototype.toString.call(obj), "[object Function]", 'Object.prototype.toString.call(obj)');
|
||||
|
@ -4,16 +4,11 @@
|
||||
/*---
|
||||
es5id: 15.3.4.5-13.b-1
|
||||
description: Function.prototype.bind, bound fn has a 'length' own property
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function foo() { }
|
||||
var o = {};
|
||||
|
||||
var bf = foo.bind(o);
|
||||
if (bf.hasOwnProperty('length')) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(bf.hasOwnProperty('length'), 'bf.hasOwnProperty("length") !== true');
|
||||
|
@ -6,16 +6,11 @@ es5id: 15.3.4.5-13.b-2
|
||||
description: >
|
||||
Function.prototype.bind, 'length' set to remaining number of
|
||||
expected args
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function foo(x, y) { }
|
||||
var o = {};
|
||||
|
||||
var bf = foo.bind(o);
|
||||
if (bf.length === 2) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(bf.length, 2, 'bf.length');
|
||||
|
@ -6,16 +6,11 @@ es5id: 15.3.4.5-13.b-3
|
||||
description: >
|
||||
Function.prototype.bind, 'length' set to remaining number of
|
||||
expected args (all args prefilled)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function foo(x, y) { }
|
||||
var o = {};
|
||||
|
||||
var bf = foo.bind(o, 42, 101);
|
||||
if (bf.length === 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(bf.length, 0, 'bf.length');
|
||||
|
@ -6,16 +6,11 @@ es5id: 15.3.4.5-13.b-4
|
||||
description: >
|
||||
Function.prototype.bind, 'length' set to remaining number of
|
||||
expected args (target takes 0 args)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function foo() { }
|
||||
var o = {};
|
||||
|
||||
var bf = foo.bind(o);
|
||||
if (bf.length === 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(bf.length, 0, 'bf.length');
|
||||
|
@ -6,16 +6,11 @@ es5id: 15.3.4.5-13.b-5
|
||||
description: >
|
||||
Function.prototype.bind, 'length' set to remaining number of
|
||||
expected args (target provided extra args)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function foo() { }
|
||||
var o = {};
|
||||
|
||||
var bf = foo.bind(o, 42);
|
||||
if (bf.length === 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(bf.length, 0, 'bf.length');
|
||||
|
@ -6,16 +6,11 @@ es5id: 15.3.4.5-13.b-6
|
||||
description: >
|
||||
Function.prototype.bind, 'length' set to remaining number of
|
||||
expected args
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function foo(x, y) { }
|
||||
var o = {};
|
||||
|
||||
var bf = foo.bind(o, 42);
|
||||
if (bf.length === 1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(bf.length, 1, 'bf.length');
|
||||
|
@ -4,19 +4,14 @@
|
||||
/*---
|
||||
es5id: 15.3.4.5-15-1
|
||||
description: Function.prototype.bind, 'length' is a data valued own property
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function foo() { }
|
||||
var o = {};
|
||||
|
||||
var bf = foo.bind(o);
|
||||
var desc = Object.getOwnPropertyDescriptor(bf, 'length');
|
||||
if (desc.hasOwnProperty('value') === true &&
|
||||
desc.hasOwnProperty('get') === false &&
|
||||
desc.hasOwnProperty('set') === false) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(desc.hasOwnProperty('value'), true, 'desc.hasOwnProperty("value")');
|
||||
assert.sameValue(desc.hasOwnProperty('get'), false, 'desc.hasOwnProperty("get")');
|
||||
assert.sameValue(desc.hasOwnProperty('set'), false, 'desc.hasOwnProperty("set")');
|
||||
|
@ -5,20 +5,15 @@
|
||||
es5id: 15.3.4.5-15-2
|
||||
description: >
|
||||
Function.prototype.bind, 'length' is a data valued own property
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function foo() { }
|
||||
var o = {};
|
||||
|
||||
var bf = foo.bind(o);
|
||||
var desc = Object.getOwnPropertyDescriptor(bf, 'length');
|
||||
if (desc.value === 0 &&
|
||||
desc.enumerable === false &&
|
||||
desc.writable === false &&
|
||||
desc.configurable == true) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(desc.value, 0, 'desc.value');
|
||||
assert.sameValue(desc.enumerable, false, 'desc.enumerable');
|
||||
assert.sameValue(desc.writable, false, 'desc.writable');
|
||||
assert.sameValue(desc.configurable, true, 'desc.configurable');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.3.4.5-15-4
|
||||
description: >
|
||||
Function.prototype.bind - The [[Enumerable]] attribute of length
|
||||
property in F set as false
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var canEnumerable = false;
|
||||
var hasProperty = false;
|
||||
function foo() { }
|
||||
@ -21,6 +18,6 @@ function testcase() {
|
||||
canEnumerable = true;
|
||||
}
|
||||
}
|
||||
return hasProperty && !canEnumerable;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(hasProperty, 'hasProperty !== true');
|
||||
assert.sameValue(canEnumerable, false, 'canEnumerable');
|
||||
|
@ -6,11 +6,8 @@ es5id: 15.3.4.5-15-5
|
||||
description: >
|
||||
Function.prototype.bind - The [[Configurable]] attribute of length
|
||||
property in F set as false
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var canConfigurable = false;
|
||||
var hasProperty = false;
|
||||
function foo() { }
|
||||
@ -18,6 +15,6 @@ function testcase() {
|
||||
hasProperty = obj.hasOwnProperty("length");
|
||||
delete obj.caller;
|
||||
canConfigurable = !obj.hasOwnProperty("length");
|
||||
return hasProperty && !canConfigurable;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(hasProperty, 'hasProperty !== true');
|
||||
assert.sameValue(canConfigurable, false, 'canConfigurable');
|
||||
|
@ -4,17 +4,12 @@
|
||||
/*---
|
||||
es5id: 15.3.4.5-16-1
|
||||
description: Function.prototype.bind, [[Extensible]] of the bound fn is true
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function foo() { }
|
||||
var o = {};
|
||||
|
||||
var bf = foo.bind(o);
|
||||
var ex = Object.isExtensible(bf);
|
||||
if (ex === true) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(ex, true, 'ex');
|
||||
|
@ -6,14 +6,10 @@ es5id: 15.3.4.5-16-2
|
||||
description: >
|
||||
Function.prototype.bind - The [[Extensible]] attribute of internal
|
||||
property in F set as true
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function foo() { }
|
||||
var obj = foo.bind({});
|
||||
obj.property = 12;
|
||||
return obj.hasOwnProperty("property");
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true');
|
||||
|
@ -7,14 +7,9 @@ info: >
|
||||
is not callable.
|
||||
es5id: 15.3.4.5-2-3
|
||||
description: Function.prototype.bind allows Target to be a constructor (Number)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var bnc = Number.bind(null);
|
||||
var n = bnc(42);
|
||||
if (n === 42) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(n, 42, 'n');
|
||||
|
@ -7,14 +7,9 @@ info: >
|
||||
is not callable.
|
||||
es5id: 15.3.4.5-2-4
|
||||
description: Function.prototype.bind allows Target to be a constructor (String)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var bsc = String.bind(null);
|
||||
var s = bsc("hello world");
|
||||
if (s === "hello world") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(s, "hello world", 's');
|
||||
|
@ -7,14 +7,9 @@ info: >
|
||||
is not callable.
|
||||
es5id: 15.3.4.5-2-5
|
||||
description: Function.prototype.bind allows Target to be a constructor (Boolean)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var bbc = Boolean.bind(null);
|
||||
var b = bbc(true);
|
||||
if (b === true) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(b, true, 'b');
|
||||
|
@ -7,14 +7,9 @@ info: >
|
||||
is not callable.
|
||||
es5id: 15.3.4.5-2-6
|
||||
description: Function.prototype.bind allows Target to be a constructor (Object)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var boc = Object.bind(null);
|
||||
var o = boc(42);
|
||||
if (o == 42) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert((o == 42), '(o == 42) !== true');
|
||||
|
@ -7,15 +7,13 @@ info: >
|
||||
is not callable.
|
||||
es5id: 15.3.4.5-2-8
|
||||
description: Function.prototype.bind allows Target to be a constructor (Array)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var bac = Array.bind(null);
|
||||
var a = bac(42);
|
||||
a.prop = "verifyPropertyExist";
|
||||
a[41] = 41;
|
||||
|
||||
return a.prop === "verifyPropertyExist" && a[41] === 41 && a.length === 42;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(a.prop, "verifyPropertyExist", 'a.prop');
|
||||
assert.sameValue(a[41], 41, 'a[41]');
|
||||
assert.sameValue(a.length, 42, 'a.length');
|
||||
|
@ -4,14 +4,9 @@
|
||||
/*---
|
||||
es5id: 15.3.4.5-2-9
|
||||
description: Function.prototype.bind allows Target to be a constructor (Date)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var bdc = Date.bind(null);
|
||||
var s = bdc(0, 0, 0);
|
||||
if (typeof(s) === 'string') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(typeof(s), 'string', 'typeof(s)');
|
||||
|
@ -4,17 +4,13 @@
|
||||
/*---
|
||||
es5id: 15.3.4.5-3-1
|
||||
description: Function.prototype.bind - each arg is defined in A in list order
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var foo = function (x, y) {
|
||||
return new Boolean((x + y) === "ab" && arguments[0] === "a" &&
|
||||
arguments[1] === "b" && arguments.length === 2);
|
||||
};
|
||||
|
||||
var obj = foo.bind({}, "a", "b");
|
||||
return obj()==true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert((obj() == true), '(obj() == true) !== true');
|
||||
|
@ -4,15 +4,11 @@
|
||||
/*---
|
||||
es5id: 15.3.4.5-6-1
|
||||
description: Function.prototype.bind - F can get own data property
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var foo = function () { };
|
||||
|
||||
var obj = foo.bind({});
|
||||
obj.property = 12;
|
||||
return obj.property === 12;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(obj.property, 12, 'obj.property');
|
||||
|
@ -4,14 +4,10 @@
|
||||
/*---
|
||||
es5id: 15.3.4.5-6-12
|
||||
description: Function.prototype.bind - F cannot get property which doesn't exist
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var foo = function () { };
|
||||
|
||||
var obj = foo.bind({});
|
||||
return typeof (obj.property) === "undefined";
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(typeof (obj.property), "undefined", 'typeof (obj.property)');
|
||||
|
@ -4,11 +4,8 @@
|
||||
/*---
|
||||
es5id: 15.3.4.5-6-5
|
||||
description: Function.prototype.bind - F can get own accessor property
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var foo = function () { };
|
||||
|
||||
var obj = foo.bind({});
|
||||
@ -17,6 +14,5 @@ function testcase() {
|
||||
return 12;
|
||||
}
|
||||
});
|
||||
return obj.property === 12;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(obj.property, 12, 'obj.property');
|
||||
|
@ -6,17 +6,14 @@ es5id: 15.3.4.5-6-9
|
||||
description: >
|
||||
Function.prototype.bind - F can get own accessor property without
|
||||
a get function
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var foo = function () { };
|
||||
|
||||
var obj = foo.bind({});
|
||||
Object.defineProperty(obj, "property", {
|
||||
set: function () {}
|
||||
});
|
||||
return obj.hasOwnProperty("property") && typeof (obj.property) === "undefined";
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true');
|
||||
assert.sameValue(typeof (obj.property), "undefined", 'typeof (obj.property)');
|
||||
|
@ -4,16 +4,11 @@
|
||||
/*---
|
||||
es5id: 15.3.4.5-8-1
|
||||
description: Function.prototype.bind, type of bound function must be 'function'
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function foo() { }
|
||||
var o = {};
|
||||
|
||||
var bf = foo.bind(o);
|
||||
if (typeof(bf) === 'function') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(typeof(bf), 'function', 'typeof(bf)');
|
||||
|
@ -6,17 +6,12 @@ es5id: 15.3.4.5-8-2
|
||||
description: >
|
||||
Function.prototype.bind, [[Class]] of bound function must be
|
||||
'Function'
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function foo() { }
|
||||
var o = {};
|
||||
|
||||
var bf = foo.bind(o);
|
||||
var s = Object.prototype.toString.call(bf);
|
||||
if (s === '[object Function]') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(s, '[object Function]', 's');
|
||||
|
@ -4,16 +4,11 @@
|
||||
/*---
|
||||
es5id: 15.3.4.5-9-1
|
||||
description: Function.prototype.bind, [[Prototype]] is Function.prototype
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function foo() { }
|
||||
var o = {};
|
||||
|
||||
var bf = foo.bind(o);
|
||||
if (Function.prototype.isPrototypeOf(bf)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(Function.prototype.isPrototypeOf(bf), 'Function.prototype.isPrototypeOf(bf) !== true');
|
||||
|
@ -6,16 +6,11 @@ es5id: 15.3.4.5-9-2
|
||||
description: >
|
||||
Function.prototype.bind, [[Prototype]] is Function.prototype
|
||||
(using getPrototypeOf)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function foo() { }
|
||||
var o = {};
|
||||
|
||||
var bf = foo.bind(o);
|
||||
if (Object.getPrototypeOf(bf) === Function.prototype) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(Object.getPrototypeOf(bf), Function.prototype, 'Object.getPrototypeOf(bf)');
|
||||
|
@ -7,16 +7,12 @@ description: >
|
||||
[[Call]] - 'F''s [[BoundArgs]] is used as the former part of
|
||||
arguments of calling the [[Call]] internal method of 'F''s
|
||||
[[TargetFunction]] when 'F' is called
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var func = function (x, y, z) {
|
||||
return x + y + z;
|
||||
};
|
||||
|
||||
var newFunc = Function.prototype.bind.call(func, {}, "a", "b", "c");
|
||||
|
||||
return newFunc() === "abc";
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newFunc(), "abc", 'newFunc()');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-10
|
||||
description: >
|
||||
[[Call]] - length of parameters of 'target' is 1, length of
|
||||
'boundArgs' is 0, length of 'ExtraArgs' is 0, and with 'boundThis'
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var obj = { prop: "abc" };
|
||||
|
||||
var func = function (x) {
|
||||
@ -18,6 +16,4 @@ function testcase() {
|
||||
|
||||
var newFunc = Function.prototype.bind.call(func, obj);
|
||||
|
||||
return newFunc();
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(newFunc(), 'newFunc() !== true');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-11
|
||||
description: >
|
||||
[[Call]] - length of parameters of 'target' is 1, length of
|
||||
'boundArgs' is 0, length of 'ExtraArgs' is 1, and with 'boundThis'
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var obj = { prop: "abc" };
|
||||
|
||||
var func = function (x) {
|
||||
@ -18,6 +16,4 @@ function testcase() {
|
||||
|
||||
var newFunc = Function.prototype.bind.call(func, obj);
|
||||
|
||||
return newFunc(1);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(newFunc(1), 'newFunc(1) !== true');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-12
|
||||
description: >
|
||||
[[Call]] - length of parameters of 'target' is 1, length of
|
||||
'boundArgs' is 0, length of 'ExtraArgs' is 2, and with 'boundThis'
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var obj = { prop: "abc" };
|
||||
|
||||
var func = function (x) {
|
||||
@ -19,6 +17,4 @@ function testcase() {
|
||||
|
||||
var newFunc = Function.prototype.bind.call(func, obj);
|
||||
|
||||
return newFunc(1, 2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(newFunc(1, 2), 'newFunc(1, 2) !== true');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-13
|
||||
description: >
|
||||
[[Call]] - length of parameters of 'target' is 1, length of
|
||||
'boundArgs' is 1, length of 'ExtraArgs' is 0, and with 'boundThis'
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var obj = { prop: "abc" };
|
||||
|
||||
var func = function (x) {
|
||||
@ -19,6 +17,4 @@ function testcase() {
|
||||
|
||||
var newFunc = Function.prototype.bind.call(func, obj, 1);
|
||||
|
||||
return newFunc();
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(newFunc(), 'newFunc() !== true');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-14
|
||||
description: >
|
||||
[[Call]] - length of parameters of 'target' is 1, length of
|
||||
'boundArgs' is 1, length of 'ExtraArgs' is 1, and with 'boundThis'
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var obj = { prop: "abc" };
|
||||
|
||||
var func = function (x) {
|
||||
@ -19,6 +17,4 @@ function testcase() {
|
||||
|
||||
var newFunc = Function.prototype.bind.call(func, obj, 1);
|
||||
|
||||
return newFunc(2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(newFunc(2), 'newFunc(2) !== true');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-15
|
||||
description: >
|
||||
[[Call]] - length of parameters of 'target' is 1, length of
|
||||
'boundArgs' is 2, length of 'ExtraArgs' is 0, and with 'boundThis'
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var obj = { prop: "abc" };
|
||||
|
||||
var func = function (x) {
|
||||
@ -19,6 +17,4 @@ function testcase() {
|
||||
|
||||
var newFunc = Function.prototype.bind.call(func, obj, 1, 2);
|
||||
|
||||
return newFunc();
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(newFunc(), 'newFunc() !== true');
|
||||
|
@ -7,10 +7,8 @@ description: >
|
||||
[[Call]] - 'F''s [[BoundThis]] is used as the 'this' value of
|
||||
calling the [[Call]] internal method of 'F''s [[TargetFunction]]
|
||||
when 'F' is called
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var obj = { "prop": "a" };
|
||||
|
||||
var func = function () {
|
||||
@ -19,6 +17,4 @@ function testcase() {
|
||||
|
||||
var newFunc = Function.prototype.bind.call(func, obj);
|
||||
|
||||
return newFunc() === obj;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newFunc(), obj, 'newFunc()');
|
||||
|
@ -7,16 +7,12 @@ description: >
|
||||
[[Call]] - the provided arguments is used as the latter part of
|
||||
arguments of calling the [[Call]] internal method of 'F''s
|
||||
[[TargetFunction]] when 'F' is called
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var func = function (x, y, z) {
|
||||
return z;
|
||||
};
|
||||
|
||||
var newFunc = Function.prototype.bind.call(func, {}, "a", "b");
|
||||
|
||||
return newFunc("c") === "c";
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newFunc("c"), "c", 'newFunc("c")');
|
||||
|
@ -7,16 +7,12 @@ description: >
|
||||
[[Call]] - length of parameters of 'target' is 0, length of
|
||||
'boundArgs' is 0, length of 'ExtraArgs' is 0, and without
|
||||
'boundThis'
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var func = function () {
|
||||
return arguments.length === 0;
|
||||
};
|
||||
|
||||
var newFunc = Function.prototype.bind.call(func);
|
||||
|
||||
return newFunc();
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(newFunc(), 'newFunc() !== true');
|
||||
|
@ -7,16 +7,12 @@ description: >
|
||||
[[Call]] - length of parameters of 'target' is 0, length of
|
||||
'boundArgs' is 0, length of 'ExtraArgs' is 1, and without
|
||||
'boundThis'
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var func = function () {
|
||||
return arguments[0] === 1;
|
||||
};
|
||||
|
||||
var newFunc = Function.prototype.bind.call(func);
|
||||
|
||||
return newFunc(1);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(newFunc(1), 'newFunc(1) !== true');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-6
|
||||
description: >
|
||||
[[Call]] - length of parameters of 'target' is 0, length of
|
||||
'boundArgs' is 0, length of 'ExtraArgs' is 0, and with 'boundThis'
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var obj = { prop: "abc" };
|
||||
|
||||
var func = function () {
|
||||
@ -18,6 +16,4 @@ function testcase() {
|
||||
|
||||
var newFunc = Function.prototype.bind.call(func, obj);
|
||||
|
||||
return newFunc();
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(newFunc(), 'newFunc() !== true');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-7
|
||||
description: >
|
||||
[[Call]] - length of parameters of 'target' is 0, length of
|
||||
'boundArgs' is 1, length of 'ExtraArgs' is 0, and with 'boundThis'
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var obj = { prop: "abc" };
|
||||
|
||||
var func = function () {
|
||||
@ -18,6 +16,4 @@ function testcase() {
|
||||
|
||||
var newFunc = Function.prototype.bind.call(func, obj, 1);
|
||||
|
||||
return newFunc();
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(newFunc(), 'newFunc() !== true');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-8
|
||||
description: >
|
||||
[[Call]] - length of parameters of 'target' is 0, length of
|
||||
'boundArgs' is 0, length of 'ExtraArgs' is 1, and with 'boundThis'
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var obj = { prop: "abc" };
|
||||
|
||||
var func = function () {
|
||||
@ -18,6 +16,4 @@ function testcase() {
|
||||
|
||||
var newFunc = Function.prototype.bind.call(func, obj);
|
||||
|
||||
return newFunc(1);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(newFunc(1), 'newFunc(1) !== true');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-9
|
||||
description: >
|
||||
[[Call]] - length of parameters of 'target' is 0, length of
|
||||
'boundArgs' is 1, length of 'ExtraArgs' is 1, and with 'boundThis'
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var obj = { prop: "abc" };
|
||||
|
||||
var func = function () {
|
||||
@ -18,6 +16,4 @@ function testcase() {
|
||||
|
||||
var newFunc = Function.prototype.bind.call(func, obj, 1);
|
||||
|
||||
return newFunc(2);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(newFunc(2), 'newFunc(2) !== true');
|
||||
|
@ -7,10 +7,8 @@ description: >
|
||||
[[Construct]] - 'F''s [[BoundArgs]] is used as the former part of
|
||||
arguments of calling the [[Construct]] internal method of 'F''s
|
||||
[[TargetFunction]] when 'F' is called as constructor
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var func = function (x, y, z) {
|
||||
var objResult = {};
|
||||
objResult.returnValue = x + y + z;
|
||||
@ -22,7 +20,7 @@ function testcase() {
|
||||
|
||||
var newInstance = new NewFunc();
|
||||
|
||||
return newInstance.hasOwnProperty("returnValue") && newInstance.returnValue === "abc" &&
|
||||
newInstance.hasOwnProperty("returnVerifyResult") && newInstance.returnVerifyResult === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(newInstance.hasOwnProperty("returnValue"), 'newInstance.hasOwnProperty("returnValue") !== true');
|
||||
assert.sameValue(newInstance.returnValue, "abc", 'newInstance.returnValue');
|
||||
assert(newInstance.hasOwnProperty("returnVerifyResult"), 'newInstance.hasOwnProperty("returnVerifyResult") !== true');
|
||||
assert.sameValue(newInstance.returnVerifyResult, true, 'newInstance.returnVerifyResult');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-10
|
||||
description: >
|
||||
[[Construct]] - length of parameters of 'target' is 1, length of
|
||||
'boundArgs' is 0, length of 'ExtraArgs' is 1
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var func = function (x) {
|
||||
return new Boolean(arguments.length === 1 && x === 1 && arguments[0] === 1);
|
||||
};
|
||||
@ -18,6 +16,4 @@ function testcase() {
|
||||
|
||||
var newInstance = new NewFunc(1);
|
||||
|
||||
return newInstance.valueOf() === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-11
|
||||
description: >
|
||||
[[Construct]] - length of parameters of 'target' is 1, length of
|
||||
'boundArgs' is 0, length of 'ExtraArgs' is 2
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var func = function (x) {
|
||||
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);
|
||||
|
||||
return newInstance.valueOf() === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-12
|
||||
description: >
|
||||
[[Construct]] - length of parameters of 'target' is 1, length of
|
||||
'boundArgs' is 1, length of 'ExtraArgs' is 0
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var func = function (x) {
|
||||
return new Boolean(arguments.length === 1 && x === 1 && arguments[0] === 1);
|
||||
};
|
||||
@ -18,6 +16,4 @@ function testcase() {
|
||||
|
||||
var newInstance = new NewFunc();
|
||||
|
||||
return newInstance.valueOf() === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-13
|
||||
description: >
|
||||
[[Construct]] - length of parameters of 'target' is 1, length of
|
||||
'boundArgs' is 1, length of 'ExtraArgs' is 1
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var func = function (x) {
|
||||
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);
|
||||
|
||||
return newInstance.valueOf() === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-14
|
||||
description: >
|
||||
[[Construct]] - length of parameters of 'target' is 1, length of
|
||||
'boundArgs' is 2, length of 'ExtraArgs' is 0
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var func = function (x) {
|
||||
return new Boolean(arguments.length === 2 && x === 1 && arguments[1] === 2 && arguments[0] === 1);
|
||||
};
|
||||
@ -18,6 +16,4 @@ function testcase() {
|
||||
|
||||
var newInstance = new NewFunc();
|
||||
|
||||
return newInstance.valueOf() === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()');
|
||||
|
@ -7,10 +7,8 @@ description: >
|
||||
[[Construct]] - the provided arguments is used as the latter part
|
||||
of arguments of calling the [[Construct]] internal method of 'F''s
|
||||
[[TargetFunction]] when 'F' is called as constructor
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var func = function (x, y, z) {
|
||||
var objResult = {};
|
||||
objResult.returnValue = x + y + z;
|
||||
@ -22,7 +20,7 @@ function testcase() {
|
||||
|
||||
var newInstance = new NewFunc("a", "b", "c");
|
||||
|
||||
return newInstance.hasOwnProperty("returnValue") && newInstance.returnValue === "abc" &&
|
||||
newInstance.hasOwnProperty("returnVerifyResult") && newInstance.returnVerifyResult === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(newInstance.hasOwnProperty("returnValue"), 'newInstance.hasOwnProperty("returnValue") !== true');
|
||||
assert.sameValue(newInstance.returnValue, "abc", 'newInstance.returnValue');
|
||||
assert(newInstance.hasOwnProperty("returnVerifyResult"), 'newInstance.hasOwnProperty("returnVerifyResult") !== true');
|
||||
assert.sameValue(newInstance.returnVerifyResult, true, 'newInstance.returnVerifyResult');
|
||||
|
@ -7,10 +7,8 @@ description: >
|
||||
[[Construct]] - length of parameters of 'target' is 0, length of
|
||||
'boundArgs' is 0, length of 'ExtraArgs' is 0, and without
|
||||
'boundThis'
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var func = function () {
|
||||
return new Boolean(arguments.length === 0);
|
||||
};
|
||||
@ -19,6 +17,4 @@ function testcase() {
|
||||
|
||||
var newInstance = new NewFunc();
|
||||
|
||||
return newInstance.valueOf() === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()');
|
||||
|
@ -7,10 +7,8 @@ description: >
|
||||
[[Construct]] - length of parameters of 'target' is 0, length of
|
||||
'boundArgs' is 0, length of 'ExtraArgs' is 1, and without
|
||||
'boundThis'
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var func = function () {
|
||||
return new Boolean(arguments[0] === 1 && arguments.length === 1);
|
||||
};
|
||||
@ -19,6 +17,4 @@ function testcase() {
|
||||
|
||||
var newInstance = new NewFunc(1);
|
||||
|
||||
return newInstance.valueOf() === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-6
|
||||
description: >
|
||||
[[Construct]] - length of parameters of 'target' is 0, length of
|
||||
'boundArgs' is 1, length of 'ExtraArgs' is 0
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var func = function () {
|
||||
return new Boolean(arguments.length === 1 && arguments[0] === 1);
|
||||
};
|
||||
@ -18,6 +16,4 @@ function testcase() {
|
||||
|
||||
var newInstance = new NewFunc();
|
||||
|
||||
return newInstance.valueOf() === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-7
|
||||
description: >
|
||||
[[Construct]] - length of parameters of 'target' is 0, length of
|
||||
'boundArgs' is 0, length of 'ExtraArgs' is 1
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var func = function () {
|
||||
return new Boolean(arguments.length === 1 && arguments[0] === 1);
|
||||
};
|
||||
@ -18,6 +16,4 @@ function testcase() {
|
||||
|
||||
var newInstance = new NewFunc(1);
|
||||
|
||||
return newInstance.valueOf() === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-8
|
||||
description: >
|
||||
[[Construct]] - length of parameters of 'target' is 0, length of
|
||||
'boundArgs' is 1, length of 'ExtraArgs' is 1
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var func = function () {
|
||||
return new Boolean(arguments.length === 2 && arguments[0] === 1 && arguments[1] === 2);
|
||||
};
|
||||
@ -18,6 +16,4 @@ function testcase() {
|
||||
|
||||
var newInstance = new NewFunc(2);
|
||||
|
||||
return newInstance.valueOf() === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()');
|
||||
|
@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-9
|
||||
description: >
|
||||
[[Construct]] - length of parameters of 'target' is 1, length of
|
||||
'boundArgs' is 0, length of 'ExtraArgs' is 0
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var func = function (x) {
|
||||
return new Boolean(arguments.length === 0 && typeof x === "undefined");
|
||||
};
|
||||
@ -18,6 +16,4 @@ function testcase() {
|
||||
|
||||
var newInstance = new NewFunc();
|
||||
|
||||
return newInstance.valueOf() === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()');
|
||||
|
@ -8,13 +8,10 @@ description: >
|
||||
to wrapper objects when the function is called without an array of
|
||||
arguments
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function fun() {
|
||||
return (this instanceof String);
|
||||
}
|
||||
return !fun.call("");
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(fun.call(""), false, 'fun.call("")');
|
||||
|
@ -8,13 +8,10 @@ description: >
|
||||
to wrapper objects when the function is called without an array
|
||||
argument
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function fun() {
|
||||
return (this instanceof Number);
|
||||
}
|
||||
return !fun.call(-12);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(fun.call(-12), false, 'fun.call(-12)');
|
||||
|
@ -8,13 +8,10 @@ description: >
|
||||
to wrapper objects when the function is called without an array of
|
||||
arguments
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function fun() {
|
||||
return (this instanceof Boolean);
|
||||
}
|
||||
return !fun.call(false);
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(fun.call(false), false, 'fun.call(false)');
|
||||
|
@ -6,17 +6,11 @@ es5id: 15.1.1.2-0
|
||||
description: >
|
||||
Global.Infinity is a data property with default attribute values
|
||||
(false)
|
||||
includes:
|
||||
- runTestCase.js
|
||||
- fnGlobalObject.js
|
||||
includes: [fnGlobalObject.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var desc = Object.getOwnPropertyDescriptor(fnGlobalObject(), 'Infinity');
|
||||
if (desc.writable === false &&
|
||||
desc.enumerable === false &&
|
||||
desc.configurable === false) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(desc.writable, false, 'desc.writable');
|
||||
assert.sameValue(desc.enumerable, false, 'desc.enumerable');
|
||||
assert.sameValue(desc.configurable, false, 'desc.configurable');
|
||||
|
@ -8,13 +8,8 @@ info: >
|
||||
4.2 calls out JSON as one of the built-in objects.
|
||||
es5id: 15.12-0-1
|
||||
description: JSON must be a built-in object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var o = JSON;
|
||||
if (typeof(o) === "object") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(typeof(o), "object", 'typeof(o)');
|
||||
|
@ -10,18 +10,13 @@ info: >
|
||||
JSON, and we should not be able to enumerate them.
|
||||
es5id: 15.12-0-4
|
||||
description: JSON object's properties must be non enumerable
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var o = JSON;
|
||||
var i = 0;
|
||||
for (var p in o) {
|
||||
i++;
|
||||
}
|
||||
|
||||
if (i === 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(i, 0, 'i');
|
||||
|
@ -4,16 +4,10 @@
|
||||
/*---
|
||||
es5id: 15.12.1.1-0-9
|
||||
description: Whitespace characters can appear before/after any JSONtoken
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
JSON.parse('\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'+
|
||||
'[\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
|
||||
return true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
@ -15,14 +15,8 @@ info: >
|
||||
taking 2 parameters.
|
||||
es5id: 15.12.2-0-1
|
||||
description: JSON.parse must exist as a function
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var f = JSON.parse;
|
||||
|
||||
if (typeof(f) === "function") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(typeof(f), "function", 'typeof(f)');
|
||||
|
@ -15,14 +15,9 @@ info: >
|
||||
taking 2 parameters.
|
||||
es5id: 15.12.2-0-2
|
||||
description: JSON.parse must exist as a function taking 2 parameters
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var f = JSON.parse;
|
||||
|
||||
if (typeof(f) === "function" && f.length === 2) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(typeof(f), "function", 'typeof(f)');
|
||||
assert.sameValue(f.length, 2, 'f.length');
|
||||
|
@ -8,12 +8,9 @@ info: >
|
||||
should be able to delete (8.6.2.5) the stringify and parse properties.
|
||||
es5id: 15.12.2-0-3
|
||||
description: JSON.parse must be deletable (configurable)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var o = JSON;
|
||||
var desc = Object.getOwnPropertyDescriptor(o, "parse");
|
||||
return desc.configurable === true;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(desc.configurable, true, 'desc.configurable');
|
||||
|
@ -15,14 +15,8 @@ info: >
|
||||
taking 3 parameters.
|
||||
es5id: 15.12.3-0-1
|
||||
description: JSON.stringify must exist as be a function
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var f = JSON.stringify;
|
||||
|
||||
if (typeof(f) === "function") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(typeof(f), "function", 'typeof(f)');
|
||||
|
@ -15,14 +15,9 @@ info: >
|
||||
taking 3 parameters.
|
||||
es5id: 15.12.3-0-2
|
||||
description: JSON.stringify must exist as be a function taking 3 parameters
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var f = JSON.stringify;
|
||||
|
||||
if (typeof(f) === "function" && f.length === 3) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(typeof(f), "function", 'typeof(f)');
|
||||
assert.sameValue(f.length, 3, 'f.length');
|
||||
|
@ -8,14 +8,9 @@ info: >
|
||||
should be able to delete (8.6.2.5) the stringify and parse properties.
|
||||
es5id: 15.12.3-0-3
|
||||
description: JSON.stringify must be deletable (configurable)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var o = JSON;
|
||||
var desc = Object.getOwnPropertyDescriptor(o, "stringify");
|
||||
if (desc.configurable === true) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(desc.configurable, true, 'desc.configurable');
|
||||
|
@ -7,11 +7,8 @@ description: >
|
||||
JSON.stringify - stringifying an object where property name is the
|
||||
union of all null character (The abstract operation Quote(value)
|
||||
step 2.c)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var result = true;
|
||||
|
||||
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" });
|
||||
result = (result && str.indexOf(expectedNullChars[index]) !== -1);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(result, 'result !== true');
|
||||
|
@ -7,11 +7,8 @@ description: >
|
||||
JSON.stringify - stringifying an object where property name starts
|
||||
with the union of all null character (The abstract operation
|
||||
Quote(value) step 2.c)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var result = true;
|
||||
|
||||
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" });
|
||||
result = (result && str.indexOf(expectedNullChars[index]) !== -1);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(result, 'result !== true');
|
||||
|
@ -7,11 +7,8 @@ description: >
|
||||
JSON.stringify - stringifying an object where property name ends
|
||||
with the union of all null character (The abstract operation
|
||||
Quote(value) step 2.c)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var result = true;
|
||||
|
||||
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" });
|
||||
result = (result && str.indexOf(expectedNullChars[index]) !== -1);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(result, 'result !== true');
|
||||
|
@ -7,11 +7,8 @@ description: >
|
||||
JSON.stringify - stringifying an object where property name starts
|
||||
and ends with the union of all null character (The abstract
|
||||
operation Quote(value) step 2.c)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var result = true;
|
||||
|
||||
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" });
|
||||
result = (result && str.indexOf(expectedNullChars[index]) !== -1 && str.indexOf(expectedNullChars[index]) !== -1);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(result, 'result !== true');
|
||||
|
@ -7,11 +7,8 @@ description: >
|
||||
JSON.stringify - stringifying an object where property name
|
||||
middles with the union of all null character (The abstract
|
||||
operation Quote(value) step 2.c)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var result = true;
|
||||
|
||||
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" });
|
||||
result = (result && str.indexOf(expectedNullChars[index]) !== -1);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(result, 'result !== true');
|
||||
|
@ -7,11 +7,8 @@ description: >
|
||||
JSON.stringify - stringifying an object where property value is
|
||||
the union of all null character (The abstract operation
|
||||
Quote(value) step 2.c)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var result = true;
|
||||
|
||||
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" });
|
||||
result = (result && str.indexOf(expectedNullChars[index]) !== -1);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(result, 'result !== true');
|
||||
|
@ -7,11 +7,8 @@ description: >
|
||||
JSON.stringify - stringifying an object where property value
|
||||
starts with the union of all null character (The abstract
|
||||
operation Quote(value) step 2.c)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var result = true;
|
||||
|
||||
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" });
|
||||
result = (result && str.indexOf(expectedNullChars[index]) !== -1);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(result, 'result !== true');
|
||||
|
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