mirror of https://github.com/tc39/test262.git
22 lines
561 B
JavaScript
22 lines
561 B
JavaScript
|
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||
|
/*---
|
||
|
description: |
|
||
|
The 'asyncTest' helper checks that it is called with the 'async' flag.
|
||
|
includes: [asyncHelpers.js]
|
||
|
---*/
|
||
|
function makePromise() {
|
||
|
return {
|
||
|
then(res, rej) {
|
||
|
throw new Test262Error("Should not be evaluated");
|
||
|
},
|
||
|
};
|
||
|
}
|
||
|
assert(
|
||
|
!Object.hasOwn(globalThis, "$DONE"),
|
||
|
"Without 'async' flag, $DONE should not be defined"
|
||
|
);
|
||
|
assert.throws(Test262Error, function () {
|
||
|
asyncTest(makePromise);
|
||
|
});
|