es6 compatability updates

See also: https://github.com/tc39/test262/pull/29
This commit is contained in:
André Bargull 2014-02-04 20:37:40 +01:00 committed by Brian Terlson
parent c3a803b4a3
commit 5c5dffce8b
353 changed files with 1731 additions and 2384 deletions

View File

@ -34,5 +34,5 @@ if (typeof String.prototype.toLowerCase !== "function") $ERROR('#23: typeof Str
if (typeof String.prototype['toLowerCase'] !== "function") $ERROR('#24: typeof String.prototype["toLowerCase"] === "function". Actual: ' + (typeof String.prototype["toLowerCase"] ));
if (typeof String.prototype.toUpperCase !== "function") $ERROR('#25: typeof String.prototype.toUpperCase === "function". Actual: ' + (typeof String.prototype.toUpperCase ));
if (typeof String.prototype['toUpperCase'] !== "function") $ERROR('#26: typeof Array.prototype === "object". Actual: ' + (typeof Array.prototype ));
if (typeof String.prototype.length !== "number") $ERROR('#27: typeof String.prototype.length === "number". Actual: ' + (typeof String.prototype.length ));
if (typeof String.prototype['length'] !== "number") $ERROR('#28: typeof String.prototype["length"] === "number". Actual: ' + (typeof String.prototype["length"] ));
if (typeof String.prototype.length !== "undefined") $ERROR('#27: typeof String.prototype.length === "undefined". Actual: ' + (typeof String.prototype.length ));
if (typeof String.prototype['length'] !== "undefined") $ERROR('#28: typeof String.prototype["length"] === "undefined". Actual: ' + (typeof String.prototype["length"] ));

View File

@ -6,7 +6,7 @@
/*---
es5id: 11.4.1-5-a-28-s
description: Strict Mode - TypeError is thrown when deleting RegExp.length
description: Strict Mode - TypeError is not thrown when deleting RegExp.length
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
@ -14,11 +14,7 @@ includes: [runTestCase.js]
function testcase() {
"use strict";
var a = new RegExp();
try {
var b = delete RegExp.length;
return false;
} catch (e) {
return e instanceof TypeError;
}
var b = delete RegExp.length;
return true;
}
runTestCase(testcase);

View File

@ -4,7 +4,7 @@
/*---
info: The production Block can't be inside of expression
es5id: 12.1_A4_T2
description: Checking if execution of "y={x}" fails
description: Checking if execution of "y={x;}" fails
negative: SyntaxError
---*/

View File

@ -7,11 +7,14 @@
/*---
es5id: 12.14-1
description: >
catch doesn't change declaration scope - var initializer in catch
with same name as catch parameter changes parameter
var initializer in catch with same name as catch parameter is a
SyntaxError
negative: ^((?!NotEarlyError).)*$
includes: [runTestCase.js]
---*/
throw NotEarlyError;
function testcase() {
foo = "prior to throw";
try {

View File

@ -7,11 +7,14 @@
/*---
es5id: 12.14-2
description: >
catch doesn't change declaration scope - var initializer in catch
with same name as catch parameter changes parameter
var initializer in catch with same name as catch parameter is a
SyntaxError
negative: ^((?!NotEarlyError).)*$
includes: [runTestCase.js]
---*/
throw NotEarlyError;
function testcase() {
function capturedFoo() {return foo};
foo = "prior to throw";

View File

@ -33,6 +33,6 @@ function testcase() {
delete fun.length;
verifyConfigurable = fun.hasOwnProperty("length");
return verifyValue && !verifyWritable && !verifyEnumerable && verifyConfigurable;
return verifyValue && !verifyWritable && !verifyEnumerable && !verifyConfigurable;
}
runTestCase(testcase);

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: The length property of eval has the attribute DontDelete
info: The length property of eval does not have the attribute DontDelete
es5id: 15.1.2.1_A4.2
description: Checking use hasOwnProperty, delete
includes: [$FAIL.js]
@ -16,8 +16,8 @@ if (eval.hasOwnProperty('length') !== true) {
delete eval.length;
//CHECK#2
if (eval.hasOwnProperty('length') !== true) {
$ERROR('#2: delete eval.length; eval.hasOwnProperty(\'length\') === true. Actual: ' + (eval.hasOwnProperty('length')));
if (eval.hasOwnProperty('length') !== false) {
$ERROR('#2: delete eval.length; eval.hasOwnProperty(\'length\') === false. Actual: ' + (eval.hasOwnProperty('length')));
}
//CHECK#3

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: The length property of parseInt has the attribute DontDelete
info: The length property of parseInt does not have the attribute DontDelete
es5id: 15.1.2.2_A9.2
description: Checking use hasOwnProperty, delete
flags: [noStrict]
@ -17,8 +17,8 @@ if (parseInt.hasOwnProperty('length') !== true) {
delete parseInt.length;
//CHECK#2
if (parseInt.hasOwnProperty('length') !== true) {
$ERROR('#2: delete parseInt.length; parseInt.hasOwnProperty(\'length\') === true. Actual: ' + (parseInt.hasOwnProperty('length')));
if (parseInt.hasOwnProperty('length') !== false) {
$ERROR('#2: delete parseInt.length; parseInt.hasOwnProperty(\'length\') === false. Actual: ' + (parseInt.hasOwnProperty('length')));
}
//CHECK#3

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: The length property of parseFloat has the attribute DontDelete
info: The length property of parseFloat does not have the attribute DontDelete
es5id: 15.1.2.3_A7.2
description: Checking use hasOwnProperty, delete
flags: [noStrict]
@ -17,8 +17,8 @@ if (parseFloat.hasOwnProperty('length') !== true) {
delete parseFloat.length;
//CHECK#2
if (parseFloat.hasOwnProperty('length') !== true) {
$ERROR('#2: delete parseFloat.length; parseFloat.hasOwnProperty(\'length\') === true. Actual: ' + (parseFloat.hasOwnProperty('length')));
if (parseFloat.hasOwnProperty('length') !== false) {
$ERROR('#2: delete parseFloat.length; parseFloat.hasOwnProperty(\'length\') === false. Actual: ' + (parseFloat.hasOwnProperty('length')));
}
//CHECK#3

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: The length property of isNaN has the attribute DontDelete
info: The length property of isNaN does not have the attribute DontDelete
es5id: 15.1.2.4_A2.2
description: Checking use hasOwnProperty, delete
flags: [noStrict]
@ -17,8 +17,8 @@ if (isNaN.hasOwnProperty('length') !== true) {
delete isNaN.length;
//CHECK#2
if (isNaN.hasOwnProperty('length') !== true) {
$ERROR('#2: delete isNaN.length; isNaN.hasOwnProperty(\'length\') === true. Actual: ' + (isNaN.hasOwnProperty('length')));
if (isNaN.hasOwnProperty('length') !== false) {
$ERROR('#2: delete isNaN.length; isNaN.hasOwnProperty(\'length\') === false. Actual: ' + (isNaN.hasOwnProperty('length')));
}
//CHECK#3

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: The length property of isFinite has the attribute DontDelete
info: The length property of isFinite does not have the attribute DontDelete
es5id: 15.1.2.5_A2.2
description: Checking use hasOwnProperty, delete
flags: [noStrict]
@ -17,8 +17,8 @@ if (isFinite.hasOwnProperty('length') !== true) {
delete isFinite.length;
//CHECK#2
if (isFinite.hasOwnProperty('length') !== true) {
$ERROR('#2: delete isFinite.length; isFinite.hasOwnProperty(\'length\') === true. Actual: ' + (isFinite.hasOwnProperty('length')));
if (isFinite.hasOwnProperty('length') !== false) {
$ERROR('#2: delete isFinite.length; isFinite.hasOwnProperty(\'length\') === false. Actual: ' + (isFinite.hasOwnProperty('length')));
}
//CHECK#3

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: The length property of decodeURI has the attribute DontDelete
info: The length property of decodeURI does not have the attribute DontDelete
es5id: 15.1.3.1_A5.2
description: Checking use hasOwnProperty, delete
flags: [noStrict]
@ -17,8 +17,8 @@ if (decodeURI.hasOwnProperty('length') !== true) {
delete decodeURI.length;
//CHECK#2
if (decodeURI.hasOwnProperty('length') !== true) {
$ERROR('#2: delete decodeURI.length; decodeURI.hasOwnProperty(\'length\') === true. Actual: ' + (decodeURI.hasOwnProperty('length')));
if (decodeURI.hasOwnProperty('length') !== false) {
$ERROR('#2: delete decodeURI.length; decodeURI.hasOwnProperty(\'length\') === false. Actual: ' + (decodeURI.hasOwnProperty('length')));
}
//CHECK#3

View File

@ -2,7 +2,9 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: The length property of decodeURIComponent has the attribute DontDelete
info: >
The length property of decodeURIComponent does not have the attribute
DontDelete
es5id: 15.1.3.2_A5.2
description: Checking use hasOwnProperty, delete
includes: [$FAIL.js]
@ -16,8 +18,8 @@ if (decodeURIComponent.hasOwnProperty('length') !== true) {
delete decodeURIComponent.length;
//CHECK#2
if (decodeURIComponent.hasOwnProperty('length') !== true) {
$ERROR('#2: delete decodeURIComponent.length; decodeURIComponent.hasOwnProperty(\'length\') === true. Actual: ' + (decodeURIComponent.hasOwnProperty('length')));
if (decodeURIComponent.hasOwnProperty('length') !== false) {
$ERROR('#2: delete decodeURIComponent.length; decodeURIComponent.hasOwnProperty(\'length\') === false. Actual: ' + (decodeURIComponent.hasOwnProperty('length')));
}
//CHECK#3

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: The length property of encodeURI has the attribute DontDelete
info: The length property of encodeURI does not have the attribute DontDelete
es5id: 15.1.3.3_A5.2
description: Checking use hasOwnProperty, delete
includes: [$FAIL.js]
@ -16,8 +16,8 @@ if (encodeURI.hasOwnProperty('length') !== true) {
delete encodeURI.length;
//CHECK#2
if (encodeURI.hasOwnProperty('length') !== true) {
$ERROR('#2: delete encodeURI.length; encodeURI.hasOwnProperty(\'length\') === true. Actual: ' + (encodeURI.hasOwnProperty('length')));
if (encodeURI.hasOwnProperty('length') !== false) {
$ERROR('#2: delete encodeURI.length; encodeURI.hasOwnProperty(\'length\') === false. Actual: ' + (encodeURI.hasOwnProperty('length')));
}
//CHECK#3

View File

@ -2,7 +2,9 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: The length property of encodeURIComponent has the attribute DontDelete
info: >
The length property of encodeURIComponent does not have the attribute
DontDelete
es5id: 15.1.3.4_A5.2
description: Checking use hasOwnProperty, delete
includes: [$FAIL.js]
@ -16,8 +18,8 @@ if (encodeURIComponent.hasOwnProperty('length') !== true) {
delete encodeURIComponent.length;
//CHECK#2
if (encodeURIComponent.hasOwnProperty('length') !== true) {
$ERROR('#2: delete encodeURIComponent.length; encodeURIComponent.hasOwnProperty(\'length\') === true. Actual: ' + (encodeURIComponent.hasOwnProperty('length')));
if (encodeURIComponent.hasOwnProperty('length') !== false) {
$ERROR('#2: delete encodeURIComponent.length; encodeURIComponent.hasOwnProperty(\'length\') === false. Actual: ' + (encodeURIComponent.hasOwnProperty('length')));
}
//CHECK#3

View File

@ -2,7 +2,9 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: The RegExp.prototype.exec.length property has the attribute DontDelete
info: >
The RegExp.prototype.exec.length property does not have the attribute
DontDelete
es5id: 15.10.6.2_A9
description: >
Checking if deleting the RegExp.prototype.exec.length property
@ -16,11 +18,11 @@ if ((RegExp.prototype.exec.hasOwnProperty('length') !== true)) {
}
//CHECK#1
if (delete RegExp.prototype.exec.length !== false) {
$ERROR('#1: delete RegExp.prototype.exec.length === false');
if (delete RegExp.prototype.exec.length !== true) {
$ERROR('#1: delete RegExp.prototype.exec.length === true');
}
//CHECK#2
if (RegExp.prototype.exec.hasOwnProperty('length') !== true) {
$ERROR('#2: delete RegExp.prototype.exec.length; RegExp.prototype.exec.hasOwnProperty(\'length\') === true');
if (RegExp.prototype.exec.hasOwnProperty('length') !== false) {
$ERROR('#2: delete RegExp.prototype.exec.length; RegExp.prototype.exec.hasOwnProperty(\'length\') === false');
}

View File

@ -2,7 +2,9 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: The RegExp.prototype.test.length property has the attribute DontDelete
info: >
The RegExp.prototype.test.length property does not have the attribute
DontDelete
es5id: 15.10.6.3_A9
description: Checking if deleting RegExp.prototype.test.length property fails
includes: [$FAIL.js]
@ -14,11 +16,11 @@ if ((RegExp.prototype.exec.hasOwnProperty('length') !== true)) {
}
//CHECK#1
if (delete RegExp.prototype.exec.length !== false) {
$ERROR('#1: delete RegExp.prototype.exec.length === false');
if (delete RegExp.prototype.exec.length !== true) {
$ERROR('#1: delete RegExp.prototype.exec.length === true');
}
//CHECK#2
if (RegExp.prototype.exec.hasOwnProperty('length') !== true) {
$ERROR('#2: delete RegExp.prototype.exec.length; RegExp.prototype.exec.hasOwnProperty(\'length\') === true');
if (RegExp.prototype.exec.hasOwnProperty('length') !== false) {
$ERROR('#2: delete RegExp.prototype.exec.length; RegExp.prototype.exec.hasOwnProperty(\'length\') === false');
}

View File

@ -2,7 +2,9 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: The RegExp.prototype.toString.length property has the attribute DontDelete
info: >
The RegExp.prototype.toString.length property does not have the attribute
DontDelete
es5id: 15.10.6.4_A9
description: >
Checking if deleting the RegExp.prototype.toString.length property
@ -16,11 +18,11 @@ if ((RegExp.prototype.toString.hasOwnProperty('length') !== true)) {
}
//CHECK#1
if (delete RegExp.prototype.toString.length !== false) {
$ERROR('#1: delete RegExp.prototype.toString.length === false');
if (delete RegExp.prototype.toString.length !== true) {
$ERROR('#1: delete RegExp.prototype.toString.length === true');
}
//CHECK#2
if (RegExp.prototype.toString.hasOwnProperty('length') !== true) {
$ERROR('#2: delete RegExp.prototype.toString.length; RegExp.prototype.toString.hasOwnProperty(\'length\') === true');
if (RegExp.prototype.toString.hasOwnProperty('length') !== false) {
$ERROR('#2: delete RegExp.prototype.toString.length; RegExp.prototype.toString.hasOwnProperty(\'length\') === false');
}

View File

@ -6,12 +6,12 @@
/*---
es5id: 15.10.6
description: RegExp.prototype is itself a RegExp
description: RegExp.prototype is itself a not RegExp
includes: [runTestCase.js]
---*/
function testcase() {
var s = Object.prototype.toString.call(RegExp.prototype);
return s === '[object RegExp]';
return s === '[object Object]';
}
runTestCase(testcase);

View File

@ -6,11 +6,18 @@
/*---
es5id: 15.10.7.1-1
description: RegExp.prototype.source is of type String
description: RegExp.prototype.source is a non-generic accessor property
includes: [runTestCase.js]
---*/
function testcase() {
return (typeof(RegExp.prototype.source)) === 'string';
}
try {
RegExp.prototype.source;
} catch (e) {
if (e instanceof TypeError) {
return true;
}
}
return false;
}
runTestCase(testcase);

View File

@ -7,17 +7,18 @@
/*---
es5id: 15.10.7.1-2
description: >
RegExp.prototype.source is a data property with default attribute
values (false)
RegExp.prototype.source is an accessor property whose set accessor
function is undefined
includes: [runTestCase.js]
---*/
function testcase() {
var d = Object.getOwnPropertyDescriptor(RegExp.prototype, 'source');
if (d.writable === false &&
if (typeof d.get === 'function' &&
d.set === undefined &&
d.enumerable === false &&
d.configurable === false) {
d.configurable === true) {
return true;
}
}

View File

@ -2,24 +2,25 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: The RegExp instance source property has the attribute ReadOnly
info: The RegExp.prototype source property does not have a set accessor
es5id: 15.10.7.1_A10
description: Checking if varying the source property fails
includes: [$FAIL.js]
---*/
__re = /./;
__re = RegExp.prototype;
//CHECK#1
if (__re.hasOwnProperty('source') !== true) {
$FAIL('#1: __re = /./; __re.hasOwnProperty(\'source\') === true');
$FAIL('#1: __re = RegExp.prototype; __re.hasOwnProperty(\'source\') === true');
}
__obj = __re.source;
__sample = /./;
__obj = __sample.source;
__re.source = "shifted";
__sample.source = "shifted";
//CHECK#2
if (__re.source !== __obj) {
$ERROR('#2: __re = /./; __obj = __re.source; __re.source = "shifted"; __re.source === __obj. Actual: ' + (__re.source));
if (__sample.source !== __obj) {
$ERROR('#2: __sample = /./; __obj = __sample.source; __sample.source = "shifted"; __sample.source === __obj. Actual: ' + (__sample.source));
}

View File

@ -2,24 +2,24 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: The RegExp instance source property has the attribute DontEnum
info: The RegExp.prototype source property has the attribute DontEnum
es5id: 15.10.7.1_A8
description: >
Checking if enumerating the source property of RegExp instance
Checking if enumerating the source property of RegExp.prototype
fails
includes: [$FAIL.js]
---*/
__re = new RegExp("[1-2]","i");
__re = RegExp.prototype;
//CHECK#0
if (__re.hasOwnProperty('source') !== true) {
$FAIL('#0: __re = new RegExp("[1-2]","i"); __re.hasOwnProperty(\'source\') === true');
$FAIL('#0: __re = RegExp.prototype; __re.hasOwnProperty(\'source\') === true');
}
//CHECK#1
if (__re.propertyIsEnumerable('source') !== false) {
$ERROR('#1: __re = new RegExp("[1-2]","i"); __re.propertyIsEnumerable(\'source\') === false');
$ERROR('#1: __re = RegExp.prototype; __re.propertyIsEnumerable(\'source\') === false');
}
//CHECK#2
@ -29,5 +29,5 @@ for (p in __re){
}
if (count !== 0) {
$ERROR('#2: count = 0; __re = new RegExp("[1-2]","i"); for (p in __re){ if (p==="source") count++; } count === 0. Actual: ' + (count));
$ERROR('#2: count = 0; __re = RegExp.prototype; for (p in __re){ if (p==="source") count++; } count === 0. Actual: ' + (count));
}

View File

@ -2,25 +2,27 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: The RegExp instance source property has the attribute DontDelete
info: >
The RegExp.prototype source property does not have the attribute
DontDelete
es5id: 15.10.7.1_A9
description: Checking if deleting the source property fails
description: Checking if deleting the source property succeeds
includes: [$FAIL.js]
---*/
__re = new RegExp;
__re = RegExp.prototype;
//CHECK#0
if (__re.hasOwnProperty('source') !== true) {
$FAIL('#0: __re = new RegExp; __re.hasOwnProperty(\'source\') === true');
$FAIL('#0: __re = RegExp.prototype; __re.hasOwnProperty(\'source\') === true');
}
//CHECK#1
if ((delete __re.source) !== false) {
$ERROR('#1: __re = new RegExp; (delete __re.source) === false');
if ((delete __re.source) !== true) {
$ERROR('#1: __re = RegExp.prototype; (delete __re.source) === true');
}
//CHECK#2
if (__re.hasOwnProperty('source') !== true) {
$ERROR('#2: __re = new RegExp;delete __re.source === true; __re.hasOwnProperty(\'source\') === true');
if (__re.hasOwnProperty('source') !== false) {
$ERROR('#2: __re = RegExp.prototype;delete __re.source === true; __re.hasOwnProperty(\'source\') === false');
}

View File

@ -6,11 +6,18 @@
/*---
es5id: 15.10.7.2-1
description: RegExp.prototype.global is of type Boolean
description: RegExp.prototype.global is a non-generic accessor property
includes: [runTestCase.js]
---*/
function testcase() {
return (typeof(RegExp.prototype.global)) === 'boolean';
}
try {
RegExp.prototype.global;
} catch (e) {
if (e instanceof TypeError) {
return true;
}
}
return false;
}
runTestCase(testcase);

View File

@ -7,17 +7,18 @@
/*---
es5id: 15.10.7.2-2
description: >
RegExp.prototype.global is a data property with default attribute
values (false)
RegExp.prototype.global is an accessor property whose set accessor
function is undefined
includes: [runTestCase.js]
---*/
function testcase() {
var desc = Object.getOwnPropertyDescriptor(RegExp.prototype, 'global');
if (desc.writable === false &&
if (typeof desc.get === 'function' &&
desc.set === undefined &&
desc.enumerable === false &&
desc.configurable === false) {
desc.configurable === true) {
return true;
}
}

View File

@ -2,24 +2,25 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: The RegExp instance global property has the attribute ReadOnly
info: The RegExp.prototype global property does not have a set accessor
es5id: 15.10.7.2_A10
description: Checking if varying the global property fails
includes: [$FAIL.js]
---*/
__re = /^|^/;
__re = RegExp.prototype;
//CHECK#1
if (__re.hasOwnProperty('global') !== true) {
$FAIL('#1: __re = /^|^/; __re.hasOwnProperty(\'global\') === true');
$FAIL('#1: __re = RegExp.prototype; __re.hasOwnProperty(\'global\') === true');
}
__obj = __re.global;
__sample = /^|^/;
__obj = __sample.global;
__re.global = "shifted";
__sample.global = "shifted";
//CHECK#2
if (__re.global !== __obj) {
$ERROR('#2: __re = /^|^/; __obj = __re.global; __re.global = "shifted"; __re.global === __obj. Actual: ' + (__re.global));
if (__sample.global !== __obj) {
$ERROR('#2: __sample = /^|^/; __obj = __sample.global; __sample.global = "shifted"; __sample.global === __obj. Actual: ' + (__sample.global));
}

View File

@ -2,24 +2,24 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: The RegExp instance global property has the attribute DontEnum
info: The RegExp.prototype global property has the attribute DontEnum
es5id: 15.10.7.2_A8
description: >
Checking if enumerating the global property of RegExp instance
Checking if enumerating the global property of RegExp.prototype
fails
includes: [$FAIL.js]
---*/
__re = new RegExp("[o-o]","m");
__re = RegExp.prototype;
//CHECK#0
if (__re.hasOwnProperty('global') !== true) {
$FAIL('#0: __re = new RegExp("[o-o]","m"); __re.hasOwnProperty(\'global\') === true');
$FAIL('#0: __re = RegExp.prototype; __re.hasOwnProperty(\'global\') === true');
}
//CHECK#1
if (__re.propertyIsEnumerable('global') !== false) {
$ERROR('#1: __re = new RegExp("[o-o]","m"); __re.propertyIsEnumerable(\'global\') === false');
$ERROR('#1: __re = RegExp.prototype; __re.propertyIsEnumerable(\'global\') === false');
}
//CHECK#2
@ -29,5 +29,5 @@ for (p in __re){
}
if (count !== 0) {
$ERROR('#2: count = 0; __re = new RegExp("[o-o]","m"); for (p in __re){ if (p==="global") count++; } count === 0. Actual: ' + (count));
$ERROR('#2: count = 0; __re = RegExp.prototype; for (p in __re){ if (p==="global") count++; } count === 0. Actual: ' + (count));
}

View File

@ -2,25 +2,27 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: The RegExp instance global property has the attribute DontDelete
info: >
The RegExp.prototype global property does not have the attribute
DontDelete
es5id: 15.10.7.2_A9
description: Checking if deleting the global property fails
description: Checking if deleting the global property succeeds
includes: [$FAIL.js]
---*/
__re = new RegExp;
__re = RegExp.prototype;
//CHECK#0
if (__re.hasOwnProperty('global') !== true) {
$FAIL('#0: __re = new RegExp; __re.hasOwnProperty(\'global\') === true');
$FAIL('#0: __re = RegExp.prototype; __re.hasOwnProperty(\'global\') === true');
}
//CHECK#1
if ((delete __re.global) !== false) {
$ERROR('#1: __re = new RegExp; (delete __re.global) === false');
if ((delete __re.global) !== true) {
$ERROR('#1: __re = RegExp.prototype; (delete __re.global) === true');
}
//CHECK#2
if (__re.hasOwnProperty('global') !== true) {
$ERROR('#2: __re = new RegExp;delete __re.global === true; __re.hasOwnProperty(\'global\') === true');
if (__re.hasOwnProperty('global') !== false) {
$ERROR('#2: __re = RegExp.prototype;delete __re.global === true; __re.hasOwnProperty(\'global\') === false');
}

View File

@ -6,11 +6,18 @@
/*---
es5id: 15.10.7.3-1
description: RegExp.prototype.ignoreCase is of type Boolean
description: RegExp.prototype.ignoreCase is a non-generic accessor property
includes: [runTestCase.js]
---*/
function testcase() {
return (typeof(RegExp.prototype.ignoreCase)) === 'boolean';
}
try {
RegExp.prototype.ignoreCase;
} catch (e) {
if (e instanceof TypeError) {
return true;
}
}
return false;
}
runTestCase(testcase);

View File

@ -7,17 +7,18 @@
/*---
es5id: 15.10.7.3-2
description: >
RegExp.prototype.ignoreCase is a data property with default
attribute values (false)
RegExp.prototype.ignoreCase is an accessor property whose set
accessor function is undefined
includes: [runTestCase.js]
---*/
function testcase() {
var d = Object.getOwnPropertyDescriptor(RegExp.prototype, 'ignoreCase');
if (d.writable === false &&
if (typeof d.get === 'function' &&
d.set === undefined &&
d.enumerable === false &&
d.configurable === false) {
d.configurable === true) {
return true;
}
}

View File

@ -2,24 +2,25 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: The RegExp instance ignoreCase property has the attribute ReadOnly
info: The RegExp.prototype ignoreCase property does not have a set accessor
es5id: 15.10.7.3_A10
description: Checking if varying the ignoreCase property fails
includes: [$FAIL.js]
---*/
__re = /a|b|c/;
__re = RegExp.prototype;
//CHECK#1
if (__re.hasOwnProperty('ignoreCase') !== true) {
$FAIL('#1: __re = /a|b|c/; __re.hasOwnProperty(\'ignoreCase\') === true');
$FAIL('#1: __re = RegExp.prototype; __re.hasOwnProperty(\'ignoreCase\') === true');
}
__obj = __re.ignoreCase;
__sample = /a|b|c/;
__obj = __sample.ignoreCase;
__re.ignoreCase = "shifted";
__sample.ignoreCase = "shifted";
//CHECK#2
if (__re.ignoreCase !== __obj) {
$ERROR('#2: __re = /a|b|c/; __obj = __re.ignoreCase; __re.ignoreCase = "shifted"; __re.ignoreCase === __obj. Actual: ' + (__re.ignoreCase));
if (__sample.ignoreCase !== __obj) {
$ERROR('#2: __sample = /a|b|c/; __obj = __sample.ignoreCase; __sample.ignoreCase = "shifted"; __sample.ignoreCase === __obj. Actual: ' + (__sample.ignoreCase));
}

View File

@ -2,24 +2,24 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: The RegExp instance ignoreCase property has the attribute DontEnum
info: The RegExp.prototype ignoreCase property has the attribute DontEnum
es5id: 15.10.7.3_A8
description: >
Checking if enumerating the ignoreCase property of RegExp instance
fails
Checking if enumerating the ignoreCase property of
RegExp.prototype fails
includes: [$FAIL.js]
---*/
__re = new RegExp("[|||||||]","");
__re = RegExp.prototype;
//CHECK#0
if (__re.hasOwnProperty('ignoreCase') !== true) {
$FAIL('#0: __re = new RegExp("[|||||||]",""); __re.hasOwnProperty(\'ignoreCase\') === true');
$FAIL('#0: __re = RegExp.prototype; __re.hasOwnProperty(\'ignoreCase\') === true');
}
//CHECK#1
if (__re.propertyIsEnumerable('ignoreCase') !== false) {
$ERROR('#1: __re = new RegExp("[|||||||]",""); __re.propertyIsEnumerable(\'ignoreCase\') === false');
$ERROR('#1: __re = RegExp.prototype; __re.propertyIsEnumerable(\'ignoreCase\') === false');
}
//CHECK#2
@ -29,5 +29,5 @@ for (p in __re){
}
if (count !== 0) {
$ERROR('#2: count = 0; __re = new RegExp("[|||||||]",""); for (p in __re){ if (p==="ignoreCase") count++; } count === 0. Actual: ' + (count));
$ERROR('#2: count = 0; __re = RegExp.prototype; for (p in __re){ if (p==="ignoreCase") count++; } count === 0. Actual: ' + (count));
}

View File

@ -2,25 +2,27 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: The RegExp instance ignoreCase property has the attribute DontDelete
info: >
The RegExp.prototype ignoreCase property does not have the attribute
DontDelete
es5id: 15.10.7.3_A9
description: Checking if deleting the ignoreCase property fails
description: Checking if deleting the ignoreCase property succeeds
includes: [$FAIL.js]
---*/
__re = new RegExp;
__re = RegExp.prototype;
//CHECK#0
if (__re.hasOwnProperty('ignoreCase') !== true) {
$FAIL('#0: __re = new RegExp; __re.hasOwnProperty(\'ignoreCase\') === true');
$FAIL('#0: __re = RegExp.prototype; __re.hasOwnProperty(\'ignoreCase\') === true');
}
//CHECK#1
if ((delete __re.ignoreCase) !== false) {
$ERROR('#1: __re = new RegExp; (delete __re.ignoreCase) === false');
if ((delete __re.ignoreCase) !== true) {
$ERROR('#1: __re = RegExp.prototype; (delete __re.ignoreCase) === true');
}
//CHECK#2
if (__re.hasOwnProperty('ignoreCase') !== true) {
$ERROR('#2: __re = new RegExp;delete __re.ignoreCase === true; __re.hasOwnProperty(\'ignoreCase\') === true');
if (__re.hasOwnProperty('ignoreCase') !== false) {
$ERROR('#2: __re = RegExp.prototype;delete __re.ignoreCase === true; __re.hasOwnProperty(\'ignoreCase\') === false');
}

View File

@ -6,11 +6,18 @@
/*---
es5id: 15.10.7.4-1
description: RegExp.prototype.multiline is of type Boolean
description: RegExp.prototype.multiline is a non-generic accessor property
includes: [runTestCase.js]
---*/
function testcase() {
return (typeof(RegExp.prototype.multiline)) === 'boolean';
}
try {
RegExp.prototype.multiline;
} catch (e) {
if (e instanceof TypeError) {
return true;
}
}
return false;
}
runTestCase(testcase);

View File

@ -7,17 +7,18 @@
/*---
es5id: 15.10.7.4-2
description: >
RegExp.prototype.multiline is a data property with default
attribute values (false)
RegExp.prototype.multiline is an accessor property whose set
accessor function is undefined
includes: [runTestCase.js]
---*/
function testcase() {
var d = Object.getOwnPropertyDescriptor(RegExp.prototype, 'multiline');
if (d.writable === false &&
if (typeof d.get === 'function' &&
d.set === undefined &&
d.enumerable === false &&
d.configurable === false) {
d.configurable === true) {
return true;
}
}

View File

@ -2,24 +2,25 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: The RegExp instance multiline property has the attribute ReadOnly
info: The RegExp.prototype multiline property does not have a set accessor
es5id: 15.10.7.4_A10
description: Checking if varying the multiline property fails
includes: [$FAIL.js]
---*/
__re = /\n/;
__re = RegExp.prototype;
//CHECK#1
if (__re.hasOwnProperty('multiline') !== true) {
$FAIL('#1: __re = /\\n/; __re.hasOwnProperty(\'multiline\') === true');
$FAIL('#1: __re = RegExp.prototype; __re.hasOwnProperty(\'multiline\') === true');
}
__obj = __re.multiline;
__sample = /\n/;
__obj = __sample.multiline;
__re.multiline = "shifted";
__sample.multiline = "shifted";
//CHECK#2
if (__re.multiline !== __obj) {
$ERROR('#2: __re = /\\n/; __obj = __re.multiline; __re.multiline = "shifted"; __re.multiline === __obj. Actual: ' + (__re.multiline));
if (__sample.multiline !== __obj) {
$ERROR('#2: __sample = /\n/; __obj = __sample.multiline; __sample.multiline = "shifted"; __sample.multiline === __obj. Actual: ' + (__sample.multiline));
}

View File

@ -2,24 +2,24 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: The RegExp instance multiline property has the attribute DontEnum
info: The RegExp.prototype multiline property has the attribute DontEnum
es5id: 15.10.7.4_A8
description: >
Checking if enumerating the multiline property of RegExp instance
Checking if enumerating the multiline property of RegExp.prototype
fails
includes: [$FAIL.js]
---*/
__re = new RegExp("[\u0041-\u0049]");
__re = RegExp.prototype;
//CHECK#0
if (__re.hasOwnProperty('multiline') !== true) {
$FAIL('#0: __re = new RegExp("[\\u0041-\\u0049]"); __re.hasOwnProperty(\'multiline\') === true');
$FAIL('#0: __re = RegExp.prototype; __re.hasOwnProperty(\'multiline\') === true');
}
//CHECK#1
if (__re.propertyIsEnumerable('multiline') !== false) {
$ERROR('#1: __re = new RegExp("[\\u0041-\\u0049]"); __re.propertyIsEnumerable(\'multiline\') === false');
$ERROR('#1: __re = RegExp.prototype; __re.propertyIsEnumerable(\'multiline\') === false');
}
//CHECK#2
@ -29,5 +29,5 @@ for (p in __re){
}
if (count !== 0) {
$ERROR('#2: count = 0; __re = new RegExp("[\\u0041-\\u0049]"); for (p in __re){ if (p==="multiline") count++; } count === 0. Actual: ' + (count));
$ERROR('#2: count = 0; __re = RegExp.prototype; for (p in __re){ if (p==="multiline") count++; } count === 0. Actual: ' + (count));
}

View File

@ -2,25 +2,27 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: The RegExp instance multiline property has the attribute DontDelete
info: >
The RegExp.prototype multiline property does not have the attribute
DontDelete
es5id: 15.10.7.4_A9
description: Checking if deleting the multiline property fails
description: Checking if deleting the multiline property succeeds
includes: [$FAIL.js]
---*/
__re = new RegExp;
__re = RegExp.prototype;
//CHECK#0
if (__re.hasOwnProperty('multiline') !== true) {
$FAIL('#0: __re = new RegExp; __re.hasOwnProperty(\'multiline\') === true');
$FAIL('#0: __re = RegExp.prototype; __re.hasOwnProperty(\'multiline\') === true');
}
//CHECK#1
if ((delete __re.multiline) !== false) {
$ERROR('#1: __re = new RegExp; (delete __re.multiline) === false');
if ((delete __re.multiline) !== true) {
$ERROR('#1: __re = RegExp.prototype; (delete __re.multiline) === true');
}
//CHECK#2
if (__re.hasOwnProperty('multiline') !== true) {
$ERROR('#2: __re = new RegExp;delete __re.multiline === true; __re.hasOwnProperty(\'multiline\') === true');
if (__re.hasOwnProperty('multiline') !== false) {
$ERROR('#2: __re = RegExp.prototype;delete __re.multiline === true; __re.hasOwnProperty(\'multiline\') === false');
}

View File

@ -6,11 +6,11 @@
/*---
es5id: 15.10.7.5-1
description: RegExp.prototype.lastIndex is of type Number
description: RegExp.prototype.lastIndex is of type Undefined
includes: [runTestCase.js]
---*/
function testcase() {
return (typeof(RegExp.prototype.lastIndex)) === 'number';
return (typeof(RegExp.prototype.lastIndex)) === 'undefined';
}
runTestCase(testcase);

View File

@ -6,19 +6,12 @@
/*---
es5id: 15.10.7.5-2
description: >
RegExp.prototype.lastIndex is a data property with specified
attribute values
description: RegExp.prototype.lastIndex is not present
includes: [runTestCase.js]
---*/
function testcase() {
var d = Object.getOwnPropertyDescriptor(RegExp.prototype, 'lastIndex');
if (d.writable === true &&
d.enumerable === false &&
d.configurable === false) {
return true;
}
return d === undefined;
}
runTestCase(testcase);

View File

@ -4,7 +4,7 @@
/*---
info: >
The value of the internal [[Class]] property of Error prototype object is
"Error"
"Object"
es5id: 15.11.4_A2
description: >
Getting the value of the internal [[Class]] property using
@ -16,8 +16,8 @@ __tostr = Error.prototype.toString();
//////////////////////////////////////////////////////////////////////////////
//CHECK#1
if (__tostr !== "[object Error]") {
$ERROR('#1: Error.prototype.toString=Object.prototype.toString; __tostr = Error.prototype.toString(); __tostr === "[object Error]". Actual: '+__tostr );
if (__tostr !== "[object Object]") {
$ERROR('#1: Error.prototype.toString=Object.prototype.toString; __tostr = Error.prototype.toString(); __tostr === "[object Object]". Actual: '+__tostr );
}
//
//////////////////////////////////////////////////////////////////////////////

View File

@ -6,15 +6,14 @@
/*---
es5id: 15.2.3.10-1-1
description: Object.preventExtensions throws TypeError if 'O' is undefined
description: >
Object.preventExtensions does not throw TypeError if 'O' is
undefined
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.preventExtensions(undefined);
} catch (e) {
return (e instanceof TypeError);
}
}
Object.preventExtensions(undefined);
return true;
}
runTestCase(testcase);

View File

@ -6,15 +6,12 @@
/*---
es5id: 15.2.3.10-1-2
description: Object.preventExtensions throws TypeError if 'O' is null
description: Object.preventExtensions does not throw TypeError if 'O' is null
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.preventExtensions(null);
} catch (e) {
return (e instanceof TypeError);
}
}
Object.preventExtensions(null);
return true;
}
runTestCase(testcase);

View File

@ -7,16 +7,13 @@
/*---
es5id: 15.2.3.10-1-3
description: >
Object.preventExtensions throws TypeError if 'O' is a boolean
primitive value
Object.preventExtensions does not throw TypeError if 'O' is a
boolean primitive value
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.preventExtensions(true);
} catch (e) {
return (e instanceof TypeError);
}
}
Object.preventExtensions(true);
return true;
}
runTestCase(testcase);

View File

@ -7,16 +7,13 @@
/*---
es5id: 15.2.3.10-1-4
description: >
Object.preventExtensions throws TypeError if 'O' is a string
primitive value
Object.preventExtensions does not throw TypeError if 'O' is a
string primitive value
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.preventExtensions("abc");
} catch (e) {
return (e instanceof TypeError);
}
}
Object.preventExtensions("abc");
return true;
}
runTestCase(testcase);

View File

@ -7,19 +7,13 @@
/*---
es5id: 15.2.3.10-1
description: >
Object.preventExtensions throws TypeError if type of first param
is not Object
Object.preventExtensions does not throw TypeError if type of first
param is not Object
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.preventExtensions(0);
}
catch (e) {
if (e instanceof TypeError) {
return true;
}
}
}
Object.preventExtensions(0);
return true;
}
runTestCase(testcase);

View File

@ -7,19 +7,13 @@
/*---
es5id: 15.2.3.11-1
description: >
Object.isSealed throws TypeError if type of first param is not
Object
Object.isSealed does not throw TypeError if type of first param is
not Object
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.isSealed(0);
}
catch (e) {
if (e instanceof TypeError) {
return true;
}
}
}
Object.isSealed(0);
return true;
}
runTestCase(testcase);

View File

@ -7,16 +7,13 @@
/*---
es5id: 15.2.3.12-1-1
description: >
Object.isFrozen - TypeError is thrown when the first param 'O' is
undefined
Object.isFrozen - TypeError is not thrown when the first param 'O'
is undefined
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.isFrozen(undefined);
} catch (e) {
return (e instanceof TypeError);
}
}
Object.isFrozen(undefined);
return true;
}
runTestCase(testcase);

View File

@ -7,16 +7,13 @@
/*---
es5id: 15.2.3.12-1-2
description: >
Object.isFrozen - TypeError is thrown when the first param 'O' is
null
Object.isFrozen - TypeError is not thrown when the first param 'O'
is null
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.isFrozen(null);
} catch (e) {
return (e instanceof TypeError);
}
}
Object.isFrozen(null);
return true;
}
runTestCase(testcase);

View File

@ -7,16 +7,13 @@
/*---
es5id: 15.2.3.12-1-3
description: >
Object.isFrozen - TypeError is thrown when the first param 'O' is
a boolean
Object.isFrozen - TypeError is not thrown when the first param 'O'
is a boolean
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.isFrozen(true);
} catch (e) {
return (e instanceof TypeError);
}
}
Object.isFrozen(true);
return true;
}
runTestCase(testcase);

View File

@ -7,16 +7,13 @@
/*---
es5id: 15.2.3.12-1-4
description: >
Object.isFrozen - TypeError is thrown when the first param 'O' is
a string
Object.isFrozen - TypeError is not thrown when the first param 'O'
is a string
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.isFrozen("abc");
} catch (e) {
return (e instanceof TypeError);
}
}
Object.isFrozen("abc");
return true;
}
runTestCase(testcase);

View File

@ -7,19 +7,13 @@
/*---
es5id: 15.2.3.12-1
description: >
Object.isFrozen throws TypeError if type of first param is not
Object
Object.isFrozen does not throw TypeError if type of first param is
not Object
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.isFrozen(0);
}
catch (e) {
if (e instanceof TypeError) {
return true;
}
}
}
Object.isFrozen(0);
return true;
}
runTestCase(testcase);

View File

@ -6,16 +6,12 @@
/*---
es5id: 15.2.3.13-1-1
description: Object.isExtensible throws TypeError if 'O' is undefined
description: Object.isExtensible does not throw TypeError if 'O' is undefined
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.isExtensible(undefined);
} catch (e) {
return (e instanceof TypeError);
}
}
Object.isExtensible(undefined);
return true;
}
runTestCase(testcase);

View File

@ -6,16 +6,12 @@
/*---
es5id: 15.2.3.13-1-2
description: Object.isExtensible throws TypeError if 'O' is null
description: Object.isExtensible does not throw TypeError if 'O' is null
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.isExtensible(null);
} catch (e) {
return (e instanceof TypeError);
}
}
Object.isExtensible(null);
return true;
}
runTestCase(testcase);

View File

@ -6,16 +6,12 @@
/*---
es5id: 15.2.3.13-1-3
description: Object.isExtensible throws TypeError if 'O' is a boolean
description: Object.isExtensible does not throw TypeError if 'O' is a boolean
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.isExtensible(true);
} catch (e) {
return (e instanceof TypeError);
}
}
Object.isExtensible(true);
return true;
}
runTestCase(testcase);

View File

@ -6,16 +6,12 @@
/*---
es5id: 15.2.3.13-1-4
description: Object.isExtensible throws TypeError if 'O' is a string
description: Object.isExtensible does not throw TypeError if 'O' is a string
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.isExtensible("abc");
} catch (e) {
return (e instanceof TypeError);
}
}
Object.isExtensible("abc");
return true;
}
runTestCase(testcase);

View File

@ -7,19 +7,13 @@
/*---
es5id: 15.2.3.13-1
description: >
Object.isExtensible throws TypeError if type of first param is not
Object
Object.isExtensible does not throw TypeError if type of first
param is not Object
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.isExtensible(0);
}
catch (e) {
if (e instanceof TypeError) {
return true;
}
}
}
Object.isExtensible(0);
return true;
}
runTestCase(testcase);

View File

@ -6,18 +6,14 @@
/*---
es5id: 15.2.3.14-1-1
description: Object.keys throws TypeError if type of first param is not Object
description: >
Object.keys does not throw TypeError if type of first param is not
Object
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.keys(0);
}
catch (e) {
if (e instanceof TypeError) {
return true;
}
}
}
return true;
}
runTestCase(testcase);

View File

@ -7,19 +7,13 @@
/*---
es5id: 15.2.3.14-1-2
description: >
Object.keys throws TypeError if type of first param is not Object
(boolean)
Object.keys does not throw TypeError if type of first param is not
Object (boolean)
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.keys(true);
}
catch (e) {
if (e instanceof TypeError) {
return true;
}
}
}
return true;
}
runTestCase(testcase);

View File

@ -7,19 +7,13 @@
/*---
es5id: 15.2.3.14-1-3
description: >
Object.keys throws TypeError if type of first param is not Object
(string)
Object.keys does not throw TypeError if type of first param is not
Object (string)
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.keys('abc');
}
catch (e) {
if (e instanceof TypeError) {
return true;
}
}
}
return true;
}
runTestCase(testcase);

View File

@ -6,16 +6,11 @@
/*---
es5id: 15.2.3.2-1-3
description: Object.getPrototypeOf throws TypeError if 'O' is a boolean
description: Object.getPrototypeOf returns Boolean.prototype if 'O' is a boolean
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.getPrototypeOf(true);
return false;
} catch (e) {
return (e instanceof TypeError);
}
}
return Object.getPrototypeOf(true) === Boolean.prototype;
}
runTestCase(testcase);

View File

@ -6,16 +6,11 @@
/*---
es5id: 15.2.3.2-1-4
description: Object.getPrototypeOf throws TypeError if 'O' is a string
description: Object.getPrototypeOf returns String.prototype if 'O' is a string
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.getPrototypeOf("abc");
return false;
} catch (e) {
return (e instanceof TypeError);
}
}
return Object.getPrototypeOf("abc") === String.prototype;
}
runTestCase(testcase);

View File

@ -6,20 +6,11 @@
/*---
es5id: 15.2.3.2-1
description: >
Object.getPrototypeOf throws TypeError if type of first param is
not Object
description: Object.getPrototypeOf returns Number.prototype if 'O' is a number
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.getPrototypeOf(0);
}
catch (e) {
if (e instanceof TypeError) {
return true;
}
}
}
return Object.getPrototypeOf(0) === Number.prototype;
}
runTestCase(testcase);

View File

@ -13,7 +13,7 @@ includes: [runTestCase.js]
---*/
function testcase() {
if (Object.getPrototypeOf(EvalError) === Function.prototype) {
if (Object.getPrototypeOf(EvalError) === Error) {
return true;
}
}

View File

@ -13,7 +13,7 @@ includes: [runTestCase.js]
---*/
function testcase() {
if (Object.getPrototypeOf(RangeError) === Function.prototype) {
if (Object.getPrototypeOf(RangeError) === Error) {
return true;
}
}

View File

@ -13,7 +13,7 @@ includes: [runTestCase.js]
---*/
function testcase() {
if (Object.getPrototypeOf(ReferenceError) === Function.prototype) {
if (Object.getPrototypeOf(ReferenceError) === Error) {
return true;
}
}

View File

@ -13,7 +13,7 @@ includes: [runTestCase.js]
---*/
function testcase() {
if (Object.getPrototypeOf(SyntaxError) === Function.prototype) {
if (Object.getPrototypeOf(SyntaxError) === Error) {
return true;
}
}

View File

@ -13,7 +13,7 @@ includes: [runTestCase.js]
---*/
function testcase() {
if (Object.getPrototypeOf(TypeError) === Function.prototype) {
if (Object.getPrototypeOf(TypeError) === Error) {
return true;
}
}

View File

@ -13,7 +13,7 @@ includes: [runTestCase.js]
---*/
function testcase() {
if (Object.getPrototypeOf(URIError) === Function.prototype) {
if (Object.getPrototypeOf(URIError) === Error) {
return true;
}
}

View File

@ -7,16 +7,13 @@
/*---
es5id: 15.2.3.3-1-3
description: >
Object.getOwnPropertyDescriptor - TypeError is thrown when first
param is a boolean
Object.getOwnPropertyDescriptor - TypeError is not thrown when
first param is a boolean
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.getOwnPropertyDescriptor(true, "foo");
} catch (e) {
return (e instanceof TypeError);
}
}
Object.getOwnPropertyDescriptor(true, "foo");
return true;
}
runTestCase(testcase);

View File

@ -7,16 +7,13 @@
/*---
es5id: 15.2.3.3-1-4
description: >
Object.getOwnPropertyDescriptor - TypeError is thrown when first
param is a number
Object.getOwnPropertyDescriptor - TypeError is not thrown when
first param is a number
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.getOwnPropertyDescriptor(-2, "foo");
} catch (e) {
return (e instanceof TypeError);
}
}
Object.getOwnPropertyDescriptor(-2, "foo");
return true;
}
runTestCase(testcase);

View File

@ -7,19 +7,13 @@
/*---
es5id: 15.2.3.3-1
description: >
Object.getOwnPropertyDescriptor throws TypeError if type of first
param is not Object
Object.getOwnPropertyDescriptor does not throw TypeError if type
of first param is not Object
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.getOwnPropertyDescriptor(0, "foo");
}
catch (e) {
if (e instanceof TypeError) {
return true;
}
}
}
return true;
}
runTestCase(testcase);

View File

@ -7,8 +7,8 @@
/*---
es5id: 15.2.3.3-4-186
description: >
Object.getOwnPropertyDescriptor returns data desc (all false) for
properties on built-ins (Function.length)
Object.getOwnPropertyDescriptor returns data desc for properties
on built-ins (Function.length)
includes: [runTestCase.js]
---*/
@ -17,7 +17,7 @@ function testcase() {
if (desc.writable === false &&
desc.enumerable === false &&
desc.configurable === false &&
desc.configurable === true &&
desc.hasOwnProperty('get') === false &&
desc.hasOwnProperty('set') === false) {
return true;

View File

@ -7,8 +7,8 @@
/*---
es5id: 15.2.3.3-4-187
description: >
Object.getOwnPropertyDescriptor returns data desc (all false) for
properties on built-ins (Function (instance).length)
Object.getOwnPropertyDescriptor returns data desc for properties
on built-ins (Function (instance).length)
includes: [runTestCase.js]
---*/
@ -19,7 +19,7 @@ function testcase() {
if (desc.writable === false &&
desc.enumerable === false &&
desc.configurable === false &&
desc.configurable === true &&
desc.hasOwnProperty('get') === false &&
desc.hasOwnProperty('set') === false) {
return true;

View File

@ -7,8 +7,8 @@
/*---
es5id: 15.2.3.3-4-191
description: >
Object.getOwnPropertyDescriptor returns data desc (all false) for
properties on built-ins (String.length)
Object.getOwnPropertyDescriptor returns data desc for properties
on built-ins (String.length)
includes: [runTestCase.js]
---*/
@ -17,7 +17,7 @@ function testcase() {
if (desc.writable === false &&
desc.enumerable === false &&
desc.configurable === false &&
desc.configurable === true &&
desc.hasOwnProperty('get') === false &&
desc.hasOwnProperty('set') === false) {
return true;

View File

@ -7,8 +7,8 @@
/*---
es5id: 15.2.3.3-4-194
description: >
Object.getOwnPropertyDescriptor returns data desc (all false) for
properties on built-ins (Boolean.length)
Object.getOwnPropertyDescriptor returns data desc for properties
on built-ins (Boolean.length)
includes: [runTestCase.js]
---*/
@ -17,7 +17,7 @@ function testcase() {
if (desc.writable === false &&
desc.enumerable === false &&
desc.configurable === false &&
desc.configurable === true &&
desc.hasOwnProperty('get') === false &&
desc.hasOwnProperty('set') === false) {
return true;

View File

@ -7,8 +7,8 @@
/*---
es5id: 15.2.3.3-4-201
description: >
Object.getOwnPropertyDescriptor returns data desc (all false) for
properties on built-ins (Number.length)
Object.getOwnPropertyDescriptor returns data desc for properties
on built-ins (Number.length)
includes: [runTestCase.js]
---*/
@ -17,7 +17,7 @@ function testcase() {
if (desc.writable === false &&
desc.enumerable === false &&
desc.configurable === false &&
desc.configurable === true &&
desc.hasOwnProperty('get') === false &&
desc.hasOwnProperty('set') === false) {
return true;

View File

@ -7,19 +7,19 @@
/*---
es5id: 15.2.3.3-4-212
description: >
Object.getOwnPropertyDescriptor returns data desc (all false) for
properties on built-ins (RegExp.prototype.source)
Object.getOwnPropertyDescriptor returns accessor desc for
accessors on built-ins (RegExp.prototype.source)
includes: [runTestCase.js]
---*/
function testcase() {
var desc = Object.getOwnPropertyDescriptor(RegExp.prototype, "source");
if (desc.writable === false &&
if (desc.hasOwnProperty('writable') === false &&
desc.enumerable === false &&
desc.configurable === false &&
desc.hasOwnProperty('get') === false &&
desc.hasOwnProperty('set') === false) {
desc.configurable === true &&
typeof desc.get === 'function' &&
desc.set === undefined) {
return true;
}
}

View File

@ -7,19 +7,19 @@
/*---
es5id: 15.2.3.3-4-213
description: >
Object.getOwnPropertyDescriptor returns data desc (all false) for
properties on built-ins (RegExp.prototype.global)
Object.getOwnPropertyDescriptor returns accessor desc for
accessors on built-ins (RegExp.prototype.global)
includes: [runTestCase.js]
---*/
function testcase() {
var desc = Object.getOwnPropertyDescriptor(RegExp.prototype, "global");
if (desc.writable === false &&
if (desc.hasOwnProperty('writable') === false &&
desc.enumerable === false &&
desc.configurable === false &&
desc.hasOwnProperty('get') === false &&
desc.hasOwnProperty('set') === false) {
desc.configurable === true &&
typeof desc.get === 'function' &&
desc.set === undefined) {
return true;
}
}

View File

@ -7,19 +7,19 @@
/*---
es5id: 15.2.3.3-4-214
description: >
Object.getOwnPropertyDescriptor returns data desc (all false) for
properties on built-ins (RegExp.prototype.ignoreCase)
Object.getOwnPropertyDescriptor returns accessor desc for
accessors on built-ins (RegExp.prototype.ignoreCase)
includes: [runTestCase.js]
---*/
function testcase() {
var desc = Object.getOwnPropertyDescriptor(RegExp.prototype, "ignoreCase");
if (desc.writable === false &&
if (desc.hasOwnProperty('writable') === false &&
desc.enumerable === false &&
desc.configurable === false &&
desc.hasOwnProperty('get') === false &&
desc.hasOwnProperty('set') === false) {
desc.configurable === true &&
typeof desc.get === 'function' &&
desc.set === undefined) {
return true;
}
}

View File

@ -7,19 +7,19 @@
/*---
es5id: 15.2.3.3-4-215
description: >
Object.getOwnPropertyDescriptor returns data desc (all false) for
properties on built-ins (RegExp.prototype.multiline)
Object.getOwnPropertyDescriptor returns accessor desc for
accessors on built-ins (RegExp.prototype.multiline)
includes: [runTestCase.js]
---*/
function testcase() {
var desc = Object.getOwnPropertyDescriptor(RegExp.prototype, "multiline");
if (desc.writable === false &&
if (desc.hasOwnProperty('writable') === false &&
desc.enumerable === false &&
desc.configurable === false &&
desc.hasOwnProperty('get') === false &&
desc.hasOwnProperty('set') === false) {
desc.configurable === true &&
typeof desc.get === 'function' &&
desc.set === undefined) {
return true;
}
}

View File

@ -6,10 +6,14 @@
/*---
es5id: 15.2.3.4-1-4
info: >
ES5 requires a `TypeError` here, while ES6 requires `ToObject` (19.1.2.7, 19.1.2.8.1)
description: Object.getOwnPropertyNames throws TypeError if 'O' is a boolean
negative: TypeError
description: >
Object.getOwnPropertyNames does not throw TypeError if 'O' is a
boolean
includes: [runTestCase.js]
---*/
Object.getOwnPropertyNames(true);
function testcase() {
Object.getOwnPropertyNames(true);
return true;
}
runTestCase(testcase);

View File

@ -6,10 +6,14 @@
/*---
es5id: 15.2.3.4-1-5
info: >
ES5 requires a `TypeError` here, while ES6 requires `ToObject` (19.1.2.7, 19.1.2.8.1)
description: Object.getOwnPropertyNames throws TypeError if 'O' is a string
negative: TypeError
description: >
Object.getOwnPropertyNames does not throw TypeError if 'O' is a
string
includes: [runTestCase.js]
---*/
Object.getOwnPropertyNames("abc");
function testcase() {
Object.getOwnPropertyNames("abc");
return true;
}
runTestCase(testcase);

View File

@ -6,12 +6,14 @@
/*---
es5id: 15.2.3.4-1
info: >
ES5 requires a `TypeError` here, while ES6 requires `ToObject` (19.1.2.7, 19.1.2.8.1)
description: >
Object.getOwnPropertyNames throws TypeError if type of first param
is not Object
negative: TypeError
Object.getOwnPropertyNames does not throw TypeError if type of
first param is not Object
includes: [runTestCase.js]
---*/
Object.getOwnPropertyNames(0);
function testcase() {
Object.getOwnPropertyNames(0);
return true;
}
runTestCase(testcase);

View File

@ -7,9 +7,10 @@
/*---
es5id: 15.2.3.7-6-a-93-3
description: >
Object.defineProperties will fail to update [[Value]] attribute of
named data property 'P' when [[Configurable]] attribute of first
updating property is false (8.12.9 - step Note & 10.a.ii.1)
Object.defineProperties will not fail to update [[Value]]
attribute of named data property 'P' when [[Configurable]]
attribute of first updating property is false (8.12.9 - step Note
& 10.a.ii.1)
includes:
- runTestCase.js
- dataPropertyAttributesAreCorrect.js
@ -45,7 +46,7 @@ function testcase() {
} catch (e) {
return e instanceof TypeError &&
dataPropertyAttributesAreCorrect(obj, "property", 1001, false, false, false) &&
dataPropertyAttributesAreCorrect(obj, "property1", 1003, false, false, true);
dataPropertyAttributesAreCorrect(obj, "property1", 1004, false, false, true);
}
}
runTestCase(testcase);

View File

@ -7,9 +7,10 @@
/*---
es5id: 15.2.3.7-6-a-93-4
description: >
Object.defineProperties will fail to update [[Value]] attribute of
indexed data property 'P' when [[Configurable]] attribute of first
updating property are false (8.12.9 - step Note & 10.a.ii.1)
Object.defineProperties will not fail to update [[Value]]
attribute of indexed data property 'P' when [[Configurable]]
attribute of first updating property are false (8.12.9 - step
Note & 10.a.ii.1)
includes:
- runTestCase.js
- dataPropertyAttributesAreCorrect.js
@ -45,7 +46,7 @@ function testcase() {
} catch (e) {
return e instanceof TypeError &&
dataPropertyAttributesAreCorrect(obj, "0", 1001, false, false, false) &&
dataPropertyAttributesAreCorrect(obj, "1", 1003, false, false, true);
dataPropertyAttributesAreCorrect(obj, "1", 1004, false, false, true);
}
}
runTestCase(testcase);

View File

@ -6,16 +6,14 @@
/*---
es5id: 15.2.3.8-1-1
description: Object.seal throws TypeError if type of first param is undefined
description: >
Object.seal does not throw TypeError if type of first param is
undefined
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.seal(undefined);
return false;
} catch (e) {
return e instanceof TypeError;
}
}
Object.seal(undefined);
return true;
}
runTestCase(testcase);

View File

@ -6,16 +6,12 @@
/*---
es5id: 15.2.3.8-1-2
description: Object.seal throws TypeError if type of first param is null
description: Object.seal does not throw TypeError if type of first param is null
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.seal(null);
return false;
} catch (e) {
return e instanceof TypeError;
}
}
Object.seal(null);
return true;
}
runTestCase(testcase);

View File

@ -7,17 +7,13 @@
/*---
es5id: 15.2.3.8-1-3
description: >
Object.seal throws TypeError if type of first param is a boolean
primitive
Object.seal does not throw TypeError if type of first param is a
boolean primitive
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.seal(false);
return false;
} catch (e) {
return e instanceof TypeError;
}
}
Object.seal(false);
return true;
}
runTestCase(testcase);

View File

@ -7,17 +7,13 @@
/*---
es5id: 15.2.3.8-1-4
description: >
Object.seal throws TypeError if type of first param is a string
primitive
Object.seal does not throw TypeError if type of first param is a
string primitive
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.seal("abc");
return false;
} catch (e) {
return e instanceof TypeError;
}
}
Object.seal("abc");
return true;
}
runTestCase(testcase);

View File

@ -6,18 +6,14 @@
/*---
es5id: 15.2.3.8-1
description: Object.seal throws TypeError if type of first param is not Object
description: >
Object.seal does not throw TypeError if type of first param is not
Object
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.seal(0);
}
catch (e) {
if (e instanceof TypeError) {
return true;
}
}
}
Object.seal(0);
return true;
}
runTestCase(testcase);

View File

@ -6,16 +6,14 @@
/*---
es5id: 15.2.3.9-1-1
description: Object.freeze throws TypeError if type of first param is undefined
description: >
Object.freeze does not throw TypeError if type of first param is
undefined
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.freeze(undefined);
return false;
} catch (e) {
return e instanceof TypeError;
}
}
Object.freeze(undefined);
return true;
}
runTestCase(testcase);

View File

@ -6,16 +6,14 @@
/*---
es5id: 15.2.3.9-1-2
description: Object.freeze throws TypeError if type of first param is null
description: >
Object.freeze does not throw TypeError if type of first param is
null
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.freeze(null);
return false;
} catch (e) {
return e instanceof TypeError;
}
}
Object.freeze(null);
return true;
}
runTestCase(testcase);

View File

@ -7,26 +7,14 @@
/*---
es5id: 15.2.3.9-1-3
description: >
Object.freeze throws TypeError if type of first param is boolean
primitive
Object.freeze does not throw TypeError if type of first param is
boolean primitive
includes: [runTestCase.js]
---*/
function testcase() {
var result = false;
try {
Object.freeze(false);
return false;
} catch (e) {
result = e instanceof TypeError;
}
try {
Object.freeze(true);
return false;
} catch (e) {
return result && e instanceof TypeError;
}
}
Object.freeze(false);
Object.freeze(true);
return true;
}
runTestCase(testcase);

View File

@ -7,17 +7,13 @@
/*---
es5id: 15.2.3.9-1-4
description: >
Object.freeze throws TypeError if type of first param is string
primitive
Object.freeze does not throw TypeError if type of first param is
string primitive
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.freeze("abc");
return false;
} catch (e) {
return e instanceof TypeError;
}
}
Object.freeze("abc");
return true;
}
runTestCase(testcase);

View File

@ -6,16 +6,14 @@
/*---
es5id: 15.2.3.9-1
description: Object.freeze throws TypeError if type of first param is not Object
description: >
Object.freeze does not throw TypeError if type of first param is
not Object
includes: [runTestCase.js]
---*/
function testcase() {
try {
Object.freeze(0);
return false;
} catch (e) {
return e instanceof TypeError;
}
}
Object.freeze(0);
return true;
}
runTestCase(testcase);

View File

@ -2,7 +2,9 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: The Object.prototype.toString.length property has the attribute DontDelete
info: >
The Object.prototype.toString.length property does not have the attribute
DontDelete
es5id: 15.2.4.2_A9
description: >
Checknig if deleting of the Object.prototype.toString.length
@ -17,11 +19,11 @@ if (!(Object.prototype.toString.hasOwnProperty('length'))) {
}
//CHECK#1
if (delete Object.prototype.toString.length) {
$ERROR('#1: The Object.prototype.toString.length property has the attributes DontDelete');
if (!delete Object.prototype.toString.length) {
$ERROR('#1: The Object.prototype.toString.length property does not have the attributes DontDelete');
}
//CHECK#2
if (!(Object.prototype.toString.hasOwnProperty('length'))) {
$FAIL('#2: The Object.prototype.toString.length property has the attributes DontDelete');
if (Object.prototype.toString.hasOwnProperty('length')) {
$FAIL('#2: The Object.prototype.toString.length property does not have the attributes DontDelete');
}

View File

@ -3,8 +3,8 @@
/*---
info: >
The Object.prototype.toLocaleString.length property has the attribute
DontDelete
The Object.prototype.toLocaleString.length property does not have the
attribute DontDelete
es5id: 15.2.4.3_A9
description: >
Checknig if deleting of the Object.prototype.toLocaleString.length
@ -19,11 +19,11 @@ if (!(Object.prototype.toLocaleString.hasOwnProperty('length'))) {
}
//CHECK#1
if (delete Object.prototype.toLocaleString.length) {
$ERROR('#1: The Object.prototype.toLocaleString.length property has the attributes DontDelete');
if (!delete Object.prototype.toLocaleString.length) {
$ERROR('#1: The Object.prototype.toLocaleString.length property does not have the attributes DontDelete');
}
//CHECK#2
if (!(Object.prototype.toLocaleString.hasOwnProperty('length'))) {
$FAIL('#2: The Object.prototype.toLocaleString.length property has the attributes DontDelete');
if (Object.prototype.toLocaleString.hasOwnProperty('length')) {
$FAIL('#2: The Object.prototype.toLocaleString.length property does not have the attributes DontDelete');
}

View File

@ -2,7 +2,9 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: The Object.prototype.valueOf.length property has the attribute DontDelete
info: >
The Object.prototype.valueOf.length property does not have the attribute
DontDelete
es5id: 15.2.4.4_A9
description: >
Checknig if deleting of the Object.prototype.valueOf.length
@ -17,11 +19,11 @@ if (!(Object.prototype.valueOf.hasOwnProperty('length'))) {
}
//CHECK#1
if (delete Object.prototype.valueOf.length) {
$ERROR('#1: The Object.prototype.valueOf.length property has the attributes DontDelete');
if (!delete Object.prototype.valueOf.length) {
$ERROR('#1: The Object.prototype.valueOf.length property does not have the attributes DontDelete');
}
//CHECK#2
if (!(Object.prototype.valueOf.hasOwnProperty('length'))) {
$FAIL('#2: The Object.prototype.valueOf.length property has the attributes DontDelete');
if (Object.prototype.valueOf.hasOwnProperty('length')) {
$FAIL('#2: The Object.prototype.valueOf.length property does not have the attributes DontDelete');
}

Some files were not shown because too many files have changed in this diff Show More