| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
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.
Sorry, something went wrong.
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.
Sorry, something went wrong.
There was a problem hiding this comment.
I think you can just drop this line
Sorry, something went wrong.
There was a problem hiding this comment.
Hm. I'd think the original caller wouldn't get a value, but I'll try it.
Sorry, something went wrong.
There was a problem hiding this comment.
@srl295 I’m referring to the comment, in case that’s not clear :)
Sorry, something went wrong.
There was a problem hiding this comment.
> process.versions.icu undefined > process.versions.icu '57.1'
so, I think I need this…
Sorry, something went wrong.
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
Sorry, something went wrong.
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
Sorry, something went wrong.
There was a problem hiding this comment.
Could you indent this so that the parameters align vertically?
Sorry, something went wrong.
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? 👎
Sorry, something went wrong.
There was a problem hiding this comment.
I would probably prefer an explicit return NULL; in the case of failure here.
Sorry, something went wrong.
There was a problem hiding this comment.
(whispers) nullptr
Sorry, something went wrong.
|
well, this isn't good: $ configure --without-intl
$ ./node
bootstrap_node.js:310
const icu = process.binding('icu');
^
Error: No such module: icu
at setupProcessICUVersions (bootstrap_node.js:310:25)
at startup (bootstrap_node.js:29:5)
at bootstrap_node.js:533:3
What's that about breaking non-intl builds? Looks like from url.js it seems I need a try/catch here… or is it better to check v8_enable_i18n_support or something? |
Sorry, something went wrong.
Sounds reasonable to me
Yeah, we probably should override util.inspect for process.versions. There’s some info about how to do that in the docs and a WIP PR with a more sophisticated example, if it helps. Or, if somebody else thinks that makes sense, we could add another Symbol that could be used for tagging objects so that util.inspect knows that it should resolve getters on that object, e.g.: 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 }` |
Sorry, something went wrong.
|
@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 require('util') from within bootstrap_node.js … 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 |
Sorry, something went wrong.
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;
Sorry, something went wrong.
There was a problem hiding this comment.
yes… that's what I wanted.
Sorry, something went wrong.
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.
Sorry, something went wrong.
|
by the way - I verified with lsof that ICU data is not loaded until after process.versions.cldr, etc, is called. So, the laziness is working. |
Sorry, something went wrong.
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?
Sorry, something went wrong.
There was a problem hiding this comment.
Oh... I see... nevermind, lazy loading and all that...
Sorry, something went wrong.
There was a problem hiding this comment.
Yeah, it could return an Array from C++ instead.
Sorry, something went wrong.
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.
Sorry, something went wrong.
* 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
|
@sam-github pointed out that 4fb27d4 was landed with bad formatting. |
Sorry, something went wrong.
|
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? :-) |
Sorry, something went wrong.
* 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 semver-minor?) |
Sorry, something went wrong.
|
Yes, this would be semver-minor, good catch. I added the label. |
Sorry, something went wrong.
|
Thanks and yes minor On Friday, October 28, 2016, James M Snell notifications@github.com wrote:
|
Sorry, something went wrong.
* 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? |
Sorry, something went wrong.
ping @srl295 |
Sorry, something went wrong.
|
Should land with #13221 if it lands on v6.x. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Checklist
Affected core subsystem(s)
intl, bootstrap_node.js
Description of change
Fixes: #9237