Skip to content

lib: simplify the readonly properties of icu#13221

Closed
JacksonTian wants to merge 1 commit into
nodejs:masterfrom
JacksonTian:versions
Closed

lib: simplify the readonly properties of icu#13221
JacksonTian wants to merge 1 commit into
nodejs:masterfrom
JacksonTian:versions

Conversation

@JacksonTian

@JacksonTian JacksonTian commented May 25, 2017

Copy link
Copy Markdown
Contributor

Call Object.defineProperty() twice to set readonly property is
unnecessary.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

lib/internal/bootstrap_node

@nodejs-github-bot nodejs-github-bot added the lib / src Issues and PRs related to general changes in the lib or src directory. label May 25, 2017
@mscdex mscdex added i18n-api Issues and PRs related to the i18n implementation. and removed lib / src Issues and PRs related to general changes in the lib or src directory. labels May 25, 2017
@refack

refack commented May 25, 2017

Copy link
Copy Markdown
Contributor

I'd assume this whole mechanism is necessary if the locale is changed in runtime. @nodejs/intl is there a way to do that?

Comment thread test/parallel/test-process-versions.js Outdated

Copy link
Copy Markdown
Member

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?

@kunalspathak

kunalspathak commented May 26, 2017

Copy link
Copy Markdown
Member

I'd assume this whole mechanism is necessary if the locale is changed in runtime.

Good point. But I am wondering if the locale changed at runtime, icu.getVersion(name); would still return the locales present when node instance was bootstrapped.

@JacksonTian

Copy link
Copy Markdown
Contributor Author

Yes, The locale can be changed, but the ICU version not.

@jasnell

jasnell commented Jun 1, 2017

Copy link
Copy Markdown
Member

ping @srl295

Call Object.defineProperty() twice to set readonly property is
unnecessary.
@BridgeAR

Copy link
Copy Markdown
Member

I guess this can land as is?

@jasnell

jasnell commented Aug 30, 2017

Copy link
Copy Markdown
Member

With fresh CI, yes I believe it can.

@BridgeAR

Copy link
Copy Markdown
Member

@BridgeAR

Copy link
Copy Markdown
Member

Landed in 83a5eef

@BridgeAR BridgeAR closed this Aug 30, 2017
BridgeAR pushed a commit that referenced this pull request Aug 30, 2017
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>

@srl295 srl295 left a comment

Copy link
Copy Markdown
Member

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

@srl295

srl295 commented Aug 30, 2017

Copy link
Copy Markdown
Member

@refack no, i don't think there's a mechanism to change the default locale at runtime exposed to node.

@JacksonTian JacksonTian deleted the versions branch September 2, 2017 08:01
addaleax pushed a commit to addaleax/ayo that referenced this pull request Sep 5, 2017
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>
MylesBorins pushed a commit that referenced this pull request Sep 10, 2017
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>
@MylesBorins MylesBorins mentioned this pull request Sep 10, 2017
MylesBorins pushed a commit that referenced this pull request Sep 12, 2017
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>
@MylesBorins

Copy link
Copy Markdown
Contributor

Should this be backported to v6.x-staging? If yes please follow the guide and raise a backport PR, if no let me know or add the dont-land-on label.

@JacksonTian

Copy link
Copy Markdown
Contributor Author

@MylesBorins It seems the pre-condition #9266 hasn't be backported into v6.x-staging.

@gibfahn

gibfahn commented Sep 24, 2017

Copy link
Copy Markdown
Member

Left a note on #9266, marking this as don't land for now so we don't keep triaging it for 6.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

i18n-api Issues and PRs related to the i18n implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.