| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
In particular, this comes into play in the node repl, which apparently enables domains by default. Whenever any Promise gets inspected, a `.domain` property is displayed, which is *very confusing*, especially since it has some kind of WeakReference attached to it, which is not yet a language feature. This change will prevent it from showing up in casual inspection, but will leave it available for use.
There was a problem hiding this comment.
LGTM. It would be nice to add a test to it as well.
Sorry, something went wrong.
Sorry, something went wrong.
|
Resume Build CI: https://ci.nodejs.org/job/node-test-pull-request/20973/ |
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM!
Does this need tests?
What's the semver status of this? I don't think this is a major, but is it a minor or patch?
Sorry, something went wrong.
|
I’d call it a patch; imo it fixes confusion in the repl. |
Sorry, something went wrong.
@ljharb If you want to only run domain tests, you can do tools/test.py domain. On my machine, that runs 50 test files in 11 seconds. (No failures on master branch.) |
Sorry, something went wrong.
|
Resume Build CI: https://ci.nodejs.org/job/node-test-pull-request/21223/ |
Sorry, something went wrong.
|
@BridgeAR I've added some; let me know if that's not what you had in mind :-) no dice :-/$ tools/test.py domain
Traceback (most recent call last):
File "tools/test.py", line 1766, in <module>
sys.exit(Main())
File "tools/test.py", line 1639, in Main
vm = context.GetVm(arch, mode)
File "tools/test.py", line 953, in GetVm
raise ValueError('Could not find executable. Should be ' + name)
ValueError: Could not find executable. Should be out/Release/node |
Sorry, something went wrong.
|
@ljharb you have to compile Node.js first. Otherwise the tests can't run. |
Sorry, something went wrong.
|
@ljharb I just started a CI and it seems like there are linter errors. |
Sorry, something went wrong.
There was a problem hiding this comment.
Do we really need all of these defineProperty calls? If I am not mistaken we only have to set the property to enumerable false once and every following assignment will keep the descriptor in place.
Sorry, something went wrong.
|
@BridgeAR certainly you're right, but for all of the objects that aren't previously defined - like newly created resources, errors, event emitters, etc - it'd need the defineProperty every time. |
Sorry, something went wrong.
|
CI https://ci.nodejs.org/job/node-test-pull-request/21481/ (:white_check_mark:) |
Sorry, something went wrong.
|
@misterdjules do you have any thoughts on this? |
Sorry, something went wrong.
|
As far as semver - this could be considered semver-major if someone was using the domains flag, and also enumerating an async resource, and then relying on domain to be present there - but I can't imagine why anyone would be doing that. That would make this either a major or a patch, depending on the level of conservatism. |
Sorry, something went wrong.
In particular, this comes into play in the node repl, which apparently enables domains by default. Whenever any Promise gets inspected, a `.domain` property is displayed, which is *very confusing*, especially since it has some kind of WeakReference attached to it, which is not yet a language feature. This change will prevent it from showing up in casual inspection, but will leave it available for use. PR-URL: #26210 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
In particular, this comes into play in the node repl, which apparently enables domains by default. Whenever any Promise gets inspected, a `.domain` property is displayed, which is *very confusing*, especially since it has some kind of WeakReference attached to it, which is not yet a language feature. This change will prevent it from showing up in casual inspection, but will leave it available for use. PR-URL: #26210 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
In particular, this comes into play in the node repl, which apparently enables domains by default. Whenever any Promise gets inspected, a `.domain` property is displayed, which is *very confusing*, especially since it has some kind of WeakReference attached to it, which is not yet a language feature. This change will prevent it from showing up in casual inspection, but will leave it available for use. PR-URL: nodejs#26210 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
In particular, this comes into play in the node repl, which apparently enables domains by default. Whenever any Promise gets inspected, a `.domain` property is displayed, which is *very confusing*, especially since it has some kind of WeakReference attached to it, which is not yet a language feature. This change will prevent it from showing up in casual inspection, but will leave it available for use. PR-URL: #26210 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
|
@MylesBorins This is great! I ran into this recently when logging restify errors created from within a domain and we had to filter the domain property out. Having that property not enumerable would have avoided that issue in the first place. And thanks for pinging me here, very much appreciated ❤️ |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
In particular, this comes into play in the node repl, which apparently enables domains by default. Whenever any Promise gets inspected, a .domain property is displayed, which is very confusing, especially since it has some kind of WeakReference attached to it, which is not yet a language feature.
This change will prevent it from showing up in casual inspection, but will leave it available for use.
I have not run the tests locally yet, because they're incredibly slow and I need to do other things with my machine, and because the last time I tried some of them failed on master anyways.
Checklist
cc @addaleax @devsnek