Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

srl295
Copy link
Member

@srl295 srl295 commented Dec 12, 2015

Getting this going…  need to rebase

@srl295 srl295 force-pushed the nobreak branch 2 times, most recently from 81c275d to d8b0b26 Compare December 12, 2015 01:30
@srl295
Copy link
Member Author

srl295 commented Dec 12, 2015

Rebased. Problem, it doesn't actually work. My changes to src/node.js Don't seem to have effect after rebase.

@srl295 srl295 self-assigned this Dec 12, 2015
@srl295 srl295 added the wip Issues and PRs that are still a work in progress. label Dec 12, 2015
@mscdex mscdex added the lib / src Issues and PRs related to general changes in the lib or src directory. label Dec 12, 2015
@Fishrock123
Copy link
Contributor

linking: #3111

@srl295 srl295 added i18n-api Issues and PRs related to the i18n implementation. and removed wip Issues and PRs that are still a work in progress. labels Apr 9, 2016
@srl295
Copy link
Member Author

srl295 commented Apr 9, 2016

OK, it's working again. Can I get a LGTM?

@srl295
Copy link
Member Author

srl295 commented Apr 9, 2016

To test:
node -e 'new Intl.v8BreakIterator()'

before: crashes in small-icu (which is our default)
after: no crash

$ ./node -e 'new Intl.v8BreakIterator()'
internal/process.js:72
        throw Error('Data not available...'); 
        ^
Error: Data not available...
    at Error (native)
    at new v8BreakIterator (internal/process.js:72:15)
    at [eval]:1:1
    at Object.exports.runInThisContext (vm.js:54:17)
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:416:34)
    at node.js:317:27
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)

@srl295
Copy link
Member Author

srl295 commented Apr 9, 2016

  • add test

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')
Copy link
Member

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 &&
    // ...

Copy link
Member Author

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.

@srl295
Copy link
Member Author

srl295 commented Apr 11, 2016

Updated, PTAL

//
if (global.hasOwnProperty('Intl') &&
Intl.hasOwnProperty('v8BreakIterator') &&
process.config.variables.icu_small &&
Copy link
Member

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?

@srl295
Copy link
Member Author

srl295 commented Apr 11, 2016

  • linter happy
  • test updated

// Intl.v8BreakIterator() would crash v8 with a nastygram here, throw instead.
if (global.hasOwnProperty('Intl') &&
Intl.hasOwnProperty('v8BreakIterator') &&
process.config.variables.icu_small &&
Copy link
Member

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.

@srl295
Copy link
Member Author

srl295 commented May 3, 2016

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
@jasnell
Copy link
Member

jasnell commented May 3, 2016

LGTM if CI is green :-)

@srl295
Copy link
Member Author

srl295 commented May 3, 2016

ci build in progress…

@srl295
Copy link
Member Author

srl295 commented May 3, 2016

srl295 added a commit that referenced this pull request May 4, 2016
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 <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@srl295
Copy link
Member Author

srl295 commented May 4, 2016

Landed in cd752e8

@srl295 srl295 closed this May 4, 2016
@srl295 srl295 deleted the nobreak branch May 4, 2016 22:07
evanlucas pushed a commit that referenced this pull request May 17, 2016
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 <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@MylesBorins
Copy link
Contributor

@srl295 this does not land cleanly on v4.x would you be willing to manually backport?

@srl295
Copy link
Member Author

srl295 commented Jun 1, 2016

Yes. Probably an earlier version would. Or maybe depend on back porting the other process change @jasnell ?

@MylesBorins
Copy link
Contributor

@srl295 / @jasnell ping

@MylesBorins
Copy link
Contributor

@srl295 ping

@srl295 srl295 changed the title nodejs/node#3111 - WIP v8BreakIterator disablement nodejs/node#3111 - v8BreakIterator disablement Oct 10, 2016
@srl295
Copy link
Member Author

srl295 commented Oct 10, 2016

#9008 is the v4.x backport.

MylesBorins pushed a commit that referenced this pull request Oct 10, 2016
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 <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
MylesBorins pushed a commit that referenced this pull request Oct 10, 2016
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 <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
rvagg pushed a commit that referenced this pull request Oct 18, 2016
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 <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
MylesBorins pushed a commit that referenced this pull request Oct 26, 2016
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 <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@MylesBorins MylesBorins mentioned this pull request Oct 26, 2016
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. lib / src Issues and PRs related to general changes in the lib or src directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants