mirror of
https://github.com/tc39/test262.git
synced 2025-09-24 10:38:30 +02:00
Enable strict mode testing for sm/async-functions
This commit is contained in:
parent
d980c319d8
commit
5560784cff
@ -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} = {}`);
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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) => {}) => {}");
|
||||
|
||||
|
||||
|
@ -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; }) => {}");
|
||||
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
})();
|
||||
|
||||
|
@ -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
|
||||
|
@ -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`);
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user