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');
}
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)) {

View File

@ -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") {

View File

@ -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') {

View File

@ -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') {

View File

@ -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;
};

View File

@ -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);

View File

@ -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);

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');
}
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');
}
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) {

View File

@ -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) {

View File

@ -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);

View File

@ -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'.");

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
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}.");

View File

@ -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.");

View File

@ -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
});
});

View File

@ -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.");

View File

@ -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}.");

View File

@ -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'.");

View File

@ -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)'.");

View File

@ -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
});
});

View File

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

View File

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

View File

@ -21,5 +21,7 @@ Object.defineProperty(target, 'attr', {
});
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() {
Object.assign(target, { attr: 1 });
Object.assign(target, {
attr: 1
});
});

View File

@ -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)');

View File

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

View File

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

View File

@ -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;

View File

@ -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", {

View File

@ -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: {

View File

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

View File

@ -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";

View File

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

View File

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

View File

@ -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;

View File

@ -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: {

View File

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

View File

@ -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";

View File

@ -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";

View File

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

View File

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

View File

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

View File

@ -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 = {

View File

@ -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,

View File

@ -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) {

View File

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

View File

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

View File

@ -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');

View File

@ -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');

View File

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

View File

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

View File

@ -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");

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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;
}

View File

@ -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");

View File

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

View File

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

View File

@ -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);

View File

@ -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);

View File

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

View File

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

View File

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

View File

@ -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");

View File

@ -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');

View File

@ -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');

View File

@ -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');

View File

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

View File

@ -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');

View File

@ -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');

View File

@ -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');

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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");

View File

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

View File

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

View File

@ -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");

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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