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

Name of function Intl.getCanonicalLocales is incorrectly CanonicalizeLocaleList -- should be hidden. #3204

Closed
dilijev opened this issue Jun 22, 2017 · 3 comments
Assignees
Labels
Milestone

Comments

@dilijev
Copy link
Contributor

dilijev commented Jun 22, 2017

print(Intl.DateTimeFormat.supportedLocalesOf);
print(Intl.getCanonicalLocales);
function() {
    [native code]
}
function CanonicalizeLocaleList() { [native code] }

Should do something similar here to hide name of the implementing function as we did for supportedLocalesOf.

@dilijev dilijev added the Bug label Jun 22, 2017
@dilijev dilijev added this to the 1.6 milestone Jun 22, 2017
@dilijev dilijev self-assigned this Jun 22, 2017
@dilijev dilijev changed the title Name of function Intl.getCanonicalLocales is CanonicalizeLocaleList. Name of function Intl.getCanonicalLocales is incorrectly CanonicalizeLocaleList -- should be hidden. Jun 22, 2017
@dilijev
Copy link
Contributor Author

dilijev commented Jul 7, 2017

See https://tc39.github.io/Function-prototype-toString-revision/#sec-function.prototype.tostring for a revision to the relevant spec text.

The gist is: in both old and new spec text, the function name is optional. Old: name can be anything. New: if included, the name must match the actual name of the function. The following two options (and variations of whitespace therein) are allowed:

function() {
    [native code]
}

function name() {
    [native code]
}

For consistency, will make Intl.getCanonicalLocales output match the pattern of toString from other built-in functions.

/cc @bterlson

@dilijev
Copy link
Contributor Author

dilijev commented Jul 11, 2017

> eshost -h d8,node,sm,jsc,ch-master -its test.js
## Source
print('' + Intl.DateTimeFormat.supportedLocalesOf);

┌───────────┬─────────────────────────────────────────────────┐
│ d8        │ function supportedLocalesOf() { [native code] } │
│ node      │                                                 │
├───────────┼─────────────────────────────────────────────────┤
│ jsc       │ function supportedLocalesOf() {                 │
│ sm        │     [native code]                               │
│           │ }                                               │
├───────────┼─────────────────────────────────────────────────┤
│ ch-master │ function() {                                    │
│           │     [native code]                               │
│           │ }                                               │
└───────────┴─────────────────────────────────────────────────┘

@dilijev
Copy link
Contributor Author

dilijev commented Jul 11, 2017

Related bug: Intl.getCanonicalLocales.name must be getCanonicalLocales.

dilijev added a commit to dilijev/ChakraCore that referenced this issue Jul 12, 2017
dilijev added a commit to dilijev/ChakraCore that referenced this issue Jul 12, 2017
chakrabot pushed a commit that referenced this issue Jul 20, 2017
…: name, toString, cannot call with new

Merge pull request #3323 from dilijev:intl-gcl-fix

Fixes #3203
Fixes #3204
chakrabot pushed a commit that referenced this issue Jul 20, 2017
…calLocales: name, toString, cannot call with new

Merge pull request #3323 from dilijev:intl-gcl-fix

Fixes #3203
Fixes #3204
chakrabot pushed a commit that referenced this issue Jul 20, 2017
…ntl.getCanonicalLocales: name, toString, cannot call with new

Merge pull request #3323 from dilijev:intl-gcl-fix

Fixes #3203
Fixes #3204
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

1 participant