Whitespace

This commit is contained in:
Leo Balter 2018-03-09 10:31:38 -05:00
parent 2576b60364
commit dd147e5052
10 changed files with 45 additions and 61 deletions

View File

@ -30,15 +30,15 @@ var obj = {
[Symbol.iterator]() { [Symbol.iterator]() {
return { return {
next() { next() {
return { value: 1, done: false }; return { value: 1, done: false };
}, },
throw() { throw() {
return { return {
get done() { get done() {
throw thrownError; throw thrownError;
}, },
value: 1 value: 1
} };
} }
}; };
} }
@ -60,8 +60,8 @@ iter.next().then(function(result) {
assert.sameValue(err, thrownError, "Promise should be rejected with thrown error"); assert.sameValue(err, thrownError, "Promise should be rejected with thrown error");
iter.next().then(({ done, value }) => { iter.next().then(({ done, value }) => {
assert.sameValue(done, true, 'the iterator is completed'); assert.sameValue(done, true, 'the iterator is completed');
assert.sameValue(value, undefined, 'value is undefined'); assert.sameValue(value, undefined, 'value is undefined');
}).then($DONE, $DONE); }).then($DONE, $DONE);
} }
).catch($DONE); ).catch($DONE);

View File

@ -30,15 +30,15 @@ var obj = {
[Symbol.iterator]() { [Symbol.iterator]() {
return { return {
next() { next() {
return { value: 1, done: false }; return { value: 1, done: false };
}, },
throw() { throw() {
return { return {
get value() { get value() {
throw thrownError; throw thrownError;
}, },
done: false done: false
} };
} }
} }
} }
@ -60,8 +60,8 @@ iter.next().then(function(result) {
assert.sameValue(err, thrownError, "Promise should be rejected with thrown error"); assert.sameValue(err, thrownError, "Promise should be rejected with thrown error");
iter.next().then(({ done, value }) => { iter.next().then(({ done, value }) => {
assert.sameValue(done, true, 'the iterator is completed'); assert.sameValue(done, true, 'the iterator is completed');
assert.sameValue(value, undefined, 'value is undefined'); assert.sameValue(value, undefined, 'value is undefined');
}).then($DONE, $DONE); }).then($DONE, $DONE);
} }
).catch($DONE); ).catch($DONE);

View File

@ -33,13 +33,13 @@ var obj = {
[Symbol.iterator]() { [Symbol.iterator]() {
return { return {
next() { next() {
return { value: 1, done: false }; return { value: 1, done: false };
}, },
throw() { throw() {
return { return {
value: Promise.resolve(42), value: Promise.resolve(42),
done: true done: true
}; };
} }
}; };
} }
@ -57,8 +57,8 @@ iter.next().then(function (result) {
assert.sameValue(result.value, 42, "Result.value should be unwrapped, got: " + result.value); assert.sameValue(result.value, 42, "Result.value should be unwrapped, got: " + result.value);
iter.next().then(({ done, value }) => { iter.next().then(({ done, value }) => {
assert.sameValue(done, true, 'the iterator is completed'); assert.sameValue(done, true, 'the iterator is completed');
assert.sameValue(value, undefined, 'value is undefined'); assert.sameValue(value, undefined, 'value is undefined');
}).then($DONE, $DONE); }).then($DONE, $DONE);
} }
).catch($DONE); ).catch($DONE);

View File

@ -50,8 +50,8 @@ iter.next().then(function(result) {
assert.sameValue(err, thrownError, "promise should be reject with custom error, got: " + err) assert.sameValue(err, thrownError, "promise should be reject with custom error, got: " + err)
iter.next().then(({ done, value }) => { iter.next().then(({ done, value }) => {
assert.sameValue(done, true, 'the iterator is completed'); assert.sameValue(done, true, 'the iterator is completed');
assert.sameValue(value, undefined, 'value is undefined'); assert.sameValue(value, undefined, 'value is undefined');
}).then($DONE, $DONE); }).then($DONE, $DONE);
} }
).catch($DONE); ).catch($DONE);

View File

@ -24,12 +24,12 @@ var obj = {
[Symbol.iterator]() { [Symbol.iterator]() {
return { return {
next() { next() {
return { value: 1, done: false }; return { value: 1, done: false };
}, },
get throw() { get throw() {
throw thrownError; throw thrownError;
} }
} };
} }
}; };
@ -49,11 +49,10 @@ iter.next().then(function(result) {
assert.sameValue(err, thrownError, "Promise should be rejected with thrown error"); assert.sameValue(err, thrownError, "Promise should be rejected with thrown error");
iter.next().then(({ done, value }) => { iter.next().then(({ done, value }) => {
assert.sameValue(done, true, 'the iterator is completed'); assert.sameValue(done, true, 'the iterator is completed');
assert.sameValue(value, undefined, 'value is undefined'); assert.sameValue(value, undefined, 'value is undefined');
}).then($DONE, $DONE); }).then($DONE, $DONE);
} }
).catch($DONE); ).catch($DONE);
}).catch($DONE); }).catch($DONE);

View File

@ -27,10 +27,10 @@ var obj = {
[Symbol.iterator]() { [Symbol.iterator]() {
return { return {
next() { next() {
return { value: 1, done: false }; return { value: 1, done: false };
}, },
throw() { throw() {
throw thrownError; throw thrownError;
} }
}; };
} }
@ -52,10 +52,9 @@ iter.next().then(function(result) {
assert.sameValue(err, thrownError, "Promise should be rejected with thrown error"); assert.sameValue(err, thrownError, "Promise should be rejected with thrown error");
iter.next().then(({ done, value }) => { iter.next().then(({ done, value }) => {
assert.sameValue(done, true, 'the iterator is completed'); assert.sameValue(done, true, 'the iterator is completed');
assert.sameValue(value, undefined, 'value is undefined'); assert.sameValue(value, undefined, 'value is undefined');
}).then($DONE, $DONE); }).then($DONE, $DONE);
} }
).catch($DONE); ).catch($DONE);
}).catch($DONE); }).catch($DONE);

View File

@ -28,10 +28,10 @@ var obj = {
[Symbol.iterator]() { [Symbol.iterator]() {
return { return {
next() { next() {
return { value: 1, done: false }; return { value: 1, done: false };
}, },
throw() { throw() {
return 1; return 1;
} }
}; };
} }
@ -54,8 +54,8 @@ iter.next().then(function(result) {
assert(typeerror, "Expect TypeError, got: " + err); assert(typeerror, "Expect TypeError, got: " + err);
iter.next().then(({ done, value }) => { iter.next().then(({ done, value }) => {
assert.sameValue(done, true, 'the iterator is completed'); assert.sameValue(done, true, 'the iterator is completed');
assert.sameValue(value, undefined, 'value is undefined'); assert.sameValue(value, undefined, 'value is undefined');
}).then($DONE, $DONE); }).then($DONE, $DONE);
} }
).catch($DONE); ).catch($DONE);

View File

@ -23,7 +23,7 @@ var obj = {
[Symbol.iterator]() { [Symbol.iterator]() {
return { return {
next() { next() {
return { value: 1, done: false }; return { value: 1, done: false };
} }
}; };
} }
@ -36,7 +36,6 @@ async function* asyncg() {
var iter = asyncg(); var iter = asyncg();
iter.next().then(function(result) { iter.next().then(function(result) {
iter.throw().then( iter.throw().then(
function (result) { function (result) {
throw new Test262Error("Promise should be rejected, got: " + result.value); throw new Test262Error("Promise should be rejected, got: " + result.value);
@ -45,11 +44,10 @@ iter.next().then(function(result) {
assert.sameValue(err, undefined, "Promise should be rejected with undefined"); assert.sameValue(err, undefined, "Promise should be rejected with undefined");
iter.next().then(({ done, value }) => { iter.next().then(({ done, value }) => {
assert.sameValue(done, true, 'the iterator is completed'); assert.sameValue(done, true, 'the iterator is completed');
assert.sameValue(value, undefined, 'value is undefined'); assert.sameValue(value, undefined, 'value is undefined');
}).then($DONE, $DONE); }).then($DONE, $DONE);
} }
).catch($DONE); ).catch($DONE);
}).catch($DONE); }).catch($DONE);

View File

@ -22,12 +22,6 @@ features: [TypedArray]
var buffer = new ArrayBuffer(1); var buffer = new ArrayBuffer(1);
testWithTypedArrayConstructors(function(TA) { testWithTypedArrayConstructors(function(TA) {
// Exclude 8 bit buffers from this tests, as their elementSize = 1
if ( TA.name.indexOf("8") > -1 ) {
return;
}
assert.throws(RangeError, function() { assert.throws(RangeError, function() {
new TA(buffer); new TA(buffer);
}); });
@ -35,4 +29,4 @@ testWithTypedArrayConstructors(function(TA) {
assert.throws(RangeError, function() { assert.throws(RangeError, function() {
new TA(buffer, 0, undefined); new TA(buffer, 0, undefined);
}); });
}); }, [ Float64Array, Float32Array, Int32Array, Int16Array, Uint32Array, Uint16Array ]);

View File

@ -21,13 +21,7 @@ features: [TypedArray]
var buffer = new ArrayBuffer(8); var buffer = new ArrayBuffer(8);
testWithTypedArrayConstructors(function(TA) { testWithTypedArrayConstructors(function(TA) {
// Exclude 8 bit buffers from this tests, as their elementSize = 1
if ( TA.name.indexOf("8") > -1 ) {
return;
}
assert.throws(RangeError, function() { assert.throws(RangeError, function() {
new TA(buffer, 7); new TA(buffer, 7);
}); });
}); }, [ Float64Array, Float32Array, Int32Array, Int16Array, Uint32Array, Uint16Array ]);