-
Notifications
You must be signed in to change notification settings - Fork 30k
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
lib: simplify the readonly properties of icu #13221
Conversation
I'd assume this whole mechanism is necessary if the locale is changed in runtime. @nodejs/intl is there a way to do that? |
@@ -28,3 +28,9 @@ assert(/^\d+\.\d+\.\d+(-.*)?$/.test(process.versions.uv)); | |||
assert(/^\d+\.\d+\.\d+(-.*)?$/.test(process.versions.zlib)); | |||
assert(/^\d+\.\d+\.\d+(\.\d+)?$/.test(process.versions.v8)); | |||
assert(/^\d+$/.test(process.versions.modules)); | |||
|
|||
for (let i = 0; i < expected_keys.length; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Can you switch to for(var key of expected_keys) { }
instead?
Good point. But I am wondering if the locale changed at runtime, |
Yes, The locale can be changed, but the ICU version not. |
ping @srl295 |
Call Object.defineProperty() twice to set readonly property is unnecessary.
I guess this can land as is? |
With fresh CI, yes I believe it can. |
Landed in 83a5eef |
Call Object.defineProperty() twice to set readonly property is unnecessary. PR-URL: #13221 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 makes it look too easy
@refack no, i don't think there's a mechanism to change the default locale at runtime exposed to node. |
Call Object.defineProperty() twice to set readonly property is unnecessary. PR-URL: nodejs/node#13221 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Call Object.defineProperty() twice to set readonly property is unnecessary. PR-URL: #13221 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Call Object.defineProperty() twice to set readonly property is unnecessary. PR-URL: #13221 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Should this be backported to |
@MylesBorins It seems the pre-condition #9266 hasn't be backported into v6.x-staging. |
Left a note on #9266, marking this as don't land for now so we don't keep triaging it for 6.x. |
Call Object.defineProperty() twice to set readonly property is
unnecessary.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
lib/internal/bootstrap_node