Transform legacy format to harness assertions: test/built-ins/P*/**/*.js

This commit is contained in:
rwaldron 2021-08-18 11:44:54 -04:00 committed by Leo Balter
parent 717bcbaedd
commit 2a385983b1
46 changed files with 127 additions and 209 deletions

View File

@ -7,7 +7,4 @@ es6id: 25.4.4.1_A1.1_T1
author: Sam Mikes
description: Promise.all is callable
---*/
if ((typeof Promise.all) !== "function") {
throw new Test262Error('Expected Promise.all to be a function');
}
assert.sameValue(typeof Promise.all, "function", 'The value of `typeof Promise.all` is expected to be "function"');

View File

@ -9,6 +9,4 @@ description: Promise.all returns a Promise
---*/
var p = Promise.all([]);
if (!(p instanceof Promise)) {
throw new Test262Error('Expected p to be a Promise');
}
assert(!!(p instanceof Promise), 'The value of !!(p instanceof Promise) is expected to be true');

View File

@ -12,7 +12,5 @@ flags: [async]
var arg = [];
Promise.all(arg).then(function(result) {
if (!(result instanceof Array)) {
throw new Test262Error("expected an array from Promise.all, got " + result);
}
assert(!!(result instanceof Array), 'The value of !!(result instanceof Array) is expected to be true');
}).then($DONE, $DONE);

View File

@ -12,7 +12,5 @@ flags: [async]
var arg = [];
Promise.all(arg).then(function(result) {
if (result.length !== 0) {
throw new Test262Error("expected an empty array from Promise.all([]), got " + result);
}
assert.sameValue(result.length, 0, 'The value of result.length is expected to be 0');
}).then($DONE, $DONE);

View File

@ -12,7 +12,5 @@ flags: [async]
var arg = [];
Promise.all(arg).then(function(result) {
if (result === arg) {
throw new Test262Error("expected a new array from Promise.all but argument was re-used");
}
assert.notSameValue(result, arg, 'The value of result is expected to not equal the value of `arg`');
}).then($DONE, $DONE);

View File

@ -17,7 +17,5 @@ var nonIterable = 3;
Promise.all(nonIterable).then(function() {
throw new Test262Error('Promise unexpectedly resolved: Promise.all(nonIterable) should throw TypeError');
}, function(err) {
if (!(err instanceof TypeError)) {
throw new Test262Error('Expected TypeError, got ' + err);
}
assert(!!(err instanceof TypeError), 'The value of !!(err instanceof TypeError) is expected to be true');
}).then($DONE, $DONE);

View File

@ -16,7 +16,5 @@ flags: [async]
Promise.all(new Error("abrupt")).then(function() {
throw new Test262Error('Promise unexpectedly resolved: Promise.all(abruptCompletion) should throw TypeError');
}, function(err) {
if (!(err instanceof TypeError)) {
throw new Test262Error('Expected TypeError, got ' + err);
}
assert(!!(err instanceof TypeError), 'The value of !!(err instanceof TypeError) is expected to be true');
}).then($DONE, $DONE);

View File

@ -22,7 +22,5 @@ Object.defineProperty(iterThrows, Symbol.iterator, {
Promise.all(iterThrows).then(function() {
throw new Test262Error('Promise unexpectedly fulfilled: Promise.all(iterThrows) should throw TypeError');
}, function(err) {
if (!(err instanceof Error)) {
throw new Test262Error('Expected promise to be rejected with error, got ' + err);
}
assert(!!(err instanceof Error), 'The value of !!(err instanceof Error) is expected to be true');
}).then($DONE, $DONE);

View File

@ -25,5 +25,5 @@ iterThrows[Symbol.iterator] = function() {
Promise.all(iterThrows).then(function() {
throw new Test262Error('Promise unexpectedly resolved: Promise.all(iterThrows) should throw TypeError');
}, function(reason) {
assert.sameValue(reason, error);
assert.sameValue(reason, error, 'The value of reason is expected to equal the value of error');
}).then($DONE, $DONE);

View File

@ -16,16 +16,8 @@ var p1 = Promise.resolve(3);
var pAll = Promise.all([p1]);
pAll.then(function(result) {
if (!(pAll instanceof Promise)) {
throw new Test262Error("Expected Promise.all() to be promise, actually " + pAll);
}
if (!(result instanceof Array)) {
throw new Test262Error("Expected Promise.all() to be promise for an Array, actually " + result);
}
if (result.length !== 1) {
throw new Test262Error("Expected Promise.all([p1]) to be a promise for one-element Array, actually " + result);
}
if (result[0] !== 3) {
throw new Test262Error("Expected result[0] to be 3, actually " + result[0]);
}
assert(!!(pAll instanceof Promise), 'The value of !!(pAll instanceof Promise) is expected to be true');
assert(!!(result instanceof Array), 'The value of !!(result instanceof Array) is expected to be true');
assert.sameValue(result.length, 1, 'The value of result.length is expected to be 1');
assert.sameValue(result[0], 3, 'The value of result[0] is expected to be 3');
}).then($DONE, $DONE);

View File

@ -19,9 +19,7 @@ var rejectP1,
Promise.all([p1, p2]).then(function(resolve) {
throw new Test262Error("Did not expect promise to be fulfilled.");
}, function(rejected) {
if (rejected !== 1) {
throw new Test262Error("Expected promise to be rejected with 1, actually " + rejected);
}
assert.sameValue(rejected, 1, 'The value of rejected is expected to be 1');
}).then($DONE, $DONE);
rejectP1(1);

View File

@ -19,9 +19,7 @@ var rejectP2,
Promise.all([p1, p2]).then(function() {
throw new Test262Error("Did not expect promise to be fulfilled.");
}, function(rejected) {
if (rejected !== 2) {
throw new Test262Error("Expected promise to be rejected with 2, actually " + rejected);
}
assert.sameValue(rejected, 2, 'The value of rejected is expected to be 2');
}).then($DONE, $DONE);
rejectP2(2);

View File

@ -9,7 +9,8 @@ es6id: S25.4.4.2_A1.1_T1
author: Sam Mikes
description: Promise prototype exists
---*/
if (Promise.prototype === undefined) {
throw new Test262Error("Expected Promise.prototype to be defined.");
}
assert.notSameValue(
Promise.prototype,
undefined,
'The value of Promise.prototype is expected to not equal ``undefined``'
);

View File

@ -8,7 +8,8 @@ es6id: S25.4.5_A3.1_T1
author: Sam Mikes
description: Promise.prototype.constructor is the Promise constructor
---*/
if (Promise.prototype.constructor !== Promise) {
throw new Test262Error("Expected Promise.prototype.constructor to be Promise");
}
assert.sameValue(
Promise.prototype.constructor,
Promise,
'The value of Promise.prototype.constructor is expected to equal the value of Promise'
);

View File

@ -8,7 +8,7 @@ es6id: S25.4.5.1_A1.1_T1
author: Sam Mikes
description: Promise.prototype.catch is a function
---*/
if (!(Promise.prototype.catch instanceof Function)) {
throw new Test262Error("Expected Promise.prototype.catch to be a function");
}
assert(
!!(Promise.prototype.catch instanceof Function),
'The value of !!(Promise.prototype.catch instanceof Function) is expected to be true'
);

View File

@ -11,6 +11,7 @@ description: catch is a method on a Promise
var p = Promise.resolve(3);
if (!(p.catch instanceof Function)) {
throw new Test262Error("Expected p.catch to be a function");
}
assert(
!!(p.catch instanceof Function),
'The value of !!(p.catch instanceof Function) is expected to be true'
);

View File

@ -10,14 +10,12 @@ description: catch is implemented in terms of then
flags: [async]
---*/
var obj = {};
var arg = {};
var p = Promise.resolve(obj);
var p = Promise.resolve(arg);
p.catch(function() {
throw new Test262Error("Should not be called - promise is fulfilled");
}).then(function(arg) {
if (arg !== obj) {
throw new Test262Error("Expected promise to be fulfilled with obj, got " + arg);
}
}).then(function(result) {
assert.sameValue(result, arg, 'The value of result is expected to equal the value of arg');
}).then($DONE, $DONE);

View File

@ -10,14 +10,12 @@ description: catch is implemented in terms of then
flags: [async]
---*/
var obj = {};
var arg = {};
var p = Promise.reject(obj);
var p = Promise.reject(arg);
p.then(function() {
throw new Test262Error("Should not be called: did not expect promise to be fulfilled");
}).catch(function(arg) {
if (arg !== obj) {
throw new Test262Error("Should have been rejected with reason obj, got " + arg);
}
}).catch(function(result) {
assert.sameValue(result, arg, 'The value of result is expected to equal the value of arg');
}).then($DONE, $DONE);

View File

@ -8,7 +8,7 @@ es6id: S25.4.5.3_A1.1_T1
author: Sam Mikes
description: Promise.prototype.then is a function of two arguments
---*/
if (!(Promise.prototype.then instanceof Function)) {
throw new Test262Error("Expected Promise.prototype.then to be a function");
}
assert(
!!(Promise.prototype.then instanceof Function),
'The value of !!(Promise.prototype.then instanceof Function) is expected to be true'
);

View File

@ -11,10 +11,5 @@ description: Promise.prototype.then is a function of two arguments
var p = new Promise(function() {});
if (!(p.then instanceof Function)) {
throw new Test262Error("Expected p.then to be a function");
}
if (p.then.length !== 2) {
throw new Test262Error("Expected p.then to be a function of two arguments");
}
assert(!!(p.then instanceof Function), 'The value of !!(p.then instanceof Function) is expected to be true');
assert.sameValue(p.then.length, 2, 'The value of p.then.length is expected to be 2');

View File

@ -11,12 +11,10 @@ description: Promise.prototype.then accepts 'undefined' as arg1, arg2
flags: [async]
---*/
var obj = {};
var p = Promise.resolve(obj);
var arg = {};
var p = Promise.resolve(arg);
p.then(undefined, undefined)
.then(function(arg) {
if (arg !== obj) {
throw new Test262Error("Expected resolution object to be passed through, got " + arg);
}
}).then($DONE, $DONE);
.then(function(result) {
assert.sameValue(result, arg, 'The value of result is expected to equal the value of arg');
}).then($DONE, $DONE);

View File

@ -11,13 +11,11 @@ description: Promise.prototype.then accepts 'undefined' as arg1, arg2
flags: [async]
---*/
var obj = {};
var p = Promise.reject(obj);
var arg = {};
var p = Promise.reject(arg);
p.then(undefined, undefined).then(function() {
throw new Test262Error("Should not be called -- promise was rejected.");
}, function(arg) {
if (arg !== obj) {
throw new Test262Error("Expected resolution object to be passed through, got " + arg);
}
}, function(result) {
assert.sameValue(result, arg, 'The value of result is expected to equal the value of arg');
}).then($DONE, $DONE);

View File

@ -11,12 +11,10 @@ description: Promise.prototype.then treats non-callable arg1, arg2 as undefined
flags: [async]
---*/
var obj = {};
var p = Promise.resolve(obj);
var arg = {};
var p = Promise.resolve(arg);
p.then(3, 5)
.then(function(arg) {
if (arg !== obj) {
throw new Test262Error("Expected resolution object to be passed through, got " + arg);
}
}).then($DONE, $DONE);
.then(function(result) {
assert.sameValue(result, arg, 'The value of result is expected to equal the value of arg');
}).then($DONE, $DONE);

View File

@ -11,13 +11,11 @@ description: Promise.prototype.then treats non-callable arg1, arg2 as undefined
flags: [async]
---*/
var obj = {};
var p = Promise.reject(obj);
var arg = {};
var p = Promise.reject(arg);
p.then(3, 5).then(function() {
throw new Test262Error("Should not be called -- promise was rejected.");
}, function(arg) {
if (arg !== obj) {
throw new Test262Error("Expected resolution object to be passed through, got " + arg);
}
}, function(result) {
assert.sameValue(result, arg, 'The value of result is expected to equal the value of arg');
}).then($DONE, $DONE);

View File

@ -26,7 +26,7 @@ p.then(function() {
throw new Test262Error("Should not be called -- Promise rejected.");
}, function() {
sequence.push(3);
assert.sameValue(sequence.length, 3);
assert.sameValue(sequence.length, 3, 'The value of sequence.length is expected to be 3');
checkSequence(sequence, "Should be first");
}).catch($DONE);
@ -36,12 +36,12 @@ Promise.resolve().then(function() {
throw new Test262Error("Should not be called (2) -- Promise rejected.");
}, function() {
sequence.push(5);
assert.sameValue(sequence.length, 5);
assert.sameValue(sequence.length, 5, 'The value of sequence.length is expected to be 5');
checkSequence(sequence, "Should be third");
}).then($DONE, $DONE);
sequence.push(4);
assert.sameValue(sequence.length, 4);
assert.sameValue(sequence.length, 4, 'The value of sequence.length is expected to be 4');
checkSequence(sequence, "Should be second");
}).catch($DONE);

View File

@ -7,7 +7,4 @@ es6id: S25.4.4.3_A1.1_T1
author: Sam Mikes
description: Promise.race is callable
---*/
if (typeof Promise.race !== "function") {
throw new Test262Error("Expected Promise.race to be a function, actually " + typeof Promise.race);
}
assert.sameValue(typeof Promise.race, "function", 'The value of `typeof Promise.race` is expected to be "function"');

View File

@ -10,6 +10,4 @@ description: Promise.race returns a new promise
var p = Promise.race([]);
if (!(p instanceof Promise)) {
throw new Test262Error("Expected Promise.race([]) to return a promise.");
}
assert(!!(p instanceof Promise), 'The value of !!(p instanceof Promise) is expected to be true');

View File

@ -14,7 +14,5 @@ var nonIterable = 3;
Promise.race(nonIterable).then(function() {
throw new Test262Error('Promise unexpectedly fulfilled: Promise.race(nonIterable) should throw TypeError');
}, function(err) {
if (!(err instanceof TypeError)) {
throw new Test262Error('Expected TypeError, got ' + err);
}
assert(!!(err instanceof TypeError), 'The value of !!(err instanceof TypeError) is expected to be true');
}).then($DONE, $DONE);

View File

@ -12,7 +12,5 @@ flags: [async]
Promise.race(new Error("abrupt")).then(function() {
throw new Test262Error('Promise unexpectedly resolved: Promise.race(abruptCompletion) should throw TypeError');
}, function(err) {
if (!(err instanceof TypeError)) {
throw new Test262Error('Expected TypeError, got ' + err);
}
assert(!!(err instanceof TypeError), 'The value of !!(err instanceof TypeError) is expected to be true');
}).then($DONE, $DONE);

View File

@ -23,7 +23,5 @@ Object.defineProperty(iterThrows, Symbol.iterator, {
Promise.race(iterThrows).then(function() {
throw new Test262Error('Promise unexpectedly fulfilled: Promise.race(iterThrows) should throw');
}, function(err) {
if (!(err instanceof Error)) {
throw new Test262Error('Expected Promise to be rejected with an error, got ' + err);
}
assert(!!(err instanceof Error), 'The value of !!(err instanceof Error) is expected to be true');
}).then($DONE, $DONE);

View File

@ -22,5 +22,5 @@ iterThrows[Symbol.iterator] = function() {
Promise.race(iterThrows).then(function() {
throw new Test262Error('Promise unexpectedly fulfilled: Promise.race(iterThrows) should throw TypeError');
}, function(reason) {
assert.sameValue(reason, error);
assert.sameValue(reason, error, 'The value of reason is expected to equal the value of error');
}).then($DONE, $DONE);

View File

@ -29,7 +29,5 @@ Object.defineProperty(iterThrows, Symbol.iterator, {
Promise.race(iterThrows).then(function() {
throw new Test262Error('Promise unexpectedly fulfilled: Promise.race(iterThrows) should throw TypeError');
}, function(err) {
if (!(err instanceof TypeError)) {
throw new Test262Error('Expected TypeError, got ' + err);
}
assert(!!(err instanceof TypeError), 'The value of !!(err instanceof TypeError) is expected to be true');
}).then($DONE, $DONE);

View File

@ -20,17 +20,17 @@ p.then(function() {
throw new Test262Error("Should not fulfill.");
}, function() {
sequence.push(4);
assert.sameValue(sequence.length, 4);
assert.sameValue(sequence.length, 4, 'The value of sequence.length is expected to be 4');
checkSequence(sequence, "This happens second");
}).catch($DONE);
Promise.resolve().then(function() {
sequence.push(3);
assert.sameValue(sequence.length, 3);
assert.sameValue(sequence.length, 3, 'The value of sequence.length is expected to be 3');
checkSequence(sequence, "This happens first");
}).then(function() {
sequence.push(5);
assert.sameValue(sequence.length, 5);
assert.sameValue(sequence.length, 5, 'The value of sequence.length is expected to be 5');
checkSequence(sequence, "This happens third");
}).then($DONE, $DONE);

View File

@ -17,23 +17,21 @@ var p1 = Promise.resolve(1),
sequence.push(1);
p.then(function(arg) {
if (arg !== 1) {
throw new Test262Error("Expected promise to be fulfilled with 1, got " + arg);
}
p.then(function(result) {
assert.sameValue(result, 1, 'The value of result is expected to be 1');
sequence.push(4);
assert.sameValue(sequence.length, 4);
assert.sameValue(sequence.length, 4, 'The value of sequence.length is expected to be 4');
checkSequence(sequence, "This happens second");
}).catch($DONE);
Promise.resolve().then(function() {
sequence.push(3);
assert.sameValue(sequence.length, 3);
assert.sameValue(sequence.length, 3, 'The value of sequence.length is expected to be 3');
checkSequence(sequence, "This happens first");
}).then(function() {
sequence.push(5);
assert.sameValue(sequence.length, 5);
assert.sameValue(sequence.length, 5, 'The value of sequence.length is expected to be 5');
checkSequence(sequence, "This happens third");
}).then($DONE, $DONE);

View File

@ -17,23 +17,21 @@ var p1 = Promise.resolve(1),
sequence.push(1);
p.then(function(arg) {
if (arg !== 1) {
throw new Test262Error("Expected promise to be fulfilled with 1, got " + arg);
}
p.then(function(result) {
assert.sameValue(result, 1, 'The value of result is expected to be 1');
sequence.push(4);
assert.sameValue(sequence.length, 4);
assert.sameValue(sequence.length, 4, 'The value of sequence.length is expected to be 4');
checkSequence(sequence, "This happens second");
}).catch($DONE);
Promise.resolve().then(function() {
sequence.push(3);
assert.sameValue(sequence.length, 3);
assert.sameValue(sequence.length, 3, 'The value of sequence.length is expected to be 3');
checkSequence(sequence, "This happens first");
}).then(function() {
sequence.push(5);
assert.sameValue(sequence.length, 5);
assert.sameValue(sequence.length, 5, 'The value of sequence.length is expected to be 5');
checkSequence(sequence, "This happens third");
}).then($DONE, $DONE);

View File

@ -17,23 +17,21 @@ var p1 = new Promise(function() {}),
sequence.push(1);
p.then(function(arg) {
if (arg !== 2) {
throw new Test262Error("Expected promise to be fulfilled with 2, got " + arg);
}
p.then(function(result) {
assert.sameValue(result, 2, 'The value of result is expected to be 2');
sequence.push(4);
assert.sameValue(sequence.length, 4);
assert.sameValue(sequence.length, 4, 'The value of sequence.length is expected to be 4');
checkSequence(sequence, "This happens second");
}).catch($DONE);
Promise.resolve().then(function() {
sequence.push(3);
assert.sameValue(sequence.length, 3);
assert.sameValue(sequence.length, 3, 'The value of sequence.length is expected to be 3');
checkSequence(sequence, "This happens first");
}).then(function() {
sequence.push(5);
assert.sameValue(sequence.length, 5);
assert.sameValue(sequence.length, 5, 'The value of sequence.length is expected to be 5');
checkSequence(sequence, "This happens third");
}).then($DONE, $DONE);

View File

@ -19,23 +19,21 @@ sequence.push(1);
p.then(function() {
throw new Test262Error("Should not be fulfilled - expected rejection.");
}, function(arg) {
if (arg !== 1) {
throw new Test262Error("Expected rejection reason to be 1, got " + arg);
}
}, function(result) {
assert.sameValue(result, 1, 'The value of result is expected to be 1');
sequence.push(4);
assert.sameValue(sequence.length, 4);
assert.sameValue(sequence.length, 4, 'The value of sequence.length is expected to be 4');
checkSequence(sequence, "This happens second");
}).catch($DONE);
Promise.resolve().then(function() {
sequence.push(3);
assert.sameValue(sequence.length, 3);
assert.sameValue(sequence.length, 3, 'The value of sequence.length is expected to be 3');
checkSequence(sequence, "This happens first");
}).then(function() {
sequence.push(5);
assert.sameValue(sequence.length, 5);
assert.sameValue(sequence.length, 5, 'The value of sequence.length is expected to be 5');
checkSequence(sequence, "This happens third");
}).then($DONE, $DONE);

View File

@ -19,8 +19,6 @@ var resolveP1, rejectP2,
rejectP2(new Error("Promise.race should not see this if P1 already resolved"));
resolveP1(1);
Promise.race([p1, p2]).then(function(arg) {
if (arg !== 1) {
throw new Test262Error("Expected fulfillment with 1, got " + arg);
}
Promise.race([p1, p2]).then(function(result) {
assert.sameValue(result, 1, 'The value of result is expected to be 1');
}).then($DONE, $DONE);

View File

@ -18,10 +18,8 @@ var resolveP1, rejectP2,
Promise.race([p1, p2]).then(function() {
throw new Test262Error("Should not be fulfilled: expected rejection.");
}, function(arg) {
if (arg !== 2) {
throw new Test262Error("Expected rejection reason to be 2, got " + arg);
}
}, function(result) {
assert.sameValue(result, 2, 'The value of result is expected to be 2');
}).then($DONE, $DONE);
rejectP2(2);

View File

@ -8,7 +8,8 @@ es6id: S25.4.4.4_A1.1_T1
author: Sam Mikes
description: Promise.reject is a function
---*/
if ((typeof Promise.reject) !== "function") {
throw new Test262Error("Expected Promise.reject to be a function");
}
assert.sameValue(
typeof Promise.reject,
"function",
'The value of `typeof Promise.reject` is expected to be "function"'
);

View File

@ -18,14 +18,10 @@ flags: [async]
var p = Promise.reject(3);
if (!(p instanceof Promise)) {
throw new Test262Error("Expected Promise.reject to return a promise.");
}
assert(!!(p instanceof Promise), 'The value of !!(p instanceof Promise) is expected to be true');
p.then(function() {
throw new Test262Error("Promise should not be fulfilled.");
}, function(arg) {
if (arg !== 3) {
throw new Test262Error("Expected promise to be rejected with supplied arg, got " + arg);
}
}, function(result) {
assert.sameValue(result, 3, 'The value of result is expected to be 3');
}).then($DONE, $DONE);

View File

@ -8,7 +8,8 @@ es6id: S25.4.4.5_A1.1_T1
author: Sam Mikes
description: Promise.resolve is a function
---*/
if ((typeof Promise.resolve) !== "function") {
throw new Test262Error("Expected Promise.resolve to be a function");
}
assert.sameValue(
typeof Promise.resolve,
"function",
'The value of `typeof Promise.resolve` is expected to be "function"'
);

View File

@ -10,6 +10,4 @@ description: Promise.resolve passes through a promise w/ same Constructor
var p1 = Promise.resolve(1),
p2 = Promise.resolve(p1);
if (p1 !== p2) {
throw new Test262Error("Expected p1 === Promise.resolve(p1) because they have same constructor");
}
assert.sameValue(p1, p2, 'The value of p1 is expected to equal the value of p2');

View File

@ -13,16 +13,12 @@ var resolveP1,
resolveP1 = resolve;
}),
p2 = Promise.resolve(p1),
obj = {};
arg = {};
if (p1 !== p2) {
throw new Test262Error("Expected p1 === Promise.resolve(p1) because they have same constructor");
}
assert.sameValue(p1, p2, 'The value of p1 is expected to equal the value of p2');
p2.then(function(arg) {
if (arg !== obj) {
throw new Test262Error("Expected promise to be resolved with obj, actually " + arg);
}
p2.then(function(result) {
assert.sameValue(result, arg, 'The value of result is expected to equal the value of arg');
}).then($DONE, $DONE);
resolveP1(obj);
resolveP1(arg);

View File

@ -13,18 +13,14 @@ var rejectP1,
rejectP1 = reject;
}),
p2 = Promise.resolve(p1),
obj = {};
arg = {};
if (p1 !== p2) {
throw new Test262Error("Expected p1 === Promise.resolve(p1) because they have same constructor");
}
assert.sameValue(p1, p2, 'The value of p1 is expected to equal the value of p2');
p2.then(function() {
throw new Test262Error("Expected p2 to be rejected, not fulfilled.");
}, function(arg) {
if (arg !== obj) {
throw new Test262Error("Expected promise to be rejected with reason obj, actually " + arg);
}
}, function(result) {
assert.sameValue(result, arg, 'The value of result is expected to equal the value of arg');
}).then($DONE, $DONE);
rejectP1(obj);
rejectP1(arg);

View File

@ -20,7 +20,5 @@ resolveP(p);
p.then(function() {
throw new Test262Error("Should not fulfill: should reject with TypeError.");
}, function(err) {
if (!(err instanceof TypeError)) {
throw new Test262Error("Expected TypeError, got " + err);
}
assert(!!(err instanceof TypeError), 'The value of !!(err instanceof TypeError) is expected to be true');
}).then($DONE, $DONE);