function-redeclaration-block.js (863B)
1 // Copyright (C) 2019 Adrian Heine. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 /*--- 4 description: In non-strict mode, duplicate LexicallyDeclaredNames in a block are allowed if they are bound by FunctionDeclarations 5 esid: sec-block-duplicates-allowed-static-semantics 6 es6id: B.3.3.4 7 flags: [noStrict] 8 info: | 9 B.3.3.4 Changes to Block Static Semantics: Early Errors 10 11 For web browser compatibility, that rule is modified with the addition of the **highlighted** text: 12 13 Block: {StatementList} 14 15 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**. 16 ---*/ 17 18 { function a() {} function a() {} } 19 20 reportCompare(0, 0);