mirror of
https://github.com/tc39/test262.git
synced 2025-09-25 02:57:53 +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.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
flags:
|
|
||||||
- noStrict
|
|
||||||
description: |
|
description: |
|
||||||
pending
|
pending
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function assertSyntaxError(code) {
|
function assertSyntaxError(code) {
|
||||||
assert.throws(SyntaxError, () => { Function(code); }, "Function:" + code);
|
assert.throws(SyntaxError, () => { Function(code); }, "Function:" + code);
|
||||||
assert.throws(SyntaxError, () => { eval(code); }, "eval:" + 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, } = {}`);
|
||||||
assertSyntaxError(`${decl} {async async = 0} = {}`);
|
assertSyntaxError(`${decl} {async async = 0} = {}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
flags:
|
|
||||||
- noStrict
|
|
||||||
description: |
|
description: |
|
||||||
await outside of async function should provide better error
|
await outside of async function should provide better error
|
||||||
esid: pending
|
esid: pending
|
||||||
|
@ -2,12 +2,11 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
flags:
|
|
||||||
- noStrict
|
|
||||||
description: |
|
description: |
|
||||||
pending
|
pending
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var ieval = eval;
|
var ieval = eval;
|
||||||
var AsyncFunction = async function(){}.constructor;
|
var AsyncFunction = async function(){}.constructor;
|
||||||
|
|
||||||
@ -98,5 +97,3 @@ assertSyntaxErrorAsync("(a = (b, ...await) => {}) => {}");
|
|||||||
assertSyntaxErrorBoth("(a = async(b, ...await) => {}) => {}");
|
assertSyntaxErrorBoth("(a = async(b, ...await) => {}) => {}");
|
||||||
assertSyntaxErrorBoth("async(a = (b, ...await) => {}) => {}");
|
assertSyntaxErrorBoth("async(a = (b, ...await) => {}) => {}");
|
||||||
assertSyntaxErrorBoth("async(a = async(b, ...await) => {}) => {}");
|
assertSyntaxErrorBoth("async(a = async(b, ...await) => {}) => {}");
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,20 +4,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
flags:
|
|
||||||
- noStrict
|
|
||||||
description: |
|
description: |
|
||||||
pending
|
error for incomplete await expr in async function/generator parameter
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
var BUGNUMBER = 1478910;
|
|
||||||
var summary = 'JSMSG_AWAIT_IN_PARAMETER error for incomplete await expr in async function/generator parameter';
|
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
test();
|
test();
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
function test()
|
function test()
|
||||||
{
|
{
|
||||||
@ -64,5 +56,4 @@ function test()
|
|||||||
testAwaitInDefaultExprOfAsyncFunc("async (a = await) => {}");
|
testAwaitInDefaultExprOfAsyncFunc("async (a = await) => {}");
|
||||||
|
|
||||||
testNoException("async (a = async () => { await 1; }) => {}");
|
testNoException("async (a = async () => { await 1; }) => {}");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
flags:
|
|
||||||
- noStrict
|
|
||||||
description: |
|
description: |
|
||||||
async function constructor and prototype
|
async function constructor and prototype
|
||||||
esid: pending
|
esid: pending
|
||||||
|
@ -2,12 +2,11 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
flags:
|
|
||||||
- noStrict
|
|
||||||
description: |
|
description: |
|
||||||
pending
|
pending
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var getProtoCalled = false;
|
var getProtoCalled = false;
|
||||||
|
|
||||||
var newTarget = Object.defineProperty(function(){}.bind(), "prototype", {
|
var newTarget = Object.defineProperty(function(){}.bind(), "prototype", {
|
||||||
@ -24,4 +23,3 @@ assert.throws(SyntaxError, () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
assert.sameValue(getProtoCalled, false);
|
assert.sameValue(getProtoCalled, false);
|
||||||
|
|
||||||
|
@ -2,12 +2,11 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
flags:
|
|
||||||
- noStrict
|
|
||||||
description: |
|
description: |
|
||||||
pending
|
pending
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function g() {
|
function g() {
|
||||||
return g.caller;
|
return g.caller;
|
||||||
}
|
}
|
||||||
@ -22,4 +21,3 @@ function g() {
|
|||||||
var inner = g();
|
var inner = g();
|
||||||
assert.sameValue(inner, null);
|
assert.sameValue(inner, null);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
flags:
|
|
||||||
- noStrict
|
|
||||||
description: |
|
description: |
|
||||||
async function length
|
async function length
|
||||||
esid: pending
|
esid: pending
|
||||||
|
@ -2,12 +2,11 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
flags:
|
|
||||||
- noStrict
|
|
||||||
description: |
|
description: |
|
||||||
pending
|
pending
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function assertSyntaxError(code) {
|
function assertSyntaxError(code) {
|
||||||
assert.throws(SyntaxError, function () { Function(code); }, "Function:" + code);
|
assert.throws(SyntaxError, function () { Function(code); }, "Function:" + code);
|
||||||
assert.throws(SyntaxError, function () { eval(code); }, "eval:" + code);
|
assert.throws(SyntaxError, function () { eval(code); }, "eval:" + code);
|
||||||
@ -21,5 +20,3 @@ assertSyntaxError(`async function f() 0`);
|
|||||||
// AsyncFunction expression
|
// AsyncFunction expression
|
||||||
assertSyntaxError(`void async function() 0`);
|
assertSyntaxError(`void async function() 0`);
|
||||||
assertSyntaxError(`void async function f() 0`);
|
assertSyntaxError(`void async function f() 0`);
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
flags:
|
|
||||||
- noStrict
|
|
||||||
description: |
|
description: |
|
||||||
async name token in property and object destructuring pattern
|
async name token in property and object destructuring pattern
|
||||||
esid: pending
|
esid: pending
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
flags:
|
|
||||||
- noStrict
|
|
||||||
description: |
|
description: |
|
||||||
async function toString
|
async function toString
|
||||||
esid: pending
|
esid: pending
|
||||||
|
Loading…
x
Reference in New Issue
Block a user