From 206a3f49323096ec61415147a29fcff6ddf5d6c6 Mon Sep 17 00:00:00 2001 From: legendecas Date: Fri, 20 Aug 2021 00:47:16 +0800 Subject: [PATCH] fixup! add other function variants --- .../early-dup-top-function-async-generator.js | 20 +++++++++++++++++++ .../early-dup-top-function-async.js | 20 +++++++++++++++++++ .../early-dup-top-function-generator.js | 20 +++++++++++++++++++ .../module-code/early-dup-top-function.js | 2 +- 4 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 test/language/module-code/early-dup-top-function-async-generator.js create mode 100644 test/language/module-code/early-dup-top-function-async.js create mode 100644 test/language/module-code/early-dup-top-function-generator.js diff --git a/test/language/module-code/early-dup-top-function-async-generator.js b/test/language/module-code/early-dup-top-function-async-generator.js new file mode 100644 index 0000000000..be9de7ace3 --- /dev/null +++ b/test/language/module-code/early-dup-top-function-async-generator.js @@ -0,0 +1,20 @@ +// Copyright 2021 Chengzhong Wu. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-module-semantics-static-semantics-early-errors +description: > + It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList + contains any duplicate entries. + At the top level of a Module, function declarations are treated like + lexical declarations rather than like var declarations. +flags: [module] +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); + +function x() {} +async function* x() {} diff --git a/test/language/module-code/early-dup-top-function-async.js b/test/language/module-code/early-dup-top-function-async.js new file mode 100644 index 0000000000..b95911b983 --- /dev/null +++ b/test/language/module-code/early-dup-top-function-async.js @@ -0,0 +1,20 @@ +// Copyright 2021 Chengzhong Wu. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-module-semantics-static-semantics-early-errors +description: > + It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList + contains any duplicate entries. + At the top level of a Module, function declarations are treated like + lexical declarations rather than like var declarations. +flags: [module] +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); + +function x() {} +async function x() {} diff --git a/test/language/module-code/early-dup-top-function-generator.js b/test/language/module-code/early-dup-top-function-generator.js new file mode 100644 index 0000000000..7b3adf44c1 --- /dev/null +++ b/test/language/module-code/early-dup-top-function-generator.js @@ -0,0 +1,20 @@ +// Copyright 2021 Chengzhong Wu. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-module-semantics-static-semantics-early-errors +description: > + It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList + contains any duplicate entries. + At the top level of a Module, function declarations are treated like + lexical declarations rather than like var declarations. +flags: [module] +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); + +function x() {} +function* x() {} diff --git a/test/language/module-code/early-dup-top-function.js b/test/language/module-code/early-dup-top-function.js index b95911b983..8cc5ddee75 100644 --- a/test/language/module-code/early-dup-top-function.js +++ b/test/language/module-code/early-dup-top-function.js @@ -17,4 +17,4 @@ negative: $DONOTEVALUATE(); function x() {} -async function x() {} +function x() {}