built-ins/Object/*: make all indentation consistent (depth & character) (#1432)

This commit is contained in:
Rick Waldron 2018-02-15 15:33:45 -05:00 committed by Leo Balter
parent dedd68020b
commit a61b9cd671
2862 changed files with 24519 additions and 23310 deletions

View File

@ -14,7 +14,9 @@ if (typeof func !== 'undefined') {
$ERROR('#1: function expression can\'t be declarated'); $ERROR('#1: function expression can\'t be declarated');
} }
var n_obj = Object(function func(){return 1;}); var n_obj = Object(function func() {
return 1;
});
//CHECK#2 //CHECK#2
if ((n_obj.constructor !== Function) || (n_obj() !== 1)) { if ((n_obj.constructor !== Function) || (n_obj() !== 1)) {

View File

@ -9,7 +9,9 @@ es5id: 15.2.1.1_A2_T12
description: Calling Object function with numeric expression as argument value description: Calling Object function with numeric expression as argument value
---*/ ---*/
var obj = Object(1.1*([].length+{q:1}["q"])); var obj = Object(1.1 * ([].length + {
q: 1
}["q"]));
//CHECK#2 //CHECK#2
if (typeof obj !== "object") { if (typeof obj !== "object") {

View File

@ -9,7 +9,9 @@ es5id: 15.2.1.1_A2_T4
description: Calling Object function with object argument value description: Calling Object function with object argument value
---*/ ---*/
var obj = {flag:true}; var obj = {
flag: true
};
//CHECK#1 //CHECK#1
if (typeof(obj) !== 'object') { if (typeof(obj) !== 'object') {

View File

@ -9,7 +9,9 @@ es5id: 15.2.1.1_A2_T8
description: Calling Object function with function variable argument value description: Calling Object function with function variable argument value
---*/ ---*/
var func = function(){return 1;}; var func = function() {
return 1;
};
//CHECK#1 //CHECK#1
if (typeof func !== 'function') { if (typeof func !== 'function') {

View File

@ -23,4 +23,6 @@ if ((n_obj !== func)||(n_obj()!==1)) {
$ERROR('#2: Object(function) returns function'); $ERROR('#2: Object(function) returns function');
} }
function func(){return 1;}; function func() {
return 1;
};

View File

@ -9,7 +9,9 @@ es5id: 15.2.2.1_A2_T1
description: The value is Object description: The value is Object
---*/ ---*/
var obj = {prop:1}; var obj = {
prop: 1
};
var n_obj = new Object(obj); var n_obj = new Object(obj);

View File

@ -9,7 +9,9 @@ es5id: 15.2.2.1_A2_T2
description: The value is a function variable description: The value is a function variable
---*/ ---*/
var func = function(){return 1;}; var func = function() {
return 1;
};
var n_obj = new Object(func); var n_obj = new Object(func);

View File

@ -21,4 +21,6 @@ if (n_obj() !== 1) {
$ERROR('When the Object constructor is called and if the value is an Object simply value returns'); $ERROR('When the Object constructor is called and if the value is an Object simply value returns');
} }
function func(){return 1;}; function func() {
return 1;
};

View File

@ -14,7 +14,9 @@ if (typeof func !== 'undefined') {
$ERROR('#0: function expression can\'t be declarated'); $ERROR('#0: function expression can\'t be declarated');
} }
var n_obj = new Object(function func(){return 1;}); var n_obj = new Object(function func() {
return 1;
});
//CHECK#1 //CHECK#1
if (n_obj.constructor !== Function) { if (n_obj.constructor !== Function) {

View File

@ -9,7 +9,9 @@ es5id: 15.2.2.1_A5_T4
description: Argument value is numeric expression description: Argument value is numeric expression
---*/ ---*/
var n_obj = new Object( 2*([].length + {q:1}["q"])); var n_obj = new Object(2 * ([].length + {
q: 1
}["q"]));
//CHECK#2 //CHECK#2
if (n_obj.constructor !== Number) { if (n_obj.constructor !== Number) {

View File

@ -11,7 +11,9 @@ description: Converting from Objects to Object
function MyObject(val) { function MyObject(val) {
this.value = val; this.value = val;
this.valueOf = function (){ return this.value; } this.valueOf = function() {
return this.value;
}
} }
var x = new MyObject(1); var x = new MyObject(1);

View File

@ -7,7 +7,13 @@ description: Object properties are assigned to target in ascending index order,
es6id: 19.1.2.1 es6id: 19.1.2.1
---*/ ---*/
var target = {a: 1}; var target = {
var result = Object.assign(target,{a:2},{a:"c"}); a: 1
};
var result = Object.assign(target, {
a: 2
}, {
a: "c"
});
assert.sameValue(result.a, "c", "The value should be 'c'."); assert.sameValue(result.a, "c", "The value should be 'c'.");

View File

@ -7,7 +7,9 @@ esid: sec-object.assign
---*/ ---*/
//"a" will be an property of the final object and the value should be 1 //"a" will be an property of the final object and the value should be 1
var target = {a:1}; var target = {
a: 1
};
/* /*
"1a2c3" have own enumerable properties, so it Should be wrapped to objects; "1a2c3" have own enumerable properties, so it Should be wrapped to objects;
{b:6} is an object,should be assigned to final object. {b:6} is an object,should be assigned to final object.
@ -15,7 +17,13 @@ undefined and null should be ignored;
125 is a number,it cannot has own enumerable properties; 125 is a number,it cannot has own enumerable properties;
{a:"c"},{a:5} will override property a, the value should be 5. {a:"c"},{a:5} will override property a, the value should be 5.
*/ */
var result = Object.assign(target,"1a2c3",{a:"c"},undefined,{b:6},null,125,{a:5}); var result = Object.assign(target, "1a2c3", {
a: "c"
}, undefined, {
b: 6
}, null, 125, {
a: 5
});
assert.sameValue(Object.keys(result).length, 7, "The length should be 7 in the final object."); assert.sameValue(Object.keys(result).length, 7, "The length should be 7 in the final object.");
assert.sameValue(result.a, 5, "The value should be {a:5}."); assert.sameValue(result.a, 5, "The value should be {a:5}.");

View File

@ -7,6 +7,8 @@ description: Test the first argument(target) of Object.Assign(target,...sources)
es6id: 19.1.2.1.1 es6id: 19.1.2.1.1
---*/ ---*/
var result = Object.assign(true,{a:1}); var result = Object.assign(true, {
a: 1
});
assert.sameValue(typeof result, "object", "Return value should be an object."); assert.sameValue(typeof result, "object", "Return value should be an object.");
assert.sameValue(result.valueOf(), true, "Return value should be true."); assert.sameValue(result.valueOf(), true, "Return value should be true.");

View File

@ -7,4 +7,8 @@ description: Test the first argument(target) of Object.Assign(target,...sources)
es6id: 19.1.2.1.1 es6id: 19.1.2.1.1
---*/ ---*/
assert.throws(TypeError, function(){Object.assign(null, {a:1});}); assert.throws(TypeError, function() {
Object.assign(null, {
a: 1
});
});

View File

@ -7,6 +7,8 @@ description: Test the first argument(target) of Object.Assign(target,...sources)
es6id: 19.1.2.1.1 es6id: 19.1.2.1.1
---*/ ---*/
var result = Object.assign(1,{a:1}); var result = Object.assign(1, {
a: 1
});
assert.sameValue(typeof result, "object", "Return value should be an object."); assert.sameValue(typeof result, "object", "Return value should be an object.");
assert.sameValue(result.valueOf(), 1, "Return value should be 1."); assert.sameValue(result.valueOf(), 1, "Return value should be 1.");

View File

@ -7,8 +7,12 @@ description: Test the first argument(target) of Object.Assign(target,...sources)
es6id: 19.1.2.1.1 es6id: 19.1.2.1.1
---*/ ---*/
var target = {foo: 1}; var target = {
var result = Object.assign(target,{a:2}); foo: 1
};
var result = Object.assign(target, {
a: 2
});
assert.sameValue(result.foo, 1, "The value should be {foo: 1}."); assert.sameValue(result.foo, 1, "The value should be {foo: 1}.");
assert.sameValue(result.a, 2, "The value should be {a: 2}."); assert.sameValue(result.a, 2, "The value should be {a: 2}.");

View File

@ -7,6 +7,8 @@ description: Test the first argument(target) of Object.Assign(target,...sources)
es6id: 19.1.2.1.1 es6id: 19.1.2.1.1
---*/ ---*/
var result = Object.assign("test",{a:1}); var result = Object.assign("test", {
a: 1
});
assert.sameValue(typeof result, "object", "Return value should be an object."); assert.sameValue(typeof result, "object", "Return value should be an object.");
assert.sameValue(result.valueOf(), "test", "Return value should be 'test'."); assert.sameValue(result.valueOf(), "test", "Return value should be 'test'.");

View File

@ -9,7 +9,9 @@ features: [Symbol]
---*/ ---*/
var target = Symbol('foo'); var target = Symbol('foo');
var result = Object.assign(target,{a:1}); var result = Object.assign(target, {
a: 1
});
assert.sameValue(typeof result, "object", "Return value should be a symbol object."); assert.sameValue(typeof result, "object", "Return value should be a symbol object.");
assert.sameValue(result.toString(), "Symbol(foo)", "Return value should be 'Symbol(foo)'."); assert.sameValue(result.toString(), "Symbol(foo)", "Return value should be 'Symbol(foo)'.");

View File

@ -7,4 +7,8 @@ description: Test the first argument(target) of Object.Assign(target,...sources)
es6id: 19.1.2.1.1 es6id: 19.1.2.1.1
---*/ ---*/
assert.throws(TypeError, function(){Object.assign(undefined, {a:1});}); assert.throws(TypeError, function() {
Object.assign(undefined, {
a: 1
});
});

View File

@ -28,4 +28,3 @@ assert.sameValue(
verifyNotEnumerable(Object.assign, 'name'); verifyNotEnumerable(Object.assign, 'name');
verifyNotWritable(Object.assign, 'name'); verifyNotWritable(Object.assign, 'name');
verifyConfigurable(Object.assign, 'name'); verifyConfigurable(Object.assign, 'name');

View File

@ -13,7 +13,9 @@ info: |
features: [Proxy] features: [Proxy]
---*/ ---*/
var source = new Proxy({ attr: null }, { var source = new Proxy({
attr: null
}, {
getOwnPropertyDescriptor: function() { getOwnPropertyDescriptor: function() {
throw new Test262Error(); throw new Test262Error();
} }

View File

@ -21,5 +21,7 @@ Object.defineProperty(target, 'attr', {
}); });
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Object.assign(target, { attr: 1 }); Object.assign(target, {
attr: 1
});
}); });

View File

@ -23,5 +23,7 @@ Object.defineProperty(target, 'attr', {
}); });
assert.throws(Test262Error, function() { assert.throws(Test262Error, function() {
Object.assign(target, { attr: 1 }); Object.assign(target, {
attr: 1
});
}); });

View File

@ -14,8 +14,16 @@ description: >
function base() {} function base() {}
var b = new base(); var b = new base();
var prop = new Object(); var prop = new Object();
var d = Object.create(b,{ "x": {value: true,writable: false}, var d = Object.create(b, {
"y": {value: "str",writable: false} }); "x": {
value: true,
writable: false
},
"y": {
value: "str",
writable: false
}
});
assert.sameValue(Object.getPrototypeOf(d), b, 'Object.getPrototypeOf(d)'); assert.sameValue(Object.getPrototypeOf(d), b, 'Object.getPrototypeOf(d)');
assert.sameValue(b.isPrototypeOf(d), true, 'b.isPrototypeOf(d)'); assert.sameValue(b.isPrototypeOf(d), true, 'b.isPrototypeOf(d)');

View File

@ -28,4 +28,3 @@ var newObj = Object.create({}, {
assert(newObj.hasOwnProperty("prop")); assert(newObj.hasOwnProperty("prop"));
verifyNotConfigurable(newObj, "prop"); verifyNotConfigurable(newObj, "prop");

View File

@ -30,4 +30,3 @@ var newObj = Object.create({}, {
assert(newObj.hasOwnProperty("prop")); assert(newObj.hasOwnProperty("prop"));
verifyNotConfigurable(newObj, "prop"); verifyNotConfigurable(newObj, "prop");

View File

@ -9,7 +9,9 @@ description: >
'configurable' property (8.10.5 step 4.a) 'configurable' property (8.10.5 step 4.a)
---*/ ---*/
var argObj = (function () { return arguments; })(); var argObj = (function() {
return arguments;
})();
argObj.configurable = true; argObj.configurable = true;

View File

@ -12,7 +12,10 @@ description: >
var result = false; var result = false;
(Object.getOwnPropertyNames(props)).forEach(function(name) { (Object.getOwnPropertyNames(props)).forEach(function(name) {
props[name] = {value:11, configurable:true} props[name] = {
value: 11,
configurable: true
}
}); });
Object.defineProperty(props, "prop15_2_3_5_4_14", { Object.defineProperty(props, "prop15_2_3_5_4_14", {

View File

@ -8,7 +8,9 @@ description: >
'Properties' is an Arguments object (8.10.5 step 4.b) 'Properties' is an Arguments object (8.10.5 step 4.b)
---*/ ---*/
var argObj = (function () { return arguments; })(); var argObj = (function() {
return arguments;
})();
var newObj = Object.create({}, { var newObj = Object.create({}, {
prop: { prop: {

View File

@ -10,7 +10,9 @@ description: >
var result = false; var result = false;
var argObj = (function () { return arguments; })(); var argObj = (function() {
return arguments;
})();
Object.defineProperty(argObj, "prop", { Object.defineProperty(argObj, "prop", {
get: function() { get: function() {

View File

@ -9,7 +9,9 @@ description: >
'value' property (8.10.5 step 5.a) 'value' property (8.10.5 step 5.a)
---*/ ---*/
var argObj = (function () { return arguments; })(); var argObj = (function() {
return arguments;
})();
argObj.value = "ArgValue"; argObj.value = "ArgValue";

View File

@ -10,7 +10,9 @@ description: >
includes: [propertyHelper.js] includes: [propertyHelper.js]
---*/ ---*/
var descObj = { value: 100 }; var descObj = {
value: 100
};
Object.defineProperty(descObj, "writable", { Object.defineProperty(descObj, "writable", {
set: function() {} set: function() {}

View File

@ -10,7 +10,9 @@ description: >
includes: [propertyHelper.js] includes: [propertyHelper.js]
---*/ ---*/
var proto = { value: 100 }; var proto = {
value: 100
};
Object.defineProperty(proto, "writable", { Object.defineProperty(proto, "writable", {
set: function() {} set: function() {}

View File

@ -9,7 +9,9 @@ description: >
'writable' property (8.10.5 step 6.a) 'writable' property (8.10.5 step 6.a)
---*/ ---*/
var argObj = (function () { return arguments; })(); var argObj = (function() {
return arguments;
})();
argObj.writable = true; argObj.writable = true;

View File

@ -8,7 +8,9 @@ description: >
'Properties' is an Arguments object (8.10.5 step 6.b) 'Properties' is an Arguments object (8.10.5 step 6.b)
---*/ ---*/
var argObj = (function () { return arguments; })(); var argObj = (function() {
return arguments;
})();
var newObj = Object.create({}, { var newObj = Object.create({}, {
prop: { prop: {

View File

@ -12,7 +12,9 @@ description: >
var proto = {}; var proto = {};
Object.defineProperty(proto, "prop", { Object.defineProperty(proto, "prop", {
get: function() { get: function() {
return { value: 9 }; return {
value: 9
};
}, },
enumerable: true enumerable: true
}); });

View File

@ -9,7 +9,9 @@ description: >
property (8.10.5 step 7.a) property (8.10.5 step 7.a)
---*/ ---*/
var argObj = (function () { return arguments; })(); var argObj = (function() {
return arguments;
})();
argObj.get = function() { argObj.get = function() {
return "VerifyArgumentsObject"; return "VerifyArgumentsObject";

View File

@ -9,7 +9,9 @@ description: >
property (8.10.5 step 8.a) property (8.10.5 step 8.a)
---*/ ---*/
var argObj = (function () { return arguments; })(); var argObj = (function() {
return arguments;
})();
var data = "data"; var data = "data";

View File

@ -20,4 +20,3 @@ var newObj = Object.create({}, {
assert(newObj.hasOwnProperty("prop")); assert(newObj.hasOwnProperty("prop"));
verifyNotConfigurable(newObj, "prop"); verifyNotConfigurable(newObj, "prop");

View File

@ -10,9 +10,11 @@ includes: [propertyHelper.js]
---*/ ---*/
var newObj = {}; var newObj = {};
function getFunc() { function getFunc() {
return 10; return 10;
} }
function setFunc(value) { function setFunc(value) {
newObj.setVerifyHelpProp = value; newObj.setVerifyHelpProp = value;
} }

View File

@ -11,6 +11,7 @@ description: >
function getFunc() { function getFunc() {
return 20; return 20;
} }
function setFunc() {} function setFunc() {}
var newObj = Object.create({}, { var newObj = Object.create({}, {

View File

@ -12,7 +12,10 @@ description: >
var props = new Error("test"); var props = new Error("test");
(Object.getOwnPropertyNames(props)).forEach(function(name) { (Object.getOwnPropertyNames(props)).forEach(function(name) {
props[name] = {value:11, configurable:true} props[name] = {
value: 11,
configurable: true
}
}); });
props.prop15_2_3_5_4_37 = { props.prop15_2_3_5_4_37 = {

View File

@ -9,7 +9,9 @@ description: >
property (15.2.3.7 step 5.a) property (15.2.3.7 step 5.a)
---*/ ---*/
var argObj = (function () { return arguments; })(); var argObj = (function() {
return arguments;
})();
argObj.prop = { argObj.prop = {
value: 12, value: 12,

View File

@ -10,8 +10,14 @@ description: >
---*/ ---*/
var props = {}; var props = {};
props.prop1 = { value: 12, enumerable: true }; props.prop1 = {
props.prop2 = { value: true, enumerable: true }; value: 12,
enumerable: true
};
props.prop2 = {
value: true,
enumerable: true
};
var tempArray = []; var tempArray = [];
for (var p in props) { for (var p in props) {

View File

@ -10,7 +10,9 @@ description: >
---*/ ---*/
var accessed = false; var accessed = false;
var argObj = (function () { return arguments; })(); var argObj = (function() {
return arguments;
})();
argObj.enumerable = true; argObj.enumerable = true;

View File

@ -9,7 +9,9 @@ description: >
---*/ ---*/
var accessed = false; var accessed = false;
var argObj = (function () { return arguments; })(); var argObj = (function() {
return arguments;
})();
var newObj = Object.create({}, { var newObj = Object.create({}, {
prop: { prop: {

View File

@ -8,7 +8,9 @@ description: >
number number
---*/ ---*/
var obj = { "123": 100 }; var obj = {
"123": 100
};
var obj1 = Object.defineProperties(obj, -12); var obj1 = Object.defineProperties(obj, -12);
assert.sameValue(obj, obj1, 'obj'); assert.sameValue(obj, obj1, 'obj');

View File

@ -8,7 +8,9 @@ description: >
value is any interesting string value is any interesting string
---*/ ---*/
var obj = { "123": 100 }; var obj = {
"123": 100
};
var obj1 = Object.defineProperties(obj, ""); var obj1 = Object.defineProperties(obj, "");
assert.sameValue(obj, obj1, 'obj'); assert.sameValue(obj, obj1, 'obj');

View File

@ -18,4 +18,3 @@ Object.defineProperties(obj, {
}); });
verifyNotWritable(obj, "property"); verifyNotWritable(obj, "property");

View File

@ -19,4 +19,3 @@ Object.defineProperties(obj, {
assert(obj.hasOwnProperty("property")); assert(obj.hasOwnProperty("property"));
verifyNotWritable(obj, "property"); verifyNotWritable(obj, "property");

View File

@ -12,7 +12,9 @@ includes: [propertyHelper.js]
var obj = {}; var obj = {};
var proto = { value: 120 }; var proto = {
value: 120
};
Object.defineProperty(proto, "writable", { Object.defineProperty(proto, "writable", {
get: function() { get: function() {
@ -35,4 +37,3 @@ Object.defineProperties(obj, {
assert(obj.hasOwnProperty("property")); assert(obj.hasOwnProperty("property"));
verifyNotWritable(obj, "property"); verifyNotWritable(obj, "property");

View File

@ -22,4 +22,3 @@ Object.defineProperties(obj, {
assert(obj.hasOwnProperty("property")); assert(obj.hasOwnProperty("property"));
verifyNotWritable(obj, "property"); verifyNotWritable(obj, "property");

View File

@ -24,4 +24,3 @@ var func = function (a, b) {
}; };
func(); func();

View File

@ -19,4 +19,3 @@ Object.defineProperties(obj, {
assert(obj.hasOwnProperty("property")); assert(obj.hasOwnProperty("property"));
verifyNotWritable(obj, "property"); verifyNotWritable(obj, "property");

View File

@ -19,4 +19,3 @@ Object.defineProperties(obj, {
assert(obj.hasOwnProperty("property")); assert(obj.hasOwnProperty("property"));
verifyNotWritable(obj, "property"); verifyNotWritable(obj, "property");

View File

@ -19,4 +19,3 @@ Object.defineProperties(obj, {
assert(obj.hasOwnProperty("property")); assert(obj.hasOwnProperty("property"));
verifyNotWritable(obj, "property"); verifyNotWritable(obj, "property");

View File

@ -19,4 +19,3 @@ Object.defineProperties(obj, {
assert(obj.hasOwnProperty("property")); assert(obj.hasOwnProperty("property"));
verifyNotWritable(obj, "property"); verifyNotWritable(obj, "property");

View File

@ -19,4 +19,3 @@ Object.defineProperties(obj, {
assert(obj.hasOwnProperty("property")); assert(obj.hasOwnProperty("property"));
verifyNotWritable(obj, "property"); verifyNotWritable(obj, "property");

View File

@ -26,4 +26,3 @@ verifyNotWritable(obj, "descObj");
var desc = Object.getOwnPropertyDescriptor(obj, "descObj"); var desc = Object.getOwnPropertyDescriptor(obj, "descObj");
assert.sameValue(typeof(desc.set), "undefined") assert.sameValue(typeof(desc.set), "undefined")

View File

@ -11,9 +11,15 @@ description: >
var data = "data"; var data = "data";
var descObj = new Error("test"); var descObj = new Error("test");
descObj.description = { value: 11 }; descObj.description = {
descObj.message = { value: 11 }; value: 11
descObj.name = { value: 11 }; };
descObj.message = {
value: 11
};
descObj.name = {
value: 11
};
var setFun = function(value) { var setFun = function(value) {
data = value; data = value;

View File

@ -11,7 +11,9 @@ description: >
var obj = {}; var obj = {};
var accessed = false; var accessed = false;
var descObj = { enumerable: true }; var descObj = {
enumerable: true
};
Object.defineProperties(obj, { Object.defineProperties(obj, {
prop: descObj prop: descObj

View File

@ -16,6 +16,7 @@ var obj = {};
function get_func() { function get_func() {
return 10; return 10;
} }
function set_func(value) { function set_func(value) {
obj.setVerifyHelpProp = value; obj.setVerifyHelpProp = value;
} }

View File

@ -15,6 +15,7 @@ var obj = {};
function get_func() { function get_func() {
return 10; return 10;
} }
function set_func(value) { function set_func(value) {
obj.setVerifyHelpProp = value; obj.setVerifyHelpProp = value;
} }

View File

@ -9,9 +9,11 @@ description: >
---*/ ---*/
var obj = {}; var obj = {};
function get_func() { function get_func() {
return 10; return 10;
} }
function set_func() { function set_func() {
return 10; return 10;
} }

View File

@ -15,6 +15,7 @@ var obj = {};
function get_func() { function get_func() {
return 10; return 10;
} }
function set_func(value) { function set_func(value) {
obj.setVerifyHelpProp = value; obj.setVerifyHelpProp = value;
} }

View File

@ -15,6 +15,7 @@ var obj = {};
function get_func() { function get_func() {
return 10; return 10;
} }
function set_func(value) { function set_func(value) {
obj.setVerifyHelpProp = value; obj.setVerifyHelpProp = value;
} }

View File

@ -16,6 +16,7 @@ var obj = {};
function get_func1() { function get_func1() {
return 10; return 10;
} }
function set_func1() {} function set_func1() {}
Object.defineProperty(obj, "foo", { Object.defineProperty(obj, "foo", {
@ -27,6 +28,7 @@ Object.defineProperty(obj, "foo", {
function get_func2() { function get_func2() {
return 20; return 20;
} }
function set_func2(value) { function set_func2(value) {
obj.setVerifyHelpProp = value; obj.setVerifyHelpProp = value;
} }

View File

@ -15,6 +15,7 @@ var obj = {};
function get_func() { function get_func() {
return 10; return 10;
} }
function set_func(value) { function set_func(value) {
obj.setVerifyHelpProp = value; obj.setVerifyHelpProp = value;
} }
@ -49,4 +50,3 @@ verifyWritable(obj, "foo2", "setVerifyHelpProp");
verifyEnumerable(obj, "foo2"); verifyEnumerable(obj, "foo2");
verifyConfigurable(obj, "foo2"); verifyConfigurable(obj, "foo2");

View File

@ -15,7 +15,9 @@ description: >
}); });
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Object.defineProperties(arr, { Object.defineProperties(arr, {
length: { value: 1 } length: {
value: 1
}
}); });
}); });
var desc = Object.getOwnPropertyDescriptor(arr, "length"); var desc = Object.getOwnPropertyDescriptor(arr, "length");

View File

@ -21,7 +21,9 @@ assert.throws(TypeError, function() {
}); });
Object.defineProperties(arr, { Object.defineProperties(arr, {
length: { value: 1 } length: {
value: 1
}
}); });
}); });

View File

@ -12,7 +12,9 @@ includes: [propertyHelper.js]
var arr = []; var arr = [];
Object.defineProperties(arr, { length: {} }); Object.defineProperties(arr, {
length: {}
});
if (arr.length !== 0) { if (arr.length !== 0) {
$ERROR("Expected arr.length to be 0, actually " + arr.length); $ERROR("Expected arr.length to be 0, actually " + arr.length);

View File

@ -12,7 +12,9 @@ includes: [propertyHelper.js]
var arr = []; var arr = [];
Object.defineProperties(arr, { length: {} }); Object.defineProperties(arr, {
length: {}
});
if (arr.length !== 0) { if (arr.length !== 0) {
$ERROR("Expected arr.length to be 0, actually " + arr.length); $ERROR("Expected arr.length to be 0, actually " + arr.length);

View File

@ -13,6 +13,8 @@ description: >
var arr = []; var arr = [];
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Object.defineProperties(arr, { Object.defineProperties(arr, {
length: { configurable: true } length: {
configurable: true
}
}); });
}); });

View File

@ -13,6 +13,8 @@ description: >
var arr = []; var arr = [];
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Object.defineProperties(arr, { Object.defineProperties(arr, {
length: { enumerable: true } length: {
enumerable: true
}
}); });
}); });

View File

@ -17,6 +17,8 @@ description: >
}); });
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Object.defineProperties(arr, { Object.defineProperties(arr, {
length: { writable: true } length: {
writable: true
}
}); });
}); });

View File

@ -14,7 +14,9 @@ includes: [propertyHelper.js]
var arr = []; var arr = [];
Object.defineProperties(arr, { Object.defineProperties(arr, {
length: { writable: false } length: {
writable: false
}
}); });
verifyEqualTo(arr, "length", 0); verifyEqualTo(arr, "length", 0);
@ -24,4 +26,3 @@ verifyNotWritable(arr, "length");
verifyNotEnumerable(arr, "length"); verifyNotEnumerable(arr, "length");
verifyNotConfigurable(arr, "length"); verifyNotConfigurable(arr, "length");

View File

@ -12,7 +12,9 @@ description: >
var arr = []; var arr = [];
assert.throws(RangeError, function() { assert.throws(RangeError, function() {
Object.defineProperties(arr, { Object.defineProperties(arr, {
length: { value: undefined } length: {
value: undefined
}
}); });
}); });
assert.sameValue(arr.length, 0, 'arr.length'); assert.sameValue(arr.length, 0, 'arr.length');

View File

@ -12,7 +12,9 @@ description: >
var arr = [0, 1]; var arr = [0, 1];
Object.defineProperties(arr, { Object.defineProperties(arr, {
length: { value: null } length: {
value: null
}
}); });
assert.sameValue(arr.length, 0, 'arr.length'); assert.sameValue(arr.length, 0, 'arr.length');

View File

@ -12,7 +12,9 @@ description: >
var arr = [0, 1]; var arr = [0, 1];
Object.defineProperties(arr, { Object.defineProperties(arr, {
length: { value: false } length: {
value: false
}
}); });
assert.sameValue(arr.length, 0, 'arr.length'); assert.sameValue(arr.length, 0, 'arr.length');

View File

@ -12,7 +12,9 @@ description: >
var arr = []; var arr = [];
Object.defineProperties(arr, { Object.defineProperties(arr, {
length: { value: true } length: {
value: true
}
}); });
assert.sameValue(arr.length, 1, 'arr.length'); assert.sameValue(arr.length, 1, 'arr.length');

View File

@ -12,7 +12,9 @@ description: >
var arr = [0, 1]; var arr = [0, 1];
Object.defineProperties(arr, { Object.defineProperties(arr, {
length: { value: 0 } length: {
value: 0
}
}); });
assert.sameValue(arr.length, 0, 'arr.length'); assert.sameValue(arr.length, 0, 'arr.length');

View File

@ -12,7 +12,9 @@ description: >
var arr = [0, 1]; var arr = [0, 1];
Object.defineProperties(arr, { Object.defineProperties(arr, {
length: { value: +0 } length: {
value: +0
}
}); });
assert.sameValue(arr.length, 0, 'arr.length'); assert.sameValue(arr.length, 0, 'arr.length');

View File

@ -12,7 +12,9 @@ description: >
var arr = [0, 1]; var arr = [0, 1];
Object.defineProperties(arr, { Object.defineProperties(arr, {
length: { value: -0 } length: {
value: -0
}
}); });
assert.sameValue(arr.length, 0, 'arr.length'); assert.sameValue(arr.length, 0, 'arr.length');

View File

@ -12,7 +12,9 @@ description: >
var arr = []; var arr = [];
Object.defineProperties(arr, { Object.defineProperties(arr, {
length: { value: 12 } length: {
value: 12
}
}); });
assert.sameValue(arr.length, 12, 'arr.length'); assert.sameValue(arr.length, 12, 'arr.length');

View File

@ -34,4 +34,3 @@ try {
assert.sameValue(arr.length, 2); assert.sameValue(arr.length, 2);
verifyNotWritable(arr, "length"); verifyNotWritable(arr, "length");
} }

View File

@ -37,4 +37,3 @@ try {
assert.sameValue(arr[1], 1); assert.sameValue(arr[1], 1);
assert.sameValue(arr.length, 2) assert.sameValue(arr.length, 2)
} }

View File

@ -33,4 +33,3 @@ verifyNotWritable(obj, "prop");
verifyNotEnumerable(obj, "prop"); verifyNotEnumerable(obj, "prop");
verifyConfigurable(obj, "prop"); verifyConfigurable(obj, "prop");

View File

@ -28,4 +28,3 @@ verifyNotWritable(arr, "0");
verifyNotEnumerable(arr, "0"); verifyNotEnumerable(arr, "0");
verifyNotConfigurable(arr, "0"); verifyNotConfigurable(arr, "0");

View File

@ -15,6 +15,7 @@ var arr = [];
function get_func() { function get_func() {
return 11; return 11;
} }
function set_func(value) { function set_func(value) {
arr.setVerifyHelpProp = value; arr.setVerifyHelpProp = value;
} }
@ -36,4 +37,3 @@ verifyWritable(arr, "0", "setVerifyHelpProp");
verifyEnumerable(arr, "0"); verifyEnumerable(arr, "0");
verifyConfigurable(arr, "0"); verifyConfigurable(arr, "0");

View File

@ -29,4 +29,3 @@ verifyNotWritable(arr, "0");
verifyNotEnumerable(arr, "0"); verifyNotEnumerable(arr, "0");
verifyNotConfigurable(arr, "0"); verifyNotConfigurable(arr, "0");

View File

@ -29,4 +29,3 @@ verifyNotWritable(arr, "0");
verifyNotEnumerable(arr, "0"); verifyNotEnumerable(arr, "0");
verifyNotConfigurable(arr, "0"); verifyNotConfigurable(arr, "0");

View File

@ -13,7 +13,9 @@ includes: [propertyHelper.js]
var arr = []; var arr = [];
var obj1 = { length: 10 }; var obj1 = {
length: 10
};
Object.defineProperty(arr, "0", { Object.defineProperty(arr, "0", {
value: obj1 value: obj1
}); });
@ -32,4 +34,3 @@ verifyNotWritable(arr, "0");
verifyNotEnumerable(arr, "0"); verifyNotEnumerable(arr, "0");
verifyNotConfigurable(arr, "0"); verifyNotConfigurable(arr, "0");

View File

@ -28,4 +28,3 @@ verifyWritable(arr, "0");
verifyNotEnumerable(arr, "0"); verifyNotEnumerable(arr, "0");
verifyNotConfigurable(arr, "0"); verifyNotConfigurable(arr, "0");

View File

@ -29,4 +29,3 @@ verifyNotWritable(arr, "0");
verifyNotEnumerable(arr, "0"); verifyNotEnumerable(arr, "0");
verifyConfigurable(arr, "0"); verifyConfigurable(arr, "0");

View File

@ -28,4 +28,3 @@ verifyNotWritable(arr, "0");
verifyEnumerable(arr, "0"); verifyEnumerable(arr, "0");
verifyNotConfigurable(arr, "0"); verifyNotConfigurable(arr, "0");

View File

@ -29,4 +29,3 @@ verifyNotWritable(arr, "0");
verifyNotEnumerable(arr, "0"); verifyNotEnumerable(arr, "0");
verifyConfigurable(arr, "0"); verifyConfigurable(arr, "0");

View File

@ -28,4 +28,3 @@ verifyNotWritable(arr, "0");
verifyNotEnumerable(arr, "0"); verifyNotEnumerable(arr, "0");
verifyConfigurable(arr, "0"); verifyConfigurable(arr, "0");

View File

@ -28,4 +28,3 @@ verifyNotWritable(arr, "0");
verifyNotEnumerable(arr, "0"); verifyNotEnumerable(arr, "0");
verifyNotConfigurable(arr, "0"); verifyNotConfigurable(arr, "0");

View File

@ -14,8 +14,12 @@ includes: [propertyHelper.js]
---*/ ---*/
var arr = []; var arr = [];
var obj1 = { value: 12 }; var obj1 = {
var obj2 = { value: 36 }; value: 12
};
var obj2 = {
value: 36
};
Object.defineProperty(arr, "1", { Object.defineProperty(arr, "1", {
value: obj1 value: obj1

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