-
Node version: 18.0.0 We use the following seemingly benign code (source): const sandbox = {};
Object.getOwnPropertyNames(global).forEach((name) => {
sandbox[name] = global[name];
}); However, it triggers the experimental warning:
What's interesting is that the following ones don't: const sandbox = {};
["fetch"].forEach((name) => {
sandbox[name] = global[name];
}); Object.getOwnPropertyNames(global).forEach((name) => {
console.log(name);
}); But this does: Object.getOwnPropertyNames(global)
.filter((name) => name !== "fetch")
.forEach((name) => {
sandbox[name] = global[name];
}); I'd like to know what the condition for emitting the experimental warning is. |
Beta Was this translation helpful? Give feedback.
Answered by
Josh-Cena
May 14, 2022
Replies: 1 comment
-
Oh, nvm, the warning is coming from accessing |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Josh-Cena
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Upgrading to 18.1.0 removes the warning... Maybe it was a bug?Oh, nvm, the warning is coming from accessing
Response
and friends, which is fixed in #42807 🤦♂️