mirror of
https://github.com/tc39/test262.git
synced 2025-09-25 19:18:48 +02:00
Replace SpiderMonkey-specific parseModule in async-functions/async-contains-unicode-escape.js and fix a test bug
This commit is contained in:
parent
d90061929a
commit
7ec30cc749
@ -0,0 +1,17 @@
|
||||
// Copyright (C) 2024 Mozilla Corporation. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
description: |
|
||||
async/await containing escapes
|
||||
esid: pending
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
flags:
|
||||
- module
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
export default \u0061sync function f() {}
|
@ -2,22 +2,15 @@
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
flags:
|
||||
- noStrict
|
||||
description: |
|
||||
async/await containing escapes
|
||||
esid: pending
|
||||
---*/
|
||||
|
||||
// Using "eval" as the argument name is fugly, but it means evals below are
|
||||
// *direct* evals, and so their effects in the unescaped case won't extend
|
||||
// past each separate |test| call (as would happen if we used a different name
|
||||
// that made each eval into an indirect eval, affecting code in the global
|
||||
// scope).
|
||||
function test(code, eval)
|
||||
function test(code)
|
||||
{
|
||||
var unescaped = code.replace("###", "async");
|
||||
var escaped = code.replace("###", "\\u0061");
|
||||
var escaped = code.replace("###", "\\u0061sync");
|
||||
|
||||
assert.throws(SyntaxError, () => eval(escaped));
|
||||
eval(unescaped);
|
||||
@ -34,9 +27,6 @@ test("var x = ### (y) => {}", eval);
|
||||
test("({ ### x() {} })", eval);
|
||||
test("var x = ### function f() {}", eval);
|
||||
|
||||
if (typeof parseModule === "function")
|
||||
test("export default ### function f() {}", parseModule);
|
||||
|
||||
assert.throws(SyntaxError, () => eval("async await => 1;"));
|
||||
assert.throws(SyntaxError, () => eval("async aw\\u0061it => 1;"));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user