vm: properly support symbols on globals#46458
Conversation
|
I'll rework the commit message to fit the guidelines. Do I need to change the commit in-place and force push or can I push an extra commit on top of it? |
Force pushing is the only way in this instance, as we typically squash all the commits in the PR into the first one. |
This comment was marked as outdated.
This comment was marked as outdated.
A regression has been introduced in node 18.2.0,
it makes the following snippet fails while it used to work in the past:
```
const assert = require('assert');
const vm = require('vm');
const global = vm.runInContext('this', vm.createContext());
const totoSymbol = Symbol.for('toto');
Object.defineProperty(global, totoSymbol, {
enumerable: true,
writable: true,
value: 4,
configurable: true,
});
assert(Object.getOwnPropertySymbols(global).includes(totoSymbol));
```
Regression introduced by: nodejs#42963.
So I basically attempted to start understanding what it changed to make
it fix the initial issue while not breaking the symbol related one.
Fixes: nodejs#45983
70596ac to
0599236
Compare
|
Normally everything should be good now. As suggested by @aduh95, I force-pushed on my original commit to fix the commit message. Only changes made since the original commit (before force-push) are: edit commit message and fix lint on the new test file. |
|
This PR makes |
I'll rework it to make sure this test passes too. I may have missed one condition in the code I added. |
|
Can you get rid of the merge commit please? It tends to break our tooling. ( |
|
Yes definitely I will |
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
5d5ad4c to
b24cd68
Compare
|
Not sure to get the reason of the remaining failures 🤔 I started to check on jenkins side but I don't exactly get the reason of the failure and the link to the current change. |
|
@aduh95 Not sure what to do for the nodejs-github-bot failures, I don't get exactly what is failing 🤯 |
Unfortunately sometimes the CI reports unrelated CI failures (either because the test is flaky, or because of a hardware/infra failure). Restarting the CI did not trigger the same issue twice, so it's fair to assume it was indeed unrelated :) |
|
Landed in 6bbc2fb |
|
As it fixes an issue in node 18, any way to put it in the next release of node 18 too? |
Before landing on Node.js 18.x, it will need to be released on Node.js 19.x for at least 2 weeks. The backport should be done by a releaser without any action from you after that, or if a manual backport is needed, they'll add a comment here. node/doc/contributing/backporting-to-release-lines.md Lines 19 to 25 in a0440c9 |
|
For the record, as some other regressions have been reported following #42963 (the original PR, I patched with this one), I'm trying to cover all of them via dedicated tests and possibly adapt again the proposed option (by adding comment). |
While it was supposed to fix most of the remaining issues, nodejs#46458 missed some in strict mode. This PR adds some additional checks. It also clarifies what we are really checking to execute or not the `GetReturnValue`.
While it was supposed to fix most of the remaining issues, nodejs#46458 missed some in strict mode. This PR adds some additional checks. It also clarifies what we are really checking to execute or not the `GetReturnValue`.
|
I opened a follow-up PR that should fix the previously reported issues linked to 18.2.0 and 18.0.0. See #46615 |
A regression has been introduced in node 18.2.0,
it makes the following snippet fails while it used to work in the past:
```
const assert = require('assert');
const vm = require('vm');
const global = vm.runInContext('this', vm.createContext());
const totoSymbol = Symbol.for('toto');
Object.defineProperty(global, totoSymbol, {
enumerable: true,
writable: true,
value: 4,
configurable: true,
});
assert(Object.getOwnPropertySymbols(global).includes(totoSymbol));
```
Regression introduced by: #42963.
So I basically attempted to start understanding what it changed to make
it fix the initial issue while not breaking the symbol related one.
Fixes: #45983
PR-URL: #46458
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
While it was supposed to fix most of the remaining issues, nodejs#46458 missed some in strict mode. This PR adds some additional checks. It also clarifies what we are really checking to execute or not the `GetReturnValue`.
While it was supposed to fix most of the remaining issues, #46458 missed some in strict mode. This PR adds some additional checks. It also clarifies what we are really checking to execute or not the `GetReturnValue`. PR-URL: #46615 Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
While it was supposed to fix most of the remaining issues, #46458 missed some in strict mode. This PR adds some additional checks. It also clarifies what we are really checking to execute or not the `GetReturnValue`. PR-URL: #46615 Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
While it was supposed to fix most of the remaining issues, #46458 missed some in strict mode. This PR adds some additional checks. It also clarifies what we are really checking to execute or not the `GetReturnValue`. PR-URL: #46615 Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
A regression has been introduced in node 18.2.0,
it makes the following snippet fails while it used to work in the past:
```
const assert = require('assert');
const vm = require('vm');
const global = vm.runInContext('this', vm.createContext());
const totoSymbol = Symbol.for('toto');
Object.defineProperty(global, totoSymbol, {
enumerable: true,
writable: true,
value: 4,
configurable: true,
});
assert(Object.getOwnPropertySymbols(global).includes(totoSymbol));
```
Regression introduced by: #42963.
So I basically attempted to start understanding what it changed to make
it fix the initial issue while not breaking the symbol related one.
Fixes: #45983
PR-URL: #46458
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
While it was supposed to fix most of the remaining issues, #46458 missed some in strict mode. This PR adds some additional checks. It also clarifies what we are really checking to execute or not the `GetReturnValue`. PR-URL: #46615 Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
A regression has been introduced in node 18.2.0, it lakes the following snippet fails while it used to work in the past:
The PR that introduced the regression is: #42963. So I basically attempted to start understanding what it changed to make it still fix the initial issue while not breaking the symbol related one.
Fixes: #45983