summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/annexB/language/function-code/function-redeclaration-block.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/annexB/language/function-code/function-redeclaration-block.js')
-rw-r--r--js/src/tests/test262/annexB/language/function-code/function-redeclaration-block.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/js/src/tests/test262/annexB/language/function-code/function-redeclaration-block.js b/js/src/tests/test262/annexB/language/function-code/function-redeclaration-block.js
new file mode 100644
index 0000000000..1e3a163cd3
--- /dev/null
+++ b/js/src/tests/test262/annexB/language/function-code/function-redeclaration-block.js
@@ -0,0 +1,20 @@
+// Copyright (C) 2019 Adrian Heine. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: In non-strict mode, duplicate LexicallyDeclaredNames in a block are allowed if they are bound by FunctionDeclarations
+esid: sec-block-duplicates-allowed-static-semantics
+es6id: B.3.3.4
+flags: [noStrict]
+info: |
+ B.3.3.4 Changes to Block Static Semantics: Early Errors
+
+ For web browser compatibility, that rule is modified with the addition of the **highlighted** text:
+
+ Block: {StatementList}
+
+ It is a Syntax Error if the LexicallyDeclaredNames of StatementList contains any duplicate entries, **unless the source code matching this production is not strict mode code and the duplicate entries are only bound by FunctionDeclarations**.
+---*/
+
+{ function a() {} function a() {} }
+
+reportCompare(0, 0);