Conversation
be6c2d7 to
1ee56e5
Compare
lib/internal/bootstrap_node.js
Outdated
There was a problem hiding this comment.
I usually find if (!icu) return; a bit easier to read, but maybe that’s only because it avoids the extra indentation level, so feel free to keep this as it is.
lib/internal/bootstrap_node.js
Outdated
There was a problem hiding this comment.
I think a comma-separated list is fine for this, but maybe the preceding comment should contain a quick reminder that icu.getVersion() without arguments returns the list of available different versions.
lib/internal/bootstrap_node.js
Outdated
There was a problem hiding this comment.
I think you can just drop this line
There was a problem hiding this comment.
Hm. I'd think the original caller wouldn't get a value, but I'll try it.
There was a problem hiding this comment.
@srl295 I’m referring to the comment, in case that’s not clear :)
There was a problem hiding this comment.
> process.versions.icu
undefined
> process.versions.icu
'57.1'
so, I think I need this…
There was a problem hiding this comment.
@srl295 what part did you remove? What I meant was the // set: setReal, comment, because that’s a leftover from copying, and it seems a bit confusing given that there is no setReal defined here
src/node_i18n.cc
Outdated
There was a problem hiding this comment.
I think the prevalent style in this codebase is having the * on the left, i.e. const char* everywhere
src/node_i18n.cc
Outdated
There was a problem hiding this comment.
Could you indent this so that the parameters align vertically?
There was a problem hiding this comment.
giving up on trying to use the ICU convention of "UErrorCode& status" here… I can't keep the NOLINT, arg indent, AND stay under the line width. What does cpplint have against non-const references? 👎
src/node_i18n.cc
Outdated
There was a problem hiding this comment.
I would probably prefer an explicit return NULL; in the case of failure here.
|
well, this isn't good: What's that about breaking non-intl builds? Looks like from |
Sounds reasonable to me
Yeah, we probably should override Or, if somebody else thinks that makes sense, we could add another Symbol that could be used for tagging objects so that const foobar = Object.create({}, {
a: {
get() { return 42; },
enumerable: true
}
});
console.log(foobar); // prints `{ a: [Getter] }`
foobar[util.inspect.resolveGetters] = true;
console.log(foobar); // prints `{ a: 42 }` |
|
@addaleax I'll look at those examples, and push what I have. I'd probably go for overriding in this PR and it can be made a tag later? Seems like that would want some more design than the low-level stuff I'm doing now. Update: It doesn't seem to work to This sort of works, but I don't know where it can be executed:
update update i found a place to run it… Also , rebased because of #9038 |
ad20744 to
9b5a808
Compare
lib/internal/bootstrap_node.js
Outdated
There was a problem hiding this comment.
You can also check process.binding('config').hasIntl here... e.g.
const icu = process.binding('config').hasIntl ?
process.binding('icu') : undefined;
There was a problem hiding this comment.
yes… that's what I wanted.
src/node_i18n.cc
Outdated
There was a problem hiding this comment.
This shouldn't be necessary to set explicitly. The function will return undefined automatically if no return value is set.
|
by the way - I verified with |
lib/internal/bootstrap_node.js
Outdated
There was a problem hiding this comment.
Why not have icu.getVersion() simply return an Array? Or perhaps (even better) an object with the keys and values already set so that there is only one call to the binding layer?
There was a problem hiding this comment.
Oh... I see... nevermind, lazy loading and all that...
There was a problem hiding this comment.
Yeah, it could return an Array from C++ instead.
lib/util.js
Outdated
There was a problem hiding this comment.
Just making sure - should this be "if intlEnabled"? It doesn't need to be, but just a question.
* Adds process.versions.cldr, .tz, and .unicode * Changes how process.versions.icu is loaded * Lazy loads the process.versions.* values for these * add an exception to util.js to cause 'node -p process.versions' to still work * update process.version docs Fixes: nodejs#9237
ed54858 to
e2a8cce
Compare
|
Landed in 4fb27d4 |
|
@sam-github pointed out that 4fb27d4 was landed with bad formatting. |
|
The PR and Reviewed-By metadata didn't get added during merge. @srl295 did you get the collaborator onboarding? Or was it long ago, and you forgot? :-) |
* Adds process.versions.cldr, .tz, and .unicode * Changes how process.versions.icu is loaded * Lazy loads the process.versions.* values for these * add an exception to util.js to cause 'node -p process.versions' to still work * update process.version docs Fixes: #9237
|
@srl295 Since I’ve found it helpful that others added the metadata as a github comment on commits where I had forgotten to add it, I’ve gone ahead and did the same + took the liberty to add me as a reviewer. :) (Also: Is this |
|
Yes, this would be semver-minor, good catch. I added the label. |
|
Thanks and yes minor On Friday, October 28, 2016, James M Snell notifications@github.com wrote:
|
* Adds process.versions.cldr, .tz, and .unicode * Changes how process.versions.icu is loaded * Lazy loads the process.versions.* values for these * add an exception to util.js to cause 'node -p process.versions' to still work * update process.version docs PR-URL: #9266 Fixes: #9237 Reviewed-By: James M Snell <jasnell@gmail.com>
|
adding don't land for v4.x is this something we would want to consider in a future minor to v6? |
ping @srl295 |
|
Should land with #13221 if it lands on v6.x. |
Checklist
make -j8 test(UNIX), orvcbuild test nosign(Windows) passesAffected core subsystem(s)
intl, bootstrap_node.js
Description of change
Fixes: #9237