mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-25 03:01:12 +08:00
fix: 补齐代理读取组与完整性级别语义
This commit is contained in:
@@ -483,9 +483,9 @@ fn function_prototype_new_throws_catchable_type_error() {
|
||||
|
||||
#[test]
|
||||
fn dynamic_function_prototype_descriptor_not_configurable() {
|
||||
// 动态函数(Function 构造器产物)的 prototype 属性为
|
||||
// {writable:true, enumerable:false, configurable:false},delete 失败且值不变;
|
||||
// 普通函数的 prototype 属性保持可配置,不回归。
|
||||
// 动态函数(Function 构造器产物)与普通函数的 prototype 属性均为
|
||||
// {writable:true, enumerable:false, configurable:false}(规范 10.2.1 口径),
|
||||
// delete 失败且值不变。
|
||||
let mut vm = Vm::new();
|
||||
vm.set_compiler_service(Arc::new(DefaultCompilerService));
|
||||
let result = eval(
|
||||
@@ -505,7 +505,14 @@ fn dynamic_function_prototype_descriptor_not_configurable() {
|
||||
"function g() {} var d = Object.getOwnPropertyDescriptor(g, 'prototype'); d.writable + ',' + d.enumerable + ',' + d.configurable",
|
||||
)
|
||||
.unwrap();
|
||||
assert_eq!(vm.lookup_str(result).unwrap_or_default(), "true,false,true");
|
||||
assert_eq!(vm.lookup_str(result).unwrap_or_default(), "true,false,false");
|
||||
// 普通函数同口径:delete 失败且值不变。
|
||||
let result = eval(
|
||||
&mut vm,
|
||||
"function h() {} var p = h.prototype; delete h.prototype; h.prototype === p",
|
||||
)
|
||||
.unwrap();
|
||||
assert!(result.as_bool());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user