diff --git a/quickjs.c b/quickjs.c index b9c0152..ac4f2aa 100644 --- a/quickjs.c +++ b/quickjs.c @@ -35353,7 +35353,7 @@ static __exception int js_parse_function_decl2(JSParseState *s, push_scope(s); /* enter body scope */ fd->body_scope = fd->scope_level; - if (s->token.val == TOK_ARROW) { + if (s->token.val == TOK_ARROW && func_type == JS_PARSE_FUNC_ARROW) { if (next_token(s)) goto fail; diff --git a/test262_errors.txt b/test262_errors.txt index dbbcac2..6cac22d 100644 --- a/test262_errors.txt +++ b/test262_errors.txt @@ -28,7 +28,6 @@ test262/test/staging/sm/async-functions/await-error.js:12: Test262Error: Expecte test262/test/staging/sm/async-functions/await-in-arrow-parameters.js:33: Error: Assertion failed: expected exception SyntaxError, no exception thrown - AsyncFunction:(a = (b = await/r/g) => {}) => {} test262/test/staging/sm/class/boundFunctionSubclassing.js:12: Test262Error: Expected SameValue(«false», «true») to be true test262/test/staging/sm/class/compPropNames.js:26: Error: Expected syntax error: ({[1, 2]: 3}) -test262/test/staging/sm/class/methDefn.js:26: Error: Expected syntax error: b = {a() => 0} test262/test/staging/sm/class/strictExecution.js:32: Error: Assertion failed: expected exception TypeError, no exception thrown test262/test/staging/sm/class/superPropOrdering.js:83: Error: Assertion failed: expected exception TypeError, no exception thrown test262/test/staging/sm/expressions/optional-chain.js:25: Error: Assertion failed: expected exception SyntaxError, no exception thrown