mirror of
https://github.com/denoland/deno.git
synced 2025-01-21 21:50:00 -05:00
fix(ext/node): include non-enumerable keys in Reflect.ownKeys(globalThis)
(#21485)
Closes #21484.
This commit is contained in:
parent
c1fc7b2cd5
commit
3f96e5a29a
3 changed files with 11 additions and 3 deletions
|
@ -25,3 +25,4 @@ false
|
||||||
false
|
false
|
||||||
bar
|
bar
|
||||||
bar
|
bar
|
||||||
|
true
|
||||||
|
|
|
@ -48,3 +48,5 @@ globals.checkWindowGlobal();
|
||||||
(globalThis as any).foo = "bar";
|
(globalThis as any).foo = "bar";
|
||||||
console.log((globalThis as any).foo);
|
console.log((globalThis as any).foo);
|
||||||
console.log(globals.getFoo());
|
console.log(globals.getFoo());
|
||||||
|
|
||||||
|
console.log(Reflect.ownKeys(globalThis).includes("console")); // non-enumerable keys are included
|
||||||
|
|
|
@ -432,9 +432,14 @@ pub fn enumerator<'s>(
|
||||||
};
|
};
|
||||||
let inner = v8::Local::new(scope, inner);
|
let inner = v8::Local::new(scope, inner);
|
||||||
|
|
||||||
let Some(array) =
|
let Some(array) = inner.get_property_names(
|
||||||
inner.get_property_names(scope, GetPropertyNamesArgs::default())
|
scope,
|
||||||
else {
|
GetPropertyNamesArgs {
|
||||||
|
mode: v8::KeyCollectionMode::OwnOnly,
|
||||||
|
property_filter: v8::PropertyFilter::ALL_PROPERTIES,
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
) else {
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue