mirror of
https://github.com/tc39/test262.git
synced 2025-07-26 15:34:29 +02:00
built-ins/Object/*: make all indentation consistent (depth & character) (#1432)
This commit is contained in:
parent
dedd68020b
commit
a61b9cd671
@ -14,7 +14,9 @@ if (typeof func !== 'undefined') {
|
||||
$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
|
||||
if ((n_obj.constructor !== Function) || (n_obj() !== 1)) {
|
||||
|
@ -9,7 +9,9 @@ es5id: 15.2.1.1_A2_T12
|
||||
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
|
||||
if (typeof obj !== "object") {
|
||||
|
@ -9,7 +9,9 @@ es5id: 15.2.1.1_A2_T4
|
||||
description: Calling Object function with object argument value
|
||||
---*/
|
||||
|
||||
var obj = {flag:true};
|
||||
var obj = {
|
||||
flag: true
|
||||
};
|
||||
|
||||
//CHECK#1
|
||||
if (typeof(obj) !== 'object') {
|
||||
|
@ -9,7 +9,9 @@ es5id: 15.2.1.1_A2_T8
|
||||
description: Calling Object function with function variable argument value
|
||||
---*/
|
||||
|
||||
var func = function(){return 1;};
|
||||
var func = function() {
|
||||
return 1;
|
||||
};
|
||||
|
||||
//CHECK#1
|
||||
if (typeof func !== 'function') {
|
||||
|
@ -23,4 +23,6 @@ if ((n_obj !== func)||(n_obj()!==1)) {
|
||||
$ERROR('#2: Object(function) returns function');
|
||||
}
|
||||
|
||||
function func(){return 1;};
|
||||
function func() {
|
||||
return 1;
|
||||
};
|
||||
|
@ -9,7 +9,9 @@ es5id: 15.2.2.1_A2_T1
|
||||
description: The value is Object
|
||||
---*/
|
||||
|
||||
var obj = {prop:1};
|
||||
var obj = {
|
||||
prop: 1
|
||||
};
|
||||
|
||||
var n_obj = new Object(obj);
|
||||
|
||||
|
@ -9,7 +9,9 @@ es5id: 15.2.2.1_A2_T2
|
||||
description: The value is a function variable
|
||||
---*/
|
||||
|
||||
var func = function(){return 1;};
|
||||
var func = function() {
|
||||
return 1;
|
||||
};
|
||||
|
||||
var n_obj = new Object(func);
|
||||
|
||||
|
@ -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');
|
||||
}
|
||||
|
||||
function func(){return 1;};
|
||||
function func() {
|
||||
return 1;
|
||||
};
|
||||
|
@ -14,7 +14,9 @@ if (typeof func !== 'undefined') {
|
||||
$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
|
||||
if (n_obj.constructor !== Function) {
|
||||
|
@ -9,7 +9,9 @@ es5id: 15.2.2.1_A5_T4
|
||||
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
|
||||
if (n_obj.constructor !== Number) {
|
||||
|
@ -11,7 +11,9 @@ description: Converting from Objects to Object
|
||||
|
||||
function MyObject(val) {
|
||||
this.value = val;
|
||||
this.valueOf = function (){ return this.value; }
|
||||
this.valueOf = function() {
|
||||
return this.value;
|
||||
}
|
||||
}
|
||||
|
||||
var x = new MyObject(1);
|
||||
|
@ -7,7 +7,13 @@ description: Object properties are assigned to target in ascending index order,
|
||||
es6id: 19.1.2.1
|
||||
---*/
|
||||
|
||||
var target = {a: 1};
|
||||
var result = Object.assign(target,{a:2},{a:"c"});
|
||||
var target = {
|
||||
a: 1
|
||||
};
|
||||
var result = Object.assign(target, {
|
||||
a: 2
|
||||
}, {
|
||||
a: "c"
|
||||
});
|
||||
|
||||
assert.sameValue(result.a, "c", "The value should be 'c'.");
|
||||
|
@ -7,7 +7,9 @@ esid: sec-object.assign
|
||||
---*/
|
||||
|
||||
//"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;
|
||||
{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;
|
||||
{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(result.a, 5, "The value should be {a:5}.");
|
||||
|
@ -7,6 +7,8 @@ description: Test the first argument(target) of Object.Assign(target,...sources)
|
||||
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(result.valueOf(), true, "Return value should be true.");
|
||||
|
@ -7,4 +7,8 @@ description: Test the first argument(target) of Object.Assign(target,...sources)
|
||||
es6id: 19.1.2.1.1
|
||||
---*/
|
||||
|
||||
assert.throws(TypeError, function(){Object.assign(null, {a:1});});
|
||||
assert.throws(TypeError, function() {
|
||||
Object.assign(null, {
|
||||
a: 1
|
||||
});
|
||||
});
|
||||
|
@ -7,6 +7,8 @@ description: Test the first argument(target) of Object.Assign(target,...sources)
|
||||
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(result.valueOf(), 1, "Return value should be 1.");
|
||||
|
@ -7,8 +7,12 @@ description: Test the first argument(target) of Object.Assign(target,...sources)
|
||||
es6id: 19.1.2.1.1
|
||||
---*/
|
||||
|
||||
var target = {foo: 1};
|
||||
var result = Object.assign(target,{a:2});
|
||||
var target = {
|
||||
foo: 1
|
||||
};
|
||||
var result = Object.assign(target, {
|
||||
a: 2
|
||||
});
|
||||
|
||||
assert.sameValue(result.foo, 1, "The value should be {foo: 1}.");
|
||||
assert.sameValue(result.a, 2, "The value should be {a: 2}.");
|
||||
|
@ -7,6 +7,8 @@ description: Test the first argument(target) of Object.Assign(target,...sources)
|
||||
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(result.valueOf(), "test", "Return value should be 'test'.");
|
||||
|
@ -9,7 +9,9 @@ features: [Symbol]
|
||||
---*/
|
||||
|
||||
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(result.toString(), "Symbol(foo)", "Return value should be 'Symbol(foo)'.");
|
||||
|
@ -7,4 +7,8 @@ description: Test the first argument(target) of Object.Assign(target,...sources)
|
||||
es6id: 19.1.2.1.1
|
||||
---*/
|
||||
|
||||
assert.throws(TypeError, function(){Object.assign(undefined, {a:1});});
|
||||
assert.throws(TypeError, function() {
|
||||
Object.assign(undefined, {
|
||||
a: 1
|
||||
});
|
||||
});
|
||||
|
@ -28,4 +28,3 @@ assert.sameValue(
|
||||
verifyNotEnumerable(Object.assign, 'name');
|
||||
verifyNotWritable(Object.assign, 'name');
|
||||
verifyConfigurable(Object.assign, 'name');
|
||||
|
||||
|
@ -13,7 +13,9 @@ info: |
|
||||
features: [Proxy]
|
||||
---*/
|
||||
|
||||
var source = new Proxy({ attr: null }, {
|
||||
var source = new Proxy({
|
||||
attr: null
|
||||
}, {
|
||||
getOwnPropertyDescriptor: function() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
|
@ -21,5 +21,7 @@ Object.defineProperty(target, 'attr', {
|
||||
});
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
Object.assign(target, { attr: 1 });
|
||||
Object.assign(target, {
|
||||
attr: 1
|
||||
});
|
||||
});
|
||||
|
@ -23,5 +23,7 @@ Object.defineProperty(target, 'attr', {
|
||||
});
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
Object.assign(target, { attr: 1 });
|
||||
Object.assign(target, {
|
||||
attr: 1
|
||||
});
|
||||
});
|
||||
|
@ -14,8 +14,16 @@ description: >
|
||||
function base() {}
|
||||
var b = new base();
|
||||
var prop = new Object();
|
||||
var d = Object.create(b,{ "x": {value: true,writable: false},
|
||||
"y": {value: "str",writable: false} });
|
||||
var d = Object.create(b, {
|
||||
"x": {
|
||||
value: true,
|
||||
writable: false
|
||||
},
|
||||
"y": {
|
||||
value: "str",
|
||||
writable: false
|
||||
}
|
||||
});
|
||||
|
||||
assert.sameValue(Object.getPrototypeOf(d), b, 'Object.getPrototypeOf(d)');
|
||||
assert.sameValue(b.isPrototypeOf(d), true, 'b.isPrototypeOf(d)');
|
||||
|
@ -28,4 +28,3 @@ var newObj = Object.create({}, {
|
||||
|
||||
assert(newObj.hasOwnProperty("prop"));
|
||||
verifyNotConfigurable(newObj, "prop");
|
||||
|
||||
|
@ -30,4 +30,3 @@ var newObj = Object.create({}, {
|
||||
|
||||
assert(newObj.hasOwnProperty("prop"));
|
||||
verifyNotConfigurable(newObj, "prop");
|
||||
|
||||
|
@ -9,7 +9,9 @@ description: >
|
||||
'configurable' property (8.10.5 step 4.a)
|
||||
---*/
|
||||
|
||||
var argObj = (function () { return arguments; })();
|
||||
var argObj = (function() {
|
||||
return arguments;
|
||||
})();
|
||||
|
||||
argObj.configurable = true;
|
||||
|
||||
|
@ -12,7 +12,10 @@ description: >
|
||||
var result = false;
|
||||
|
||||
(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", {
|
||||
|
@ -8,7 +8,9 @@ description: >
|
||||
'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({}, {
|
||||
prop: {
|
||||
|
@ -10,7 +10,9 @@ description: >
|
||||
|
||||
var result = false;
|
||||
|
||||
var argObj = (function () { return arguments; })();
|
||||
var argObj = (function() {
|
||||
return arguments;
|
||||
})();
|
||||
|
||||
Object.defineProperty(argObj, "prop", {
|
||||
get: function() {
|
||||
|
@ -9,7 +9,9 @@ description: >
|
||||
'value' property (8.10.5 step 5.a)
|
||||
---*/
|
||||
|
||||
var argObj = (function () { return arguments; })();
|
||||
var argObj = (function() {
|
||||
return arguments;
|
||||
})();
|
||||
|
||||
argObj.value = "ArgValue";
|
||||
|
||||
|
@ -10,7 +10,9 @@ description: >
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
var descObj = { value: 100 };
|
||||
var descObj = {
|
||||
value: 100
|
||||
};
|
||||
|
||||
Object.defineProperty(descObj, "writable", {
|
||||
set: function() {}
|
||||
|
@ -10,7 +10,9 @@ description: >
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
var proto = { value: 100 };
|
||||
var proto = {
|
||||
value: 100
|
||||
};
|
||||
|
||||
Object.defineProperty(proto, "writable", {
|
||||
set: function() {}
|
||||
|
@ -9,7 +9,9 @@ description: >
|
||||
'writable' property (8.10.5 step 6.a)
|
||||
---*/
|
||||
|
||||
var argObj = (function () { return arguments; })();
|
||||
var argObj = (function() {
|
||||
return arguments;
|
||||
})();
|
||||
|
||||
argObj.writable = true;
|
||||
|
||||
|
@ -8,7 +8,9 @@ description: >
|
||||
'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({}, {
|
||||
prop: {
|
||||
|
@ -12,7 +12,9 @@ description: >
|
||||
var proto = {};
|
||||
Object.defineProperty(proto, "prop", {
|
||||
get: function() {
|
||||
return { value: 9 };
|
||||
return {
|
||||
value: 9
|
||||
};
|
||||
},
|
||||
enumerable: true
|
||||
});
|
||||
|
@ -9,7 +9,9 @@ description: >
|
||||
property (8.10.5 step 7.a)
|
||||
---*/
|
||||
|
||||
var argObj = (function () { return arguments; })();
|
||||
var argObj = (function() {
|
||||
return arguments;
|
||||
})();
|
||||
|
||||
argObj.get = function() {
|
||||
return "VerifyArgumentsObject";
|
||||
|
@ -9,7 +9,9 @@ description: >
|
||||
property (8.10.5 step 8.a)
|
||||
---*/
|
||||
|
||||
var argObj = (function () { return arguments; })();
|
||||
var argObj = (function() {
|
||||
return arguments;
|
||||
})();
|
||||
|
||||
var data = "data";
|
||||
|
||||
|
@ -20,4 +20,3 @@ var newObj = Object.create({}, {
|
||||
|
||||
assert(newObj.hasOwnProperty("prop"));
|
||||
verifyNotConfigurable(newObj, "prop");
|
||||
|
||||
|
@ -10,9 +10,11 @@ includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
var newObj = {};
|
||||
|
||||
function getFunc() {
|
||||
return 10;
|
||||
}
|
||||
|
||||
function setFunc(value) {
|
||||
newObj.setVerifyHelpProp = value;
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ description: >
|
||||
function getFunc() {
|
||||
return 20;
|
||||
}
|
||||
|
||||
function setFunc() {}
|
||||
|
||||
var newObj = Object.create({}, {
|
||||
|
@ -12,7 +12,10 @@ description: >
|
||||
var props = new Error("test");
|
||||
|
||||
(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 = {
|
||||
|
@ -9,7 +9,9 @@ description: >
|
||||
property (15.2.3.7 step 5.a)
|
||||
---*/
|
||||
|
||||
var argObj = (function () { return arguments; })();
|
||||
var argObj = (function() {
|
||||
return arguments;
|
||||
})();
|
||||
|
||||
argObj.prop = {
|
||||
value: 12,
|
||||
|
@ -10,8 +10,14 @@ description: >
|
||||
---*/
|
||||
|
||||
var props = {};
|
||||
props.prop1 = { value: 12, enumerable: true };
|
||||
props.prop2 = { value: true, enumerable: true };
|
||||
props.prop1 = {
|
||||
value: 12,
|
||||
enumerable: true
|
||||
};
|
||||
props.prop2 = {
|
||||
value: true,
|
||||
enumerable: true
|
||||
};
|
||||
|
||||
var tempArray = [];
|
||||
for (var p in props) {
|
||||
|
@ -10,7 +10,9 @@ description: >
|
||||
---*/
|
||||
|
||||
var accessed = false;
|
||||
var argObj = (function () { return arguments; })();
|
||||
var argObj = (function() {
|
||||
return arguments;
|
||||
})();
|
||||
|
||||
argObj.enumerable = true;
|
||||
|
||||
|
@ -9,7 +9,9 @@ description: >
|
||||
---*/
|
||||
|
||||
var accessed = false;
|
||||
var argObj = (function () { return arguments; })();
|
||||
var argObj = (function() {
|
||||
return arguments;
|
||||
})();
|
||||
|
||||
var newObj = Object.create({}, {
|
||||
prop: {
|
||||
|
@ -8,7 +8,9 @@ description: >
|
||||
number
|
||||
---*/
|
||||
|
||||
var obj = { "123": 100 };
|
||||
var obj = {
|
||||
"123": 100
|
||||
};
|
||||
var obj1 = Object.defineProperties(obj, -12);
|
||||
|
||||
assert.sameValue(obj, obj1, 'obj');
|
||||
|
@ -8,7 +8,9 @@ description: >
|
||||
value is any interesting string
|
||||
---*/
|
||||
|
||||
var obj = { "123": 100 };
|
||||
var obj = {
|
||||
"123": 100
|
||||
};
|
||||
var obj1 = Object.defineProperties(obj, "");
|
||||
|
||||
assert.sameValue(obj, obj1, 'obj');
|
||||
|
@ -18,4 +18,3 @@ Object.defineProperties(obj, {
|
||||
});
|
||||
|
||||
verifyNotWritable(obj, "property");
|
||||
|
||||
|
@ -19,4 +19,3 @@ Object.defineProperties(obj, {
|
||||
|
||||
assert(obj.hasOwnProperty("property"));
|
||||
verifyNotWritable(obj, "property");
|
||||
|
||||
|
@ -12,7 +12,9 @@ includes: [propertyHelper.js]
|
||||
|
||||
var obj = {};
|
||||
|
||||
var proto = { value: 120 };
|
||||
var proto = {
|
||||
value: 120
|
||||
};
|
||||
|
||||
Object.defineProperty(proto, "writable", {
|
||||
get: function() {
|
||||
@ -35,4 +37,3 @@ Object.defineProperties(obj, {
|
||||
|
||||
assert(obj.hasOwnProperty("property"));
|
||||
verifyNotWritable(obj, "property");
|
||||
|
||||
|
@ -22,4 +22,3 @@ Object.defineProperties(obj, {
|
||||
|
||||
assert(obj.hasOwnProperty("property"));
|
||||
verifyNotWritable(obj, "property");
|
||||
|
||||
|
@ -24,4 +24,3 @@ var func = function (a, b) {
|
||||
};
|
||||
|
||||
func();
|
||||
|
||||
|
@ -19,4 +19,3 @@ Object.defineProperties(obj, {
|
||||
|
||||
assert(obj.hasOwnProperty("property"));
|
||||
verifyNotWritable(obj, "property");
|
||||
|
||||
|
@ -19,4 +19,3 @@ Object.defineProperties(obj, {
|
||||
|
||||
assert(obj.hasOwnProperty("property"));
|
||||
verifyNotWritable(obj, "property");
|
||||
|
||||
|
@ -19,4 +19,3 @@ Object.defineProperties(obj, {
|
||||
|
||||
assert(obj.hasOwnProperty("property"));
|
||||
verifyNotWritable(obj, "property");
|
||||
|
||||
|
@ -19,4 +19,3 @@ Object.defineProperties(obj, {
|
||||
|
||||
assert(obj.hasOwnProperty("property"));
|
||||
verifyNotWritable(obj, "property");
|
||||
|
||||
|
@ -19,4 +19,3 @@ Object.defineProperties(obj, {
|
||||
|
||||
assert(obj.hasOwnProperty("property"));
|
||||
verifyNotWritable(obj, "property");
|
||||
|
||||
|
@ -26,4 +26,3 @@ verifyNotWritable(obj, "descObj");
|
||||
|
||||
var desc = Object.getOwnPropertyDescriptor(obj, "descObj");
|
||||
assert.sameValue(typeof(desc.set), "undefined")
|
||||
|
||||
|
@ -11,9 +11,15 @@ description: >
|
||||
|
||||
var data = "data";
|
||||
var descObj = new Error("test");
|
||||
descObj.description = { value: 11 };
|
||||
descObj.message = { value: 11 };
|
||||
descObj.name = { value: 11 };
|
||||
descObj.description = {
|
||||
value: 11
|
||||
};
|
||||
descObj.message = {
|
||||
value: 11
|
||||
};
|
||||
descObj.name = {
|
||||
value: 11
|
||||
};
|
||||
|
||||
var setFun = function(value) {
|
||||
data = value;
|
||||
|
@ -11,7 +11,9 @@ description: >
|
||||
var obj = {};
|
||||
var accessed = false;
|
||||
|
||||
var descObj = { enumerable: true };
|
||||
var descObj = {
|
||||
enumerable: true
|
||||
};
|
||||
|
||||
Object.defineProperties(obj, {
|
||||
prop: descObj
|
||||
|
@ -16,6 +16,7 @@ var obj = {};
|
||||
function get_func() {
|
||||
return 10;
|
||||
}
|
||||
|
||||
function set_func(value) {
|
||||
obj.setVerifyHelpProp = value;
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ var obj = {};
|
||||
function get_func() {
|
||||
return 10;
|
||||
}
|
||||
|
||||
function set_func(value) {
|
||||
obj.setVerifyHelpProp = value;
|
||||
}
|
||||
|
@ -9,9 +9,11 @@ description: >
|
||||
---*/
|
||||
|
||||
var obj = {};
|
||||
|
||||
function get_func() {
|
||||
return 10;
|
||||
}
|
||||
|
||||
function set_func() {
|
||||
return 10;
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ var obj = {};
|
||||
function get_func() {
|
||||
return 10;
|
||||
}
|
||||
|
||||
function set_func(value) {
|
||||
obj.setVerifyHelpProp = value;
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ var obj = {};
|
||||
function get_func() {
|
||||
return 10;
|
||||
}
|
||||
|
||||
function set_func(value) {
|
||||
obj.setVerifyHelpProp = value;
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ var obj = {};
|
||||
function get_func1() {
|
||||
return 10;
|
||||
}
|
||||
|
||||
function set_func1() {}
|
||||
|
||||
Object.defineProperty(obj, "foo", {
|
||||
@ -27,6 +28,7 @@ Object.defineProperty(obj, "foo", {
|
||||
function get_func2() {
|
||||
return 20;
|
||||
}
|
||||
|
||||
function set_func2(value) {
|
||||
obj.setVerifyHelpProp = value;
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ var obj = {};
|
||||
function get_func() {
|
||||
return 10;
|
||||
}
|
||||
|
||||
function set_func(value) {
|
||||
obj.setVerifyHelpProp = value;
|
||||
}
|
||||
@ -49,4 +50,3 @@ verifyWritable(obj, "foo2", "setVerifyHelpProp");
|
||||
verifyEnumerable(obj, "foo2");
|
||||
|
||||
verifyConfigurable(obj, "foo2");
|
||||
|
||||
|
@ -15,7 +15,9 @@ description: >
|
||||
});
|
||||
assert.throws(TypeError, function() {
|
||||
Object.defineProperties(arr, {
|
||||
length: { value: 1 }
|
||||
length: {
|
||||
value: 1
|
||||
}
|
||||
});
|
||||
});
|
||||
var desc = Object.getOwnPropertyDescriptor(arr, "length");
|
||||
|
@ -21,7 +21,9 @@ assert.throws(TypeError, function() {
|
||||
});
|
||||
|
||||
Object.defineProperties(arr, {
|
||||
length: { value: 1 }
|
||||
length: {
|
||||
value: 1
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -12,7 +12,9 @@ includes: [propertyHelper.js]
|
||||
|
||||
var arr = [];
|
||||
|
||||
Object.defineProperties(arr, { length: {} });
|
||||
Object.defineProperties(arr, {
|
||||
length: {}
|
||||
});
|
||||
|
||||
if (arr.length !== 0) {
|
||||
$ERROR("Expected arr.length to be 0, actually " + arr.length);
|
||||
|
@ -12,7 +12,9 @@ includes: [propertyHelper.js]
|
||||
|
||||
var arr = [];
|
||||
|
||||
Object.defineProperties(arr, { length: {} });
|
||||
Object.defineProperties(arr, {
|
||||
length: {}
|
||||
});
|
||||
|
||||
if (arr.length !== 0) {
|
||||
$ERROR("Expected arr.length to be 0, actually " + arr.length);
|
||||
|
@ -13,6 +13,8 @@ description: >
|
||||
var arr = [];
|
||||
assert.throws(TypeError, function() {
|
||||
Object.defineProperties(arr, {
|
||||
length: { configurable: true }
|
||||
length: {
|
||||
configurable: true
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -13,6 +13,8 @@ description: >
|
||||
var arr = [];
|
||||
assert.throws(TypeError, function() {
|
||||
Object.defineProperties(arr, {
|
||||
length: { enumerable: true }
|
||||
length: {
|
||||
enumerable: true
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -17,6 +17,8 @@ description: >
|
||||
});
|
||||
assert.throws(TypeError, function() {
|
||||
Object.defineProperties(arr, {
|
||||
length: { writable: true }
|
||||
length: {
|
||||
writable: true
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -14,7 +14,9 @@ includes: [propertyHelper.js]
|
||||
var arr = [];
|
||||
|
||||
Object.defineProperties(arr, {
|
||||
length: { writable: false }
|
||||
length: {
|
||||
writable: false
|
||||
}
|
||||
});
|
||||
|
||||
verifyEqualTo(arr, "length", 0);
|
||||
@ -24,4 +26,3 @@ verifyNotWritable(arr, "length");
|
||||
verifyNotEnumerable(arr, "length");
|
||||
|
||||
verifyNotConfigurable(arr, "length");
|
||||
|
||||
|
@ -12,7 +12,9 @@ description: >
|
||||
var arr = [];
|
||||
assert.throws(RangeError, function() {
|
||||
Object.defineProperties(arr, {
|
||||
length: { value: undefined }
|
||||
length: {
|
||||
value: undefined
|
||||
}
|
||||
});
|
||||
});
|
||||
assert.sameValue(arr.length, 0, 'arr.length');
|
||||
|
@ -12,7 +12,9 @@ description: >
|
||||
var arr = [0, 1];
|
||||
|
||||
Object.defineProperties(arr, {
|
||||
length: { value: null }
|
||||
length: {
|
||||
value: null
|
||||
}
|
||||
});
|
||||
|
||||
assert.sameValue(arr.length, 0, 'arr.length');
|
||||
|
@ -12,7 +12,9 @@ description: >
|
||||
var arr = [0, 1];
|
||||
|
||||
Object.defineProperties(arr, {
|
||||
length: { value: false }
|
||||
length: {
|
||||
value: false
|
||||
}
|
||||
});
|
||||
|
||||
assert.sameValue(arr.length, 0, 'arr.length');
|
||||
|
@ -12,7 +12,9 @@ description: >
|
||||
var arr = [];
|
||||
|
||||
Object.defineProperties(arr, {
|
||||
length: { value: true }
|
||||
length: {
|
||||
value: true
|
||||
}
|
||||
});
|
||||
|
||||
assert.sameValue(arr.length, 1, 'arr.length');
|
||||
|
@ -12,7 +12,9 @@ description: >
|
||||
var arr = [0, 1];
|
||||
|
||||
Object.defineProperties(arr, {
|
||||
length: { value: 0 }
|
||||
length: {
|
||||
value: 0
|
||||
}
|
||||
});
|
||||
|
||||
assert.sameValue(arr.length, 0, 'arr.length');
|
||||
|
@ -12,7 +12,9 @@ description: >
|
||||
var arr = [0, 1];
|
||||
|
||||
Object.defineProperties(arr, {
|
||||
length: { value: +0 }
|
||||
length: {
|
||||
value: +0
|
||||
}
|
||||
});
|
||||
|
||||
assert.sameValue(arr.length, 0, 'arr.length');
|
||||
|
@ -12,7 +12,9 @@ description: >
|
||||
var arr = [0, 1];
|
||||
|
||||
Object.defineProperties(arr, {
|
||||
length: { value: -0 }
|
||||
length: {
|
||||
value: -0
|
||||
}
|
||||
});
|
||||
|
||||
assert.sameValue(arr.length, 0, 'arr.length');
|
||||
|
@ -12,7 +12,9 @@ description: >
|
||||
var arr = [];
|
||||
|
||||
Object.defineProperties(arr, {
|
||||
length: { value: 12 }
|
||||
length: {
|
||||
value: 12
|
||||
}
|
||||
});
|
||||
|
||||
assert.sameValue(arr.length, 12, 'arr.length');
|
||||
|
@ -34,4 +34,3 @@ try {
|
||||
assert.sameValue(arr.length, 2);
|
||||
verifyNotWritable(arr, "length");
|
||||
}
|
||||
|
||||
|
@ -37,4 +37,3 @@ try {
|
||||
assert.sameValue(arr[1], 1);
|
||||
assert.sameValue(arr.length, 2)
|
||||
}
|
||||
|
||||
|
@ -33,4 +33,3 @@ verifyNotWritable(obj, "prop");
|
||||
verifyNotEnumerable(obj, "prop");
|
||||
|
||||
verifyConfigurable(obj, "prop");
|
||||
|
||||
|
@ -28,4 +28,3 @@ verifyNotWritable(arr, "0");
|
||||
verifyNotEnumerable(arr, "0");
|
||||
|
||||
verifyNotConfigurable(arr, "0");
|
||||
|
||||
|
@ -15,6 +15,7 @@ var arr = [];
|
||||
function get_func() {
|
||||
return 11;
|
||||
}
|
||||
|
||||
function set_func(value) {
|
||||
arr.setVerifyHelpProp = value;
|
||||
}
|
||||
@ -36,4 +37,3 @@ verifyWritable(arr, "0", "setVerifyHelpProp");
|
||||
verifyEnumerable(arr, "0");
|
||||
|
||||
verifyConfigurable(arr, "0");
|
||||
|
||||
|
@ -29,4 +29,3 @@ verifyNotWritable(arr, "0");
|
||||
verifyNotEnumerable(arr, "0");
|
||||
|
||||
verifyNotConfigurable(arr, "0");
|
||||
|
||||
|
@ -29,4 +29,3 @@ verifyNotWritable(arr, "0");
|
||||
verifyNotEnumerable(arr, "0");
|
||||
|
||||
verifyNotConfigurable(arr, "0");
|
||||
|
||||
|
@ -13,7 +13,9 @@ includes: [propertyHelper.js]
|
||||
|
||||
var arr = [];
|
||||
|
||||
var obj1 = { length: 10 };
|
||||
var obj1 = {
|
||||
length: 10
|
||||
};
|
||||
Object.defineProperty(arr, "0", {
|
||||
value: obj1
|
||||
});
|
||||
@ -32,4 +34,3 @@ verifyNotWritable(arr, "0");
|
||||
verifyNotEnumerable(arr, "0");
|
||||
|
||||
verifyNotConfigurable(arr, "0");
|
||||
|
||||
|
@ -28,4 +28,3 @@ verifyWritable(arr, "0");
|
||||
verifyNotEnumerable(arr, "0");
|
||||
|
||||
verifyNotConfigurable(arr, "0");
|
||||
|
||||
|
@ -29,4 +29,3 @@ verifyNotWritable(arr, "0");
|
||||
verifyNotEnumerable(arr, "0");
|
||||
|
||||
verifyConfigurable(arr, "0");
|
||||
|
||||
|
@ -28,4 +28,3 @@ verifyNotWritable(arr, "0");
|
||||
verifyEnumerable(arr, "0");
|
||||
|
||||
verifyNotConfigurable(arr, "0");
|
||||
|
||||
|
@ -29,4 +29,3 @@ verifyNotWritable(arr, "0");
|
||||
verifyNotEnumerable(arr, "0");
|
||||
|
||||
verifyConfigurable(arr, "0");
|
||||
|
||||
|
@ -28,4 +28,3 @@ verifyNotWritable(arr, "0");
|
||||
verifyNotEnumerable(arr, "0");
|
||||
|
||||
verifyConfigurable(arr, "0");
|
||||
|
||||
|
@ -28,4 +28,3 @@ verifyNotWritable(arr, "0");
|
||||
verifyNotEnumerable(arr, "0");
|
||||
|
||||
verifyNotConfigurable(arr, "0");
|
||||
|
||||
|
@ -14,8 +14,12 @@ includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
var arr = [];
|
||||
var obj1 = { value: 12 };
|
||||
var obj2 = { value: 36 };
|
||||
var obj1 = {
|
||||
value: 12
|
||||
};
|
||||
var obj2 = {
|
||||
value: 36
|
||||
};
|
||||
|
||||
Object.defineProperty(arr, "1", {
|
||||
value: obj1
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user