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

'length' property of DateTime Format Function #76

Closed
anba opened this issue Feb 12, 2016 · 6 comments
Closed

'length' property of DateTime Format Function #76

anba opened this issue Feb 12, 2016 · 6 comments
Labels
Milestone

Comments

@anba
Copy link
Contributor

anba commented Feb 12, 2016

The 'length' property of the DateTime Format function returned from get Intl.DateTimeFormat.prototype.format changed from 0 to 1 in ECMA-402, 2nd ed.

In ECMA-402, 1st ed:

a. Let F be a Function object, with internal properties set as specified for built-in functions in ES5, 15, or successor, and the length property set to 0, that takes the argument date and performs the following steps:

In ECMA-402, 2nd ed:

a. Let F be a new built-in function object as defined in 12.3.4.
b. The value of F’s length property is 1.

The change is not listed in Annex B, so I'm not sure if it was intentional.

(V8 and SpiderMonkey still return 0, test262 also tests for 0 (https://github.com/tc39/test262/blob/master/test/intl402/DateTimeFormat/prototype/format/12.3.2_1_a_L15.js). Only JavaScriptCore already returns 1.)

@caridy caridy added this to the 3rd Edition milestone Feb 12, 2016
@littledan
Copy link
Member

I'm fine with the new semantics v2 semantics remaining in place for v3. V8 has changed the length of a whole bunch of functions for ES2015 compliance, and we haven't gotten a lot of web-compat-based pushback. So I'll be surprised if this ends up being an issue.

@bterlson
Copy link
Member

Not concerned with changing length either.

@caridy
Copy link
Contributor

caridy commented Feb 29, 2016

Thanks you guys.

@anba do you want to send the PR? or should I take care of it? we are all running against time!

@anba
Copy link
Contributor Author

anba commented Feb 29, 2016

@caridy Do we need any PR for ecma402? Unless I'm misunderstanding @littledan's answer, he's okay with the v2 change.

@caridy
Copy link
Contributor

caridy commented Feb 29, 2016

They are Ok with the change, but the change was not listed in the Annex B, maybe we should just add it there.

@anba
Copy link
Contributor Author

anba commented Feb 29, 2016

Ah ok, I understand. It's probably better if you prepare a PR, because it's already a bit late in Europe. 😄

@caridy caridy closed this as completed in 3acd08b Mar 1, 2016
caridy added a commit that referenced this issue Mar 1, 2016
closes #76: annex B - 'length' property of DateTime Format Function set to 1 in 2nd edition
littledan added a commit to littledan/proposal-intl-plural-rules that referenced this issue Mar 18, 2017
Analogous to tc39/ecma402#76

This patch does not require a note about the length, as removing
the square brackets around the argument implicitly makes the length 1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants