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

This commit is contained in:
Rick Waldron 2018-02-15 15:40:15 -05:00 committed by Leo Balter
parent 19ca734bea
commit e0db75f74b
19 changed files with 48 additions and 22 deletions

View File

@ -15,6 +15,7 @@ info: |
var o = {}; var o = {};
var count = 0; var count = 0;
var results, args; var results, args;
function fn() { function fn() {
count++; count++;
results = { results = {

View File

@ -13,6 +13,7 @@ info: |
---*/ ---*/
var o = {}; var o = {};
function fn() { function fn() {
return o; return o;
} }

View File

@ -15,6 +15,7 @@ info: |
var o = {}; var o = {};
var internPrototype; var internPrototype;
function fn() { function fn() {
this.o = o; this.o = o;
internPrototype = Object.getPrototypeOf(this); internPrototype = Object.getPrototypeOf(this);

View File

@ -14,6 +14,7 @@ info: |
---*/ ---*/
var o = {}; var o = {};
function fn() { function fn() {
this.o = o; this.o = o;
} }

View File

@ -17,16 +17,22 @@ o.p1 = 'foo';
assert.sameValue(Reflect.defineProperty(o, 'p1', {}), true); assert.sameValue(Reflect.defineProperty(o, 'p1', {}), true);
assert.sameValue(o.hasOwnProperty('p1'), true); assert.sameValue(o.hasOwnProperty('p1'), true);
assert.sameValue(Reflect.defineProperty(o, 'p2', {value: 42}), true); assert.sameValue(Reflect.defineProperty(o, 'p2', {
value: 42
}), true);
assert.sameValue(o.hasOwnProperty('p2'), true); assert.sameValue(o.hasOwnProperty('p2'), true);
Object.freeze(o); Object.freeze(o);
assert.sameValue(Reflect.defineProperty(o, 'p2', {value: 43}), false); assert.sameValue(Reflect.defineProperty(o, 'p2', {
value: 43
}), false);
assert.sameValue(o.p2, 42); assert.sameValue(o.p2, 42);
assert.sameValue(Reflect.defineProperty(o, 'p3', {}), false); assert.sameValue(Reflect.defineProperty(o, 'p3', {}), false);
assert.sameValue(o.hasOwnProperty('p4'), false); assert.sameValue(o.hasOwnProperty('p4'), false);
assert.sameValue(Reflect.defineProperty(o, 'p4', {value: 1}), false); assert.sameValue(Reflect.defineProperty(o, 'p4', {
value: 1
}), false);
assert.sameValue(o.hasOwnProperty('p4'), false); assert.sameValue(o.hasOwnProperty('p4'), false);

View File

@ -55,7 +55,9 @@ assert.sameValue(
'Return Call(getter, Receiver)' 'Return Call(getter, Receiver)'
); );
var o2 = Object.create({p: 42}); var o2 = Object.create({
p: 42
});
assert.sameValue( assert.sameValue(
Reflect.get(o2, 'p'), 42, Reflect.get(o2, 'p'), 42,
'Return value from prototype without own property.' 'Return value from prototype without own property.'

View File

@ -46,8 +46,7 @@ var result = Reflect.getOwnPropertyDescriptor(o1, 'p');
assert( assert(
compareArray( compareArray(
Object.keys(result), Object.keys(result), ['get', 'set', 'enumerable', 'configurable']
['get', 'set', 'enumerable', 'configurable']
) )
); );
assert.sameValue(result.enumerable, false); assert.sameValue(result.enumerable, false);

View File

@ -22,8 +22,7 @@ var result = Reflect.getOwnPropertyDescriptor(o1, 'p');
assert( assert(
compareArray( compareArray(
Object.keys(result), Object.keys(result), ['value', 'writable', 'enumerable', 'configurable']
['value', 'writable', 'enumerable', 'configurable']
) )
); );
assert.sameValue(result.value, 'foo'); assert.sameValue(result.value, 'foo');

View File

@ -29,8 +29,7 @@ var result = Reflect.getOwnPropertyDescriptor(o, s);
assert( assert(
compareArray( compareArray(
Object.keys(result), Object.keys(result), ['value', 'writable', 'enumerable', 'configurable']
['value', 'writable', 'enumerable', 'configurable']
) )
); );
assert.sameValue(result.value, 42); assert.sameValue(result.value, 42);

View File

@ -17,7 +17,9 @@ info: |
1. If Desc is undefined, return undefined. 1. If Desc is undefined, return undefined.
---*/ ---*/
var o = Object.create({p: 1}); var o = Object.create({
p: 1
});
var result = Reflect.getOwnPropertyDescriptor(o, 'p'); var result = Reflect.getOwnPropertyDescriptor(o, 'p');
assert.sameValue(result, undefined); assert.sameValue(result, undefined);

View File

@ -13,7 +13,10 @@ info: |
var valid = {}; var valid = {};
var o = Object.create(valid, { var o = Object.create(valid, {
prototype: {value: 'invalid', enumerable: true} prototype: {
value: 'invalid',
enumerable: true
}
}); });
assert.sameValue( assert.sameValue(

View File

@ -33,5 +33,7 @@ assert.sameValue(
'false when property is not present' 'false when property is not present'
); );
var o2 = Object.create({p: 42}); var o2 = Object.create({
p: 42
});
assert.sameValue(Reflect.has(o2, 'p'), true, 'true from a prototype property'); assert.sameValue(Reflect.has(o2, 'p'), true, 'true from a prototype property');

View File

@ -16,6 +16,8 @@ includes: [compareArray.js]
assert(compareArray(Reflect.ownKeys({}), [])); assert(compareArray(Reflect.ownKeys({}), []));
var o = {d: 42}; var o = {
d: 42
};
delete o.d; delete o.d;
assert(compareArray(Reflect.ownKeys(o), [])); assert(compareArray(Reflect.ownKeys(o), []));

View File

@ -20,7 +20,7 @@ assert(
); );
assert( assert(
compareArray(Reflect.ownKeys([,,2]), ['2', 'length']), compareArray(Reflect.ownKeys([, , 2]), ['2', 'length']),
'return array keys' 'return array keys'
); );

View File

@ -75,4 +75,3 @@ assert.sameValue(
verifyWritable(receiver, 'p'); verifyWritable(receiver, 'p');
verifyEnumerable(receiver, 'p'); verifyEnumerable(receiver, 'p');
verifyConfigurable(receiver, 'p'); verifyConfigurable(receiver, 'p');

View File

@ -52,7 +52,9 @@ assert.sameValue(
); );
assert.sameValue(o1.hasOwnProperty('p'), false, 'target.p is not set'); assert.sameValue(o1.hasOwnProperty('p'), false, 'target.p is not set');
var o2 = {p: 43}; var o2 = {
p: 43
};
result = Reflect.set(o2, 'p', 42, receiver); result = Reflect.set(o2, 'p', 42, receiver);
assert.sameValue( assert.sameValue(
result, false, result, false,

View File

@ -29,7 +29,9 @@ info: |
... ...
---*/ ---*/
var o1 = {p: 42}; var o1 = {
p: 42
};
var receiver = 'receiver is a string'; var receiver = 'receiver is a string';
var result = Reflect.set(o1, 'p', 43, receiver); var result = Reflect.set(o1, 'p', 43, receiver);

View File

@ -42,4 +42,3 @@ assert.sameValue(
assert.sameValue(args.length, 1, 'target.p set is called with 1 argument'); assert.sameValue(args.length, 1, 'target.p set is called with 1 argument');
assert.sameValue(args[0], 42, 'target.p set is called with V'); assert.sameValue(args[0], 42, 'target.p set is called with V');
assert.sameValue(count, 1, 'target.p set is called once'); assert.sameValue(count, 1, 'target.p set is called once');

View File

@ -30,7 +30,9 @@ info: |
... ...
---*/ ---*/
var o1 = {p: 43}; var o1 = {
p: 43
};
var result = Reflect.set(o1, 'p', 42); var result = Reflect.set(o1, 'p', 42);
assert.sameValue(result, true, 'returns true on a successful setting'); assert.sameValue(result, true, 'returns true on a successful setting');
assert.sameValue( assert.sameValue(
@ -38,8 +40,12 @@ assert.sameValue(
'sets the new value' 'sets the new value'
); );
var o2 = {p: 43}; var o2 = {
var receiver = {p: 44}; p: 43
};
var receiver = {
p: 44
};
var result = Reflect.set(o2, 'p', 42, receiver); var result = Reflect.set(o2, 'p', 42, receiver);
assert.sameValue(result, true, 'returns true on a successful setting'); assert.sameValue(result, true, 'returns true on a successful setting');
assert.sameValue(o2.p, 43, 'with a receiver, does not set a value on target'); assert.sameValue(o2.p, 43, 'with a receiver, does not set a value on target');