Enable strict mode testing for sm/async-functions

This commit is contained in:
André Bargull 2025-04-30 14:16:21 +02:00 committed by Philip Chimento
parent d980c319d8
commit 5560784cff
11 changed files with 6 additions and 37 deletions

View File

@ -2,12 +2,11 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
flags:
- noStrict
description: |
pending
esid: pending
---*/
function assertSyntaxError(code) {
assert.throws(SyntaxError, () => { Function(code); }, "Function:" + code);
assert.throws(SyntaxError, () => { eval(code); }, "eval:" + code);
@ -26,4 +25,3 @@ for (let decl of ["var", "let", "const"]) {
assertSyntaxError(`${decl} {async async, } = {}`);
assertSyntaxError(`${decl} {async async = 0} = {}`);
}

View File

@ -2,8 +2,6 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
flags:
- noStrict
description: |
await outside of async function should provide better error
esid: pending

View File

@ -2,12 +2,11 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
flags:
- noStrict
description: |
pending
esid: pending
---*/
var ieval = eval;
var AsyncFunction = async function(){}.constructor;
@ -98,5 +97,3 @@ assertSyntaxErrorAsync("(a = (b, ...await) => {}) => {}");
assertSyntaxErrorBoth("(a = async(b, ...await) => {}) => {}");
assertSyntaxErrorBoth("async(a = (b, ...await) => {}) => {}");
assertSyntaxErrorBoth("async(a = async(b, ...await) => {}) => {}");

View File

@ -4,20 +4,12 @@
*/
/*---
flags:
- noStrict
description: |
pending
error for incomplete await expr in async function/generator parameter
esid: pending
---*/
//-----------------------------------------------------------------------------
var BUGNUMBER = 1478910;
var summary = 'JSMSG_AWAIT_IN_PARAMETER error for incomplete await expr in async function/generator parameter';
//-----------------------------------------------------------------------------
test();
//-----------------------------------------------------------------------------
function test()
{
@ -64,5 +56,4 @@ function test()
testAwaitInDefaultExprOfAsyncFunc("async (a = await) => {}");
testNoException("async (a = async () => { await 1; }) => {}");
}

View File

@ -2,8 +2,6 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
flags:
- noStrict
description: |
async function constructor and prototype
esid: pending

View File

@ -2,12 +2,11 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
flags:
- noStrict
description: |
pending
esid: pending
---*/
var getProtoCalled = false;
var newTarget = Object.defineProperty(function(){}.bind(), "prototype", {
@ -24,4 +23,3 @@ assert.throws(SyntaxError, () => {
});
assert.sameValue(getProtoCalled, false);

View File

@ -2,12 +2,11 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
flags:
- noStrict
description: |
pending
esid: pending
---*/
function g() {
return g.caller;
}
@ -22,4 +21,3 @@ function g() {
var inner = g();
assert.sameValue(inner, null);
})();

View File

@ -2,8 +2,6 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
flags:
- noStrict
description: |
async function length
esid: pending

View File

@ -2,12 +2,11 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
flags:
- noStrict
description: |
pending
esid: pending
---*/
function assertSyntaxError(code) {
assert.throws(SyntaxError, function () { Function(code); }, "Function:" + code);
assert.throws(SyntaxError, function () { eval(code); }, "eval:" + code);
@ -21,5 +20,3 @@ assertSyntaxError(`async function f() 0`);
// AsyncFunction expression
assertSyntaxError(`void async function() 0`);
assertSyntaxError(`void async function f() 0`);

View File

@ -2,8 +2,6 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
flags:
- noStrict
description: |
async name token in property and object destructuring pattern
esid: pending

View File

@ -2,8 +2,6 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
flags:
- noStrict
description: |
async function toString
esid: pending