mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-26 19:51:11 +08:00
fix: 顶层受限全局名 lexical 声明编译期拒绝——let/const undefined|NaN|Infinity 撞 GDI 三常量 SyntaxError
This commit is contained in:
@@ -12,7 +12,8 @@ impl Emitter {
|
||||
// 函数预声明先于 lexical:`{ let g; function g(){} }` 时 lexical 的预声明
|
||||
// 命中已存在的函数绑定自然报重复声明错,不被静默覆盖破坏 TDZ。
|
||||
self.predeclare_block_function_declarations(&block.body, ctx);
|
||||
self.predeclare_lexical_declarations(&block.body, ctx);
|
||||
// 块 lexical 声明是局部绑定:不做受限全局名检查(重复声明错在 emit 期报)。
|
||||
let _ = self.predeclare_lexical_declarations(&block.body, ctx, false);
|
||||
let mut r = None;
|
||||
for s in &block.body {
|
||||
if let Some(rr) = self.emit_statement(s, ctx)? {
|
||||
|
||||
Reference in New Issue
Block a user