mirror of https://github.com/lukechilds/node.git
Browse Source
It was never an official Ecma-402 API, it is about to be superseded by `Intl.Segmenter` and it's prone to crash under some circumstances. Searches don't turn up any usage in the wild and the recommendation from the V8 team is to remove it. Now seems like a good a time as any to do that. Fixes: https://github.com/nodejs/node/issues/8865 Fixes: https://github.com/nodejs/node/issues/14909 Refs: https://github.com/tc39/proposal-intl-segmenter Refs: https://chromium-review.googlesource.com/c/v8/v8/+/620755 PR-URL: https://github.com/nodejs/node/pull/15238 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>canary-base
Ben Noordhuis
7 years ago
committed by
Anna Henningsen
7 changed files with 35 additions and 32 deletions
@ -1,17 +1,10 @@ |
|||||
'use strict'; |
'use strict'; |
||||
const common = require('../common'); |
const common = require('../common'); |
||||
|
const assert = require('assert'); |
||||
|
const vm = require('vm'); |
||||
|
|
||||
if (!common.hasIntl || Intl.v8BreakIterator === undefined) |
if (typeof Intl === 'undefined') |
||||
common.skip('missing Intl'); |
common.skip('missing Intl'); |
||||
|
|
||||
const assert = require('assert'); |
assert(!('v8BreakIterator' in Intl)); |
||||
const warning = 'Intl.v8BreakIterator is deprecated and will be removed soon.'; |
assert(!vm.runInNewContext('"v8BreakIterator" in Intl')); |
||||
common.expectWarning('DeprecationWarning', warning); |
|
||||
|
|
||||
try { |
|
||||
new Intl.v8BreakIterator(); |
|
||||
// May succeed if data is available - OK
|
|
||||
} catch (e) { |
|
||||
// May throw this error if ICU data is not available - OK
|
|
||||
assert.throws(() => new Intl.v8BreakIterator(), /ICU data/); |
|
||||
} |
|
||||
|
Loading…
Reference in new issue