Merge pull request #249 from anba/issue-35/builtins-Object

Fix some strict mode errors in built-ins/Object
This commit is contained in:
Brian Terlson 2015-04-30 09:46:03 -07:00
commit 3aa368b07f
21 changed files with 18 additions and 17 deletions

View File

@ -10,7 +10,7 @@ description: Object.isExtensible returns true for all built-in objects (Global)
includes: [runTestCase.js]
---*/
global = this;
var global = this;
function testcase() {
// in non-strict mode, 'this' is bound to the global object.
var e = Object.isExtensible(this);

View File

@ -5,6 +5,7 @@
info: The Object.prototype property has the attribute ReadOnly
es5id: 15.2.3.1_A1
description: Checking if varying "Object.prototype" property fails
flags: [noStrict]
---*/
var obj = Object.prototype;

View File

@ -15,7 +15,7 @@ if (Object.propertyIsEnumerable('prototype')) {
// CHECK#2
var cout=0;
for (p in Object){
for (var p in Object){
if (p==="prototype") cout++;
}

View File

@ -14,7 +14,7 @@ includes:
//CHECK#1
try {
instance = new Object.prototype;
var instance = new Object.prototype;
$FAIL('#1: Since Object prototype object is not function it has not [[create]] method');
} catch (e) {
$PRINT(e);

View File

@ -9,6 +9,7 @@ es5id: 15.2.4.5_A10
description: >
Checking if varying the Object.prototype.hasOwnProperty.length
property fails
flags: [noStrict]
includes: [$FAIL.js]
---*/

View File

@ -13,7 +13,7 @@ includes:
var FACTORY = Object.prototype.hasOwnProperty;
try {
instance = new FACTORY;
var instance = new FACTORY;
$FAIL('#1: Object.prototype.hasOwnProperty can\'t be used as a constructor');
} catch (e) {
$PRINT(e);

View File

@ -24,7 +24,7 @@ if (Object.prototype.hasOwnProperty.propertyIsEnumerable('length')) {
}
// CHECK#2
for (p in Object.prototype.hasOwnProperty){
for (var p in Object.prototype.hasOwnProperty){
if (p==="length")
$ERROR('#2: the Object.prototype.hasOwnProperty.length property has the attributes DontEnum');
}

View File

@ -13,7 +13,7 @@ includes:
var FACTORY = Object.prototype.isPrototypeOf;
try {
instance = new FACTORY;
var instance = new FACTORY;
$FAIL('#1: Object.prototype.isPrototypeOf can\'t be used as a constructor');
} catch (e) {
$PRINT(e);

View File

@ -24,7 +24,7 @@ if (Object.prototype.isPrototypeOf.propertyIsEnumerable('length')) {
}
// CHECK#2
for (p in Object.prototype.isPrototypeOf){
for (var p in Object.prototype.isPrototypeOf){
if (p==="length")
$ERROR('#2: the Object.prototype.isPrototypeOf.length property has the attributes DontEnum');
}

View File

@ -15,7 +15,7 @@ includes:
var FACTORY = Object.prototype.propertyIsEnumerable;
try {
instance = new FACTORY;
var instance = new FACTORY;
$FAIL('#1: Object.prototype.propertyIsEnumerable can\'t be used as a constructor');
} catch (e) {
$PRINT(e);

View File

@ -24,7 +24,7 @@ if (Object.prototype.propertyIsEnumerable.propertyIsEnumerable('length')) {
}
// CHECK#2
for (p in Object.prototype.propertyIsEnumerable){
for (var p in Object.prototype.propertyIsEnumerable){
if (p==="length")
$ERROR('#2: the Object.prototype.propertyIsEnumerable.length property has the attributes DontEnum');
}

View File

@ -9,6 +9,7 @@ es5id: 15.2.4.3_A10
description: >
Checking if varying the Object.prototype.toLocaleString.length
property fails
flags: [noStrict]
includes: [$FAIL.js]
---*/

View File

@ -13,7 +13,7 @@ includes:
var FACTORY = Object.prototype.toLocaleString;
try {
instance = new FACTORY;
var instance = new FACTORY;
$FAIL('#1: Object.prototype.toLocaleString can\'t be used as a constructor');
} catch (e) {
$PRINT(e);

View File

@ -24,7 +24,7 @@ if (Object.prototype.toLocaleString.propertyIsEnumerable('length')) {
}
// CHECK#2
for (p in Object.prototype.toLocaleString){
for (var p in Object.prototype.toLocaleString){
if (p==="length")
$ERROR('#2: the Object.prototype.toLocaleString.length property has the attributes DontEnum');
}

View File

@ -9,7 +9,6 @@ es5id: 15.2.4.3_A9
description: >
Checknig if deleting of the Object.prototype.toLocaleString.length
property fails
flags: [noStrict]
includes: [$FAIL.js]
---*/

View File

@ -13,7 +13,7 @@ includes:
var FACTORY = Object.prototype.toString;
try {
instance = new FACTORY;
var instance = new FACTORY;
$FAIL('#1: Object.prototype.toString can\'t be used as a constructor');
} catch (e) {
$PRINT(e);

View File

@ -9,7 +9,6 @@ es5id: 15.2.4.2_A9
description: >
Checknig if deleting of the Object.prototype.toString.length
property fails
flags: [noStrict]
includes: [$FAIL.js]
---*/

View File

@ -7,6 +7,7 @@ es5id: 15.2.4.4_A10
description: >
Checking if varying the Object.prototype.valueOf.length property
fails
flags: [noStrict]
includes: [$FAIL.js]
---*/

View File

@ -13,7 +13,7 @@ includes:
var FACTORY = Object.prototype.valueOf;
try {
instance = new FACTORY;
var instance = new FACTORY;
$FAIL('#1: Object.prototype.valueOf can\'t be used as a constructor');
} catch (e) {
$PRINT(e);

View File

@ -22,7 +22,7 @@ if (Object.prototype.valueOf.propertyIsEnumerable('length')) {
}
// CHECK#2
for (p in Object.prototype.valueOf){
for (var p in Object.prototype.valueOf){
if (p==="length")
$ERROR('#2: the Object.prototype.valueOf.length property has the attributes DontEnum');
}

View File

@ -9,7 +9,6 @@ es5id: 15.2.4.4_A9
description: >
Checknig if deleting of the Object.prototype.valueOf.length
property fails
flags: [noStrict]
includes: [$FAIL.js]
---*/