mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-26 11:41:13 +08:00
emit/kernel: 可写 builtin 全局标识符写双写全局属性,三常量描述符对齐规范 c:false,受限词法名集补 eval
- 谓词注册表化:targets_readonly_builtin 解析条件抽公共助手,新增 targets_writable_builtin / is_writable_builtin_global(BUILTIN_GLOBALS 减只读三常量派生,不复制名单)+ 只读/可写划分漂移守卫单测 - 12 个赋值族写点(简单/复合/更新/逻辑赋值、解构两臂、for-in/for-of 标识符目标)补双写臂:STORE_VAR 后 0x98 同步全局对象属性(既有可写 属性原地更值、保 e/c 位),裸读镜像与 globalThis 反射不失步 - for-in 头 tier 写点移除 builtin 名例外:可写 builtin 名迭代键照规范 覆写全局属性(三常量仍由拦截臂跳过) - 三常量(undefined/NaN/Infinity)全局描述符 configurable 翻正为 false:delete 拒绝、属性保留,描述符读同步 - 脚本顶层受限词法名集 3→4(补 eval,静态受限臂):let/const/class eval 顶层声明编译期 SyntaxError - 配套钉:7 处既有钉随 c 位翻正 + 2 枚 for-in/eval 形态钉反转,新增 global_builtin_writable_tests(16 钉:双写六形态 + 遮蔽/strict/eval/ 宿主名面) test262 子集:built-ins/global 29/29、三常量族 20/20、11.13.1-4 7/7、 assignmenttargettype plain 8/8 全绿;language/global-code 17 失败文件 双树单跑一致(pre-existing);annexB assignmenttargettype 7 个 parse error 为既有解析器缺口
This commit is contained in:
@@ -9,12 +9,13 @@ use oxide_parser::{
|
||||
BindingPattern, Declaration, ExportDefaultDeclarationKind, Expression, Statement, VariableDeclarationKind,
|
||||
};
|
||||
|
||||
/// 脚本顶层 lexical 声明禁止使用的受限全局名:规范 HasRestrictedGlobalProperty
|
||||
/// 判定「全局对象不可配置自有属性名」,现规范全局对象该自有属性恰为三常量。
|
||||
/// 名基静态集(编译期不可查运行时描述符);eval 与各 builtin 属性均可配置
|
||||
/// (合法遮蔽),不在此列。与 BUILTIN_GLOBALS 语义不同(后者是 put 写拦截名单),
|
||||
/// 不互相派生,交叠名由漂移守卫单测断言恒同步。
|
||||
pub(crate) const RESTRICTED_GLOBAL_LEXICAL_NAMES: &[&str] = &["undefined", "NaN", "Infinity"];
|
||||
/// 脚本顶层 lexical 声明(let/const/class)禁止使用的受限全局名:4 名静态集。
|
||||
/// 三常量是全局对象上 {configurable:false} 的自有属性名(声明实例化无法建立
|
||||
/// 遮蔽绑定);eval 属静态受限臂(顶层 lexical 声明不得遮蔽,var/function
|
||||
/// 路径不受本集约束)。名基静态集(编译期不可查运行时描述符)。与
|
||||
/// BUILTIN_GLOBALS 语义不同(后者是 put 写拦截/双写名单),不互相派生,交叠
|
||||
/// 名由漂移守卫单测断言恒同步。
|
||||
pub(crate) const RESTRICTED_GLOBAL_LEXICAL_NAMES: &[&str] = &["undefined", "eval", "NaN", "Infinity"];
|
||||
|
||||
/// 脚本顶层 lexical 声明撞受限全局名 → SyntaxError(声明实例化期拒绝,整程序
|
||||
/// 编译失败)。错误消息与既有重复声明错同形;非顶层或名不在受限集 → Ok。
|
||||
|
||||
Reference in New Issue
Block a user