This tests basic sanity in an ECMA-402 intl implementation.
For a complete test, see test262 (and on GitHub) which is maintained by Ecma TC39.
This file is part of my Node.JS ICU enablement work and is under the same license.
With node.js:
node btest402.js
With d8:
d8 btest402.js
With your browser:
- copy and paste the
btest402.js
file into your browser's console? that kind of works.
or
- view inbrowser.html and bring up your console
With the ECMA-402 shim:
- first, go get and install bower
- then, run
bower install ecma402
(or similar, see the ECMA-402 shim repo) - now, bring up viabower.html and bring up your console.
I'm just going to describe the SUMMARY results here (the last line printed). The rest of the output is more verbose and even more subject to change.
SUMMARY: NO Intl.
- You don't (even) have the Intl object needed for ES402 compliance.
SUMMARY: Have Intl, Date:no 'tlh',
- You probably have a 'reasonably complete' set of locale data. At least what this test tests so far..
SUMMARY: ... FYI: v8Brk:have 'en'
- ... you even have the
Intl.v8BreakIterator
extension, which isn't part of ES402. Just FYI.
SUMMARY:Have Intl, Date:no 'tlh', Date:'mt'=='en', Date:no 'ja',
- Ah.. You probably have the "small ICU" option I'm busy trying to get into node. English (at least.. American English) will work. But, hey, you've got a smaller binary size!
Steven R. Loomis < srl AT icu-project DOT org >