mirror of
https://github.com/tc39/test262.git
synced 2025-07-20 12:34:41 +02:00
Replace instanceof
with reference equality
This commit is contained in:
parent
ce662e5474
commit
7ed6238a89
@ -19,12 +19,13 @@ flags: [async]
|
|||||||
|
|
||||||
class MyError extends Error {}
|
class MyError extends Error {}
|
||||||
|
|
||||||
Promise.reject(new MyError())
|
var myError = new MyError();
|
||||||
|
Promise.reject(myError)
|
||||||
.finally(function() {})
|
.finally(function() {})
|
||||||
.then(function(value) {
|
.then(function(value) {
|
||||||
$DONE('Expected promise to be rejected, got fulfilled with ' + value);
|
$DONE('Expected promise to be rejected, got fulfilled with ' + value);
|
||||||
}, function(reason) {
|
}, function(reason) {
|
||||||
if (reason instanceof MyError) {
|
if (reason === myError) {
|
||||||
$DONE();
|
$DONE();
|
||||||
} else {
|
} else {
|
||||||
$DONE(reason);
|
$DONE(reason);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user