mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -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
|
||||
bar
|
||||
bar
|
||||
true
|
||||
|
|
|
@ -48,3 +48,5 @@ globals.checkWindowGlobal();
|
|||
(globalThis as any).foo = "bar";
|
||||
console.log((globalThis as any).foo);
|
||||
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 Some(array) =
|
||||
inner.get_property_names(scope, GetPropertyNamesArgs::default())
|
||||
else {
|
||||
let Some(array) = inner.get_property_names(
|
||||
scope,
|
||||
GetPropertyNamesArgs {
|
||||
mode: v8::KeyCollectionMode::OwnOnly,
|
||||
property_filter: v8::PropertyFilter::ALL_PROPERTIES,
|
||||
..Default::default()
|
||||
},
|
||||
) else {
|
||||
return;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue