-
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
nodejs/node#3111 - v8BreakIterator disablement #4253
Conversation
81c275d
to
d8b0b26
Compare
Rebased. Problem, it doesn't actually work. My changes to |
linking: #3111 |
OK, it's working again. Can I get a LGTM? |
To test: before: crashes in
|
Question: what's the best way to test this? |
@@ -65,6 +65,13 @@ function setupConfig(_source) { | |||
if (value === 'false') return false; | |||
return value; | |||
}); | |||
if ( process.config.variables.v8_enable_i18n_support && global.hasOwnProperty('Intl') |
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.
Style error: space after (
. Can you put each check on its own line, followed by the &&
? You'll also need to start with:
if (process.config &&
process.config.variables &&
// ...
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.
Thanks. I'll drop the check for process.config.variables.v8_enable_i18n_support
also. For this code's purpose, checking Intl
is enough. One fewer dependency on an internal v8 variable is better.
Updated, PTAL |
// | ||
if (global.hasOwnProperty('Intl') && | ||
Intl.hasOwnProperty('v8BreakIterator') && | ||
process.config.variables.icu_small && |
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.
You still need a process.config && process.config.variables
feature check here and can you make sure make lint
passes?
|
// Intl.v8BreakIterator() would crash v8 with a nastygram here, throw instead. | ||
if (global.hasOwnProperty('Intl') && | ||
Intl.hasOwnProperty('v8BreakIterator') && | ||
process.config.variables.icu_small && |
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.
Needs a process.config && process.config.variables
feature check.
7da4fd4
to
c7066fb
Compare
Updated, rebased. Thanks @jasnell |
If the undocumented v8BreakIterator does not have data available, monkeypatch it to throw an error instead of crashing. Fixes nodejs#3111
LGTM if CI is green :-) |
ci build in progress… |
If the undocumented v8BreakIterator does not have data available, monkeypatch it to throw an error instead of crashing. Fixes: #3111 PR-URL: #4253 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
Landed in cd752e8 |
If the undocumented v8BreakIterator does not have data available, monkeypatch it to throw an error instead of crashing. Fixes: #3111 PR-URL: #4253 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
@srl295 this does not land cleanly on |
Yes. Probably an earlier version would. Or maybe depend on back porting the other process change @jasnell ? |
@srl295 ping |
#9008 is the v4.x backport. |
If the undocumented v8BreakIterator does not have data available, monkeypatch it to throw an error instead of crashing. Fixes: #3111 Ref: #9008 PR-URL: #4253 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
If the undocumented v8BreakIterator does not have data available, monkeypatch it to throw an error instead of crashing. Fixes: #3111 Ref: #9008 PR-URL: #4253 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
If the undocumented v8BreakIterator does not have data available, monkeypatch it to throw an error instead of crashing. Fixes: #3111 Ref: #9008 PR-URL: #4253 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
If the undocumented v8BreakIterator does not have data available, monkeypatch it to throw an error instead of crashing. Fixes: #3111 Ref: #9008 PR-URL: #4253 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
Getting this going… need to rebase