mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-25 11:11:11 +08:00
fix: 顶层受限全局名 lexical 声明编译期拒绝——let/const undefined|NaN|Infinity 撞 GDI 三常量 SyntaxError
This commit is contained in:
@@ -155,7 +155,8 @@ impl Emitter {
|
||||
self.predeclare_function_declarations(body, ctx);
|
||||
self.pre_register_builtin_references(body, ctx);
|
||||
self.predeclare_var_declarations(body, ctx);
|
||||
self.predeclare_lexical_declarations(body, ctx);
|
||||
// 模块 lexical 声明入模块环境(非全局对象),不做受限全局名检查。
|
||||
let _ = self.predeclare_lexical_declarations(body, ctx, false);
|
||||
|
||||
// 闭包捕获分析(import 绑定名纳入 own_bindings,供嵌套函数 cell 捕获)。
|
||||
ctx.own_bindings = self.collect_own_binding_names(&[], body);
|
||||
|
||||
Reference in New Issue
Block a user