-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
console - writable property #11805
Comments
Sounds OK to me, @Wandalen, are you going to PR this? |
OK fixing or OK leaving as is? :) I would be glad to make a pull request. |
@Wandalen If you want, you can open a PR; the code you’ll want to look at is in It’s not as simple as just switching a boolean, though; I think you might need to do something like I think it’s both ok to fix this and to leave it as is – the property is still configurable, so if you really want to, you can Let us know if you have any questions or there’s something we can help with! |
Yes, sure, I will do. Thank you for hints, Addaleax. |
FYI: I think you could pick a test from WPT to test writable console as like test-whatwg-url-constructor.js. |
Understood, thank you. Will find free time soon. |
The first commit makes console overridable without delete with minimum changes. |
That is true, but Node.js has always had |
@TimothyGu changes which you requested break test suite. |
@TimothyGu thanks for your suggestions. Regarding the test case, I can try. Do you think that aspect of functionality covered by tests good enough to trust them? Currently, don't see why it would be impossible. |
@TimothyGu, @watilde, @addaleax, @sam-github, @bnoordhuis, @Fishrock123 do you want any other adjustment? Can I be useful with other related issue? |
make console overridable by custom console( without delete ) add test suite from w3c/web-platform-tests( console-is-a-namespace ) few test cases commented out from the test suite to make nodejs console even more consistent further changes needed which will come in the next commit which could be more breaking than this one Fixes: nodejs#11805
according to the standard property descriptor of console should be writable, have value and be not enumerable adjust test suite imported from w3c/web-platform-tests( console-is-a-namespace ) one test case still is commented out from the test suite to make nodejs console even more consistent further changes needed which will come in the next commit which could be more breaking than this one Fixes: nodejs#11805
If global.console write undefined would come earlier than global.console read then lazy read in get would happen, despite write was done. This commit fix the problem. Fixes: nodejs#11805
I revived #12454 in the hopes of getting it landed (or, if there are firm objections to the whole concept, closed). |
I am writing testing utilities and have trouble on nodejs platform ridding off unwanted output.
"console" is writable property in a browser. On nodejs "console's" methods could be rewritten iterating them, so making "console" non-writable does not give any insurance, but only make solving of my problem and similar more tedious. From my point of view having "console" non-writable counter-intuitive neither reasonable.
I propose to return writability to "console".
The text was updated successfully, but these errors were encountered: