| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
Nit: Even though the test isn't ours, this comment is, right? If so, maybe wrap it at 80 chars?
Sorry, something went wrong.
There was a problem hiding this comment.
Sure
Sorry, something went wrong.
|
pinging previous approvers: @TimothyGu @refack @bnoordhuis @addaleax @benjamingr @watilde @cjihrig pinging author of first commit: @Wandalen |
Sorry, something went wrong.
There was a problem hiding this comment.
Why was this added and why were the two lines below removed?
Sorry, something went wrong.
There was a problem hiding this comment.
Ah, this should probably be a individual commit. It is only about a few entries but it did not feel good that we checked all entries again instead of just removing them beforehand.
Sorry, something went wrong.
There was a problem hiding this comment.
Hmm, I'm not sure what effect deleting originalConsole[key] could have. Is it really safe?
Sorry, something went wrong.
There was a problem hiding this comment.
Cryptic comment. Maybe this?
Patch global.console before importing modules that may modify the console object.
Sorry, something went wrong.
There was a problem hiding this comment.
Incomprehensible comment... I'd remove it.
Sorry, something went wrong.
There was a problem hiding this comment.
After reading it... I totally agree. I have no idea what it stands for.
Sorry, something went wrong.
|
I addressed the comments and refactored the test as it did feel like it could need some further polishing. Originally I did not touch the version from @Wandalen to keep the authorship in tact. This way it diverges quite a lot from the original. @bnoordhuis I also separated the other bootstrapping part. It was just to minimize the necessary operations. Since delete is actually still slow, it might not yield any performance benefit but the opposite, so I am also totally fine with removing that part again. |
Sorry, something went wrong.
Sorry, something went wrong.
|
@nodejs/tsc PTAL. This needs more LGs. |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
|
@Wandalen I do not feel comfortable landing this with my changes to the tests without your permission. Would you be so kind and have a look? A alternative would probably be to use the original code from @Wandalen and have a separate commit from me that changes the file accordingly. What do you all think about that? |
Sorry, something went wrong.
According to the standard the property descriptor of console should be writable and non-enumerable. Fixes: nodejs#11805
|
I separated the code from @Wandalen and me. |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM but the one delete statement flagged by @bnoordhuis does concern me.
Sorry, something went wrong.
There was a problem hiding this comment.
Hmm, I'm not sure what effect deleting originalConsole[key] could have. Is it really safe?
Sorry, something went wrong.
|
Also, FWIW, I think the check is very likely faster than the delete. The latter is very expensive in my experience. |
Sorry, something went wrong.
|
@apapirovski that is indeed probably true. It just felt more natural for me this way. I am also sure it is a safe thing to do but due to the concerns and since it is not necessary at all, I am going to remove that commit. |
Sorry, something went wrong.
This imports a standard test from w3c/web-platform-tests (console-is-a-namespace).
|
New CI https://ci.nodejs.org/job/node-test-pull-request/12590/ |
Sorry, something went wrong.
According to the standard the property descriptor of console should be writable and non-enumerable. PR-URL: nodejs#17708 Fixes: nodejs#11805 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
This imports a standard test from w3c/web-platform-tests (console-is-a-namespace). PR-URL: nodejs#17708 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
PR-URL: nodejs#17708 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
The code currently assumes that `console` is already writable, but that's only if it was previously defined as writable. If it hasn't already been defined then the default value is false. Refs: #17708 PR-URL: #20185 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
The code currently assumes that `console` is already writable, but that's only if it was previously defined as writable. If it hasn't already been defined then the default value is false. Refs: #17708 PR-URL: #20185 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
According to the standard the property descriptor of console should be writable and non-enumerable. PR-URL: nodejs#17708 Fixes: nodejs#11805 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
This imports a standard test from w3c/web-platform-tests (console-is-a-namespace). PR-URL: nodejs#17708 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
PR-URL: nodejs#17708 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
The code attaches global properties to the sandbox context by iterating over all the enumerable properties of `global`. However, in node v10, `console` switched [to being non-enmuerable][1]. This means that for users of this library with node>10, any `console.log`s in evaluated scripts will fail. This commit fixes this issue by manually attaching console to the sandbox (when globals are being used). A test has been added. Prior to the change to eval.js, the test would pass in node v8 but fail in v10 and v12. Also, the tests were already failing in v12, because in v12 `process` also became non-enumerable. I've applied a similar fix to `process` to ensure that it's always available too. [1]: nodejs/node#17708
| Back | FazBrowse Home | New Git URL |
According to the standard the property descriptor of console
should be writable and non-enumerable.
Refs #12454
Fixes: #11805
Checklist
Affected core subsystem(s)
console