Comments (9)
ECMA-402 constructors only check for undefined before calling ToObject.
Yes, that's why I wrote ECMA-402.
from proposal-intl-locale.
I thought throwing was decent behavior there, and would match WebIDL dictionaries. What else should it do besides throw?
from proposal-intl-locale.
What else should it do besides throw?
10. If options is undefined, then
a. Let options be ! ObjectCreate(null).
becomes
10. If options is undefined or null, then
a. Let options be ! ObjectCreate(null).
I ask because I see checks for undefined or null before doing ToObject
in ECMA-262.
from proposal-intl-locale.
I ask because I see checks for undefined or null before doing ToObject in ECMA-262.
ECMA-402 constructors only check for undefined
before calling ToObject
.
from proposal-intl-locale.
ECMA-402 constructors only check for undefined before calling ToObject.
https://tc39.github.io/ecma262/#sec-object-value
from proposal-intl-locale.
FWIW looks like I remembered wrong and WebIDL actually accepts null for dictionaries, with similar semantics to undefined.
from proposal-intl-locale.
So IMO the decision whether or not null
should be allowed as an options
value should be decided over at tc39/ecma402 and not here. And if it should be allowed, all other Intl constructors should be changed to allow null
, too.
from proposal-intl-locale.
Proposal: Let's disallow null
for now, following existing ECMA-402 conventions, and consider permitting it everywhere in a future attempt to upgrade to WebIDL (which will change everything else too).
from proposal-intl-locale.
We discussed this issue in the May 2018 ECMA-402 meeting, concluding throwing. I haven't heard any concerns about this path following 402 conventions, so closing the issue.
from proposal-intl-locale.
Related Issues (20)
- Modified CanonicalizeLocaleList does not accept Intl.Locale instances when provided as the only argument HOT 1
- Using Unicode locale ID vs BCP 47 in our spec HOT 51
- Resolved value for Unicode extension values when "true" is removed? HOT 4
- Simplified the change to 2.1 CanonicalizeLocaleList HOT 3
- Docs(MDN) Documentation for Intl.Locale HOT 17
- Does hourCycle exist unconditionally? HOT 3
- Not all RFC 5646 production names updated HOT 3
- Move "get caseFirst" after "get calendar"
- Update references to match current UTS 35 spec HOT 11
- Use `type` production from UTS35
- Directly use unicode_language_id in "get baseName"
- Need to test for SameValue(r.[[kn]], "") in addition to SameValue(r.[[kn]], "true")
- no validation of value of extensions in tag? HOT 8
- CanonicalizeLanguageTag should remove duplicate attributes/keywords in a Unicode extension, consistent with Intl.Locale HOT 6
- Getting the default locale HOT 10
- Drop this proposal in favor of a more general user settings object HOT 6
- Spec is vague regarding internal data structure representation HOT 12
- Canonicalise Unicode extensions options added through ResolveLocale HOT 8
- CanonicalizeUnicodeLocaleId should only perform step 1 of "BCP 47 Language Tag to Unicode BCP 47 Locale Identifier" HOT 3
- Archive repository, redirect draft to ecma402 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proposal-intl-locale.