console: prevent constructing console methods#26096
console: prevent constructing console methods#26096Hakerh400 wants to merge 1 commit intonodejs:masterfrom Hakerh400:console
Conversation
|
Can you add a test? Lines 278 to 279 in de2bdfb |
Sure.
It's mentioned in the PR description: "It prevents constructing methods of console instance, except for the global console". Please read the relevant discussion in #25987. I will open separate PR for |
Sorry for not reading the PR description carefully *_*
https://github.com/Hakerh400/node/commit/f084076963c7cdb0dbdcf8ad281c557021f50fc1 affects many other things because the behavior change is done in |
|
Thanks. Applied the suggestion & added a test. |
src/inspector_js_api.cc
Outdated
There was a problem hiding this comment.
This could probably use FIXED_ONE_BYTE_STRING
There was a problem hiding this comment.
Added FIXED_ONE_BYTE_STRING for consistency with conn_str from inspector::Initialize
lib/internal/console/constructor.js
Outdated
There was a problem hiding this comment.
Can you put this near the end of the file and keep most of the implementation closer to where they used to be to preserve more git blame history?
There was a problem hiding this comment.
Added two new lines to align some diffs. All methods are in the same order as before, but console.table pretty much destroys the rest. Not sure if that is fixable.
|
Rebased and resolved the conflict that has just appeared. |
|
@Hakerh400 There wasn’t much activity here because we had a security release being prepared, meaning that e.g. CI only had limited availability. |
|
Landed in e9ed6b9, thanks for the PR! 🎉 |
|
Should this be backported to |
To whom the question is directed? If the general opinion is biased towards backporting, I'll open PR. |
|
I backported this directly to the staging branch. |
|
@Hakerh400 most of the time the person who originally opened the PR is also the best to backport it and to judge if it makes sense to backport something. But anybody could come along and just do that, so it's a generic question about how people feel about backporting something. |
Ref: #25987
This PR defined all console methods (except the ones intended for internal use) as methods rather than constructible functions. It prevents constructing methods of console instance, except for the global console (opened as separate PR as per #25987 (comment)).
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes