Fix some strict mode errors in built-ins/Object

- Add missing "var" declarations and noStrict flags
- Remove invalid noStrict flags
- ietestcenter tests need fixed, require updates to use propertyHelper.js

Part of issue #35.
This commit is contained in:
André Bargull 2015-04-29 17:41:42 +02:00
parent 87fd4e5699
commit 2bc08d0b0b
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] includes: [runTestCase.js]
---*/ ---*/
global = this; var global = this;
function testcase() { function testcase() {
// in non-strict mode, 'this' is bound to the global object. // in non-strict mode, 'this' is bound to the global object.
var e = Object.isExtensible(this); var e = Object.isExtensible(this);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -24,7 +24,7 @@ if (Object.prototype.propertyIsEnumerable.propertyIsEnumerable('length')) {
} }
// CHECK#2 // CHECK#2
for (p in Object.prototype.propertyIsEnumerable){ for (var p in Object.prototype.propertyIsEnumerable){
if (p==="length") if (p==="length")
$ERROR('#2: the Object.prototype.propertyIsEnumerable.length property has the attributes DontEnum'); $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: > description: >
Checking if varying the Object.prototype.toLocaleString.length Checking if varying the Object.prototype.toLocaleString.length
property fails property fails
flags: [noStrict]
includes: [$FAIL.js] includes: [$FAIL.js]
---*/ ---*/

View File

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

View File

@ -24,7 +24,7 @@ if (Object.prototype.toLocaleString.propertyIsEnumerable('length')) {
} }
// CHECK#2 // CHECK#2
for (p in Object.prototype.toLocaleString){ for (var p in Object.prototype.toLocaleString){
if (p==="length") if (p==="length")
$ERROR('#2: the Object.prototype.toLocaleString.length property has the attributes DontEnum'); $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: > description: >
Checknig if deleting of the Object.prototype.toLocaleString.length Checknig if deleting of the Object.prototype.toLocaleString.length
property fails property fails
flags: [noStrict]
includes: [$FAIL.js] includes: [$FAIL.js]
---*/ ---*/

View File

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

View File

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

View File

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

View File

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

View File

@ -22,7 +22,7 @@ if (Object.prototype.valueOf.propertyIsEnumerable('length')) {
} }
// CHECK#2 // CHECK#2
for (p in Object.prototype.valueOf){ for (var p in Object.prototype.valueOf){
if (p==="length") if (p==="length")
$ERROR('#2: the Object.prototype.valueOf.length property has the attributes DontEnum'); $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: > description: >
Checknig if deleting of the Object.prototype.valueOf.length Checknig if deleting of the Object.prototype.valueOf.length
property fails property fails
flags: [noStrict]
includes: [$FAIL.js] includes: [$FAIL.js]
---*/ ---*/