« Bugzilla Issues Index
#4093 — LexicallyDeclaredNames of BlockStatement should be empty
- bug_id:
4093
- creation_ts:
2015-02-25 22:49:00 -0800
- short_desc:
LexicallyDeclaredNames of BlockStatement should be empty
- delta_ts:
2015-02-25 22:54:04 -0800
- product:
Draft for 6th Edition
- component:
technical issue
- version:
Rev 34: February 20, 2015 Release Candidate 1
- rep_platform:
All
- op_sys:
All
- bug_status:
RESOLVED
- resolution:
INVALID
- priority:
Normal
- bug_severity:
enhancement
- everconfirmed:
true
- reporter:
Bei Zhang
- assigned_to:
Allen Wirfs-Brock
- commentid:
13379
- comment_count:
0
- who:
Bei Zhang
- bug_when:
2015-02-25 22:49:03 -0800
LexicallyDeclaredNames of BlockStatement is not undefined. Applying " chain productions " rule in 5.2, it derives from the LexicallyDeclaredNames of the StatementList.
Considering an example:
function x() {
let a;
{
let a;
}
}
The LexicallyDeclaredNames of the BlockStatement is { "a" } and therefore there is a duplicated name "a" in the LexicallyDeclaredNames of the FunctionBody. In other words, block scoping does not exists.
- commentid:
13380
- comment_count:
1
- who:
Bei Zhang
- bug_when:
2015-02-25 22:54:04 -0800
Re-read 13.1.5 Static Semantics: LexicallyDeclaredNames and LexicallyDeclaredNames is cleared at each statement except LabelledStatement. Thus solves the issue.