-
Notifications
You must be signed in to change notification settings - Fork 496
Add missing tests for 'length' value of Intl.Locale.prototype methods #4515
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
Open
anba
wants to merge
1
commit into
tc39:main
Choose a base branch
from
anba:locale-proto-length
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (C) 2025 André Bargull. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-Intl.DisplayNames.prototype.of | ||
description: > | ||
Intl.DisplayNames.prototype.of.length is 1. | ||
info: | | ||
ECMAScript Standard Built-in Objects | ||
|
||
Every built-in function object, including constructors, has a "length" property | ||
whose value is a non-negative integral Number. Unless otherwise specified, | ||
this value is the number of required parameters shown in the subclause heading | ||
for the function description. Optional parameters and rest parameters are not | ||
included in the parameter count. | ||
|
||
Unless otherwise specified, the "length" property of a built-in function object | ||
has the attributes { [[Writable]]: false, [[Enumerable]]: false, | ||
[[Configurable]]: true }. | ||
includes: [propertyHelper.js] | ||
features: [Intl.DisplayNames] | ||
---*/ | ||
|
||
verifyProperty(Intl.DisplayNames.prototype.of, "length", { | ||
value: 1, | ||
enumerable: false, | ||
writable: false, | ||
configurable: true, | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright (C) 2025 André Bargull. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-Intl.DisplayNames.prototype.of | ||
description: > | ||
Intl.DisplayNames.prototype.of.name is "of". | ||
info: | | ||
ECMAScript Standard Built-in Objects | ||
|
||
Every built-in function object, including constructors, has a "name" property | ||
whose value is a String. Unless otherwise specified, this value is the name | ||
that is given to the function in this specification. | ||
|
||
Unless otherwise specified, the "name" property of a built-in function object | ||
has the attributes { [[Writable]]: false, [[Enumerable]]: false, | ||
[[Configurable]]: true }. | ||
includes: [propertyHelper.js] | ||
features: [Intl.DisplayNames] | ||
---*/ | ||
|
||
verifyProperty(Intl.DisplayNames.prototype.of, "name", { | ||
value: "of", | ||
writable: false, | ||
enumerable: false, | ||
configurable: true, | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (C) 2025 André Bargull. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-Intl.Locale.prototype.baseName | ||
description: > | ||
get Intl.Locale.prototype.baseName.length is 0. | ||
info: | | ||
ECMAScript Standard Built-in Objects | ||
|
||
Every built-in function object, including constructors, has a "length" property | ||
whose value is a non-negative integral Number. Unless otherwise specified, | ||
this value is the number of required parameters shown in the subclause heading | ||
for the function description. Optional parameters and rest parameters are not | ||
included in the parameter count. | ||
|
||
Unless otherwise specified, the "length" property of a built-in function object | ||
has the attributes { [[Writable]]: false, [[Enumerable]]: false, | ||
[[Configurable]]: true }. | ||
includes: [propertyHelper.js] | ||
features: [Intl.Locale] | ||
---*/ | ||
|
||
const getter = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "baseName").get; | ||
verifyProperty(getter, "length", { | ||
value: 0, | ||
writable: false, | ||
enumerable: false, | ||
configurable: true, | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (C) 2025 André Bargull. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-Intl.Locale.prototype.calendar | ||
description: > | ||
get Intl.Locale.prototype.calendar.length is 0. | ||
info: | | ||
ECMAScript Standard Built-in Objects | ||
|
||
Every built-in function object, including constructors, has a "length" property | ||
whose value is a non-negative integral Number. Unless otherwise specified, | ||
this value is the number of required parameters shown in the subclause heading | ||
for the function description. Optional parameters and rest parameters are not | ||
included in the parameter count. | ||
|
||
Unless otherwise specified, the "length" property of a built-in function object | ||
has the attributes { [[Writable]]: false, [[Enumerable]]: false, | ||
[[Configurable]]: true }. | ||
includes: [propertyHelper.js] | ||
features: [Intl.Locale] | ||
---*/ | ||
|
||
const getter = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "calendar").get; | ||
verifyProperty(getter, "length", { | ||
value: 0, | ||
writable: false, | ||
enumerable: false, | ||
configurable: true, | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright (C) 2025 André Bargull. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-Intl.Locale.prototype.caseFirst | ||
description: > | ||
get Intl.Locale.prototype.caseFirst.length is 0. | ||
info: | | ||
ECMAScript Standard Built-in Objects | ||
|
||
Every built-in function object, including constructors, has a "length" property | ||
whose value is a non-negative integral Number. Unless otherwise specified, | ||
this value is the number of required parameters shown in the subclause heading | ||
for the function description. Optional parameters and rest parameters are not | ||
included in the parameter count. | ||
|
||
Unless otherwise specified, the "length" property of a built-in function object | ||
has the attributes { [[Writable]]: false, [[Enumerable]]: false, | ||
[[Configurable]]: true }. | ||
includes: [propertyHelper.js] | ||
features: [Intl.Locale] | ||
---*/ | ||
|
||
const propdesc = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "caseFirst"); | ||
if (propdesc !== undefined) { | ||
const getter = propdesc.get; | ||
verifyProperty(getter, "length", { | ||
value: 0, | ||
writable: false, | ||
enumerable: false, | ||
configurable: true, | ||
}); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (C) 2025 André Bargull. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-Intl.Locale.prototype.collation | ||
description: > | ||
get Intl.Locale.prototype.collation.length is 0. | ||
info: | | ||
ECMAScript Standard Built-in Objects | ||
|
||
Every built-in function object, including constructors, has a "length" property | ||
whose value is a non-negative integral Number. Unless otherwise specified, | ||
this value is the number of required parameters shown in the subclause heading | ||
for the function description. Optional parameters and rest parameters are not | ||
included in the parameter count. | ||
|
||
Unless otherwise specified, the "length" property of a built-in function object | ||
has the attributes { [[Writable]]: false, [[Enumerable]]: false, | ||
[[Configurable]]: true }. | ||
includes: [propertyHelper.js] | ||
features: [Intl.Locale] | ||
---*/ | ||
|
||
const getter = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "collation").get; | ||
verifyProperty(getter, "length", { | ||
value: 0, | ||
writable: false, | ||
enumerable: false, | ||
configurable: true, | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (C) 2025 André Bargull. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-Intl.Locale.prototype.firstDayOfWeek | ||
description: > | ||
get Intl.Locale.prototype.firstDayOfWeek.length is 0. | ||
info: | | ||
ECMAScript Standard Built-in Objects | ||
|
||
Every built-in function object, including constructors, has a "length" property | ||
whose value is a non-negative integral Number. Unless otherwise specified, | ||
this value is the number of required parameters shown in the subclause heading | ||
for the function description. Optional parameters and rest parameters are not | ||
included in the parameter count. | ||
|
||
Unless otherwise specified, the "length" property of a built-in function object | ||
has the attributes { [[Writable]]: false, [[Enumerable]]: false, | ||
[[Configurable]]: true }. | ||
includes: [propertyHelper.js] | ||
features: [Intl.Locale, Intl.Locale-info] | ||
---*/ | ||
|
||
const getter = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "firstDayOfWeek").get; | ||
verifyProperty(getter, "length", { | ||
value: 0, | ||
writable: false, | ||
enumerable: false, | ||
configurable: true, | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (C) 2025 André Bargull. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-Intl.Locale.prototype.getCalendars | ||
description: > | ||
Intl.Locale.prototype.getCalendars.length is 0. | ||
info: | | ||
ECMAScript Standard Built-in Objects | ||
|
||
Every built-in function object, including constructors, has a "length" property | ||
whose value is a non-negative integral Number. Unless otherwise specified, | ||
this value is the number of required parameters shown in the subclause heading | ||
for the function description. Optional parameters and rest parameters are not | ||
included in the parameter count. | ||
|
||
Unless otherwise specified, the "length" property of a built-in function object | ||
has the attributes { [[Writable]]: false, [[Enumerable]]: false, | ||
[[Configurable]]: true }. | ||
includes: [propertyHelper.js] | ||
features: [Intl.Locale, Intl.Locale-info] | ||
---*/ | ||
|
||
verifyProperty(Intl.Locale.prototype.getCalendars, "length", { | ||
value: 0, | ||
writable: false, | ||
enumerable: false, | ||
configurable: true, | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (C) 2025 André Bargull. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-Intl.Locale.prototype.getCollations | ||
description: > | ||
Intl.Locale.prototype.getCollations.length is 0. | ||
info: | | ||
ECMAScript Standard Built-in Objects | ||
|
||
Every built-in function object, including constructors, has a "length" property | ||
whose value is a non-negative integral Number. Unless otherwise specified, | ||
this value is the number of required parameters shown in the subclause heading | ||
for the function description. Optional parameters and rest parameters are not | ||
included in the parameter count. | ||
|
||
Unless otherwise specified, the "length" property of a built-in function object | ||
has the attributes { [[Writable]]: false, [[Enumerable]]: false, | ||
[[Configurable]]: true }. | ||
includes: [propertyHelper.js] | ||
features: [Intl.Locale, Intl.Locale-info] | ||
---*/ | ||
|
||
verifyProperty(Intl.Locale.prototype.getCollations, "length", { | ||
value: 0, | ||
writable: false, | ||
enumerable: false, | ||
configurable: true, | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (C) 2025 André Bargull. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-Intl.Locale.prototype.getHourCycles | ||
description: > | ||
Intl.Locale.prototype.getHourCycles.length is 0. | ||
info: | | ||
ECMAScript Standard Built-in Objects | ||
|
||
Every built-in function object, including constructors, has a "length" property | ||
whose value is a non-negative integral Number. Unless otherwise specified, | ||
this value is the number of required parameters shown in the subclause heading | ||
for the function description. Optional parameters and rest parameters are not | ||
included in the parameter count. | ||
|
||
Unless otherwise specified, the "length" property of a built-in function object | ||
has the attributes { [[Writable]]: false, [[Enumerable]]: false, | ||
[[Configurable]]: true }. | ||
includes: [propertyHelper.js] | ||
features: [Intl.Locale, Intl.Locale-info] | ||
---*/ | ||
|
||
verifyProperty(Intl.Locale.prototype.getHourCycles, "length", { | ||
value: 0, | ||
writable: false, | ||
enumerable: false, | ||
configurable: true, | ||
}); |
29 changes: 29 additions & 0 deletions
29
test/intl402/Locale/prototype/getNumberingSystems/length.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (C) 2025 André Bargull. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-Intl.Locale.prototype.getNumberingSystems | ||
description: > | ||
Intl.Locale.prototype.getNumberingSystems.length is 0. | ||
info: | | ||
ECMAScript Standard Built-in Objects | ||
|
||
Every built-in function object, including constructors, has a "length" property | ||
whose value is a non-negative integral Number. Unless otherwise specified, | ||
this value is the number of required parameters shown in the subclause heading | ||
for the function description. Optional parameters and rest parameters are not | ||
included in the parameter count. | ||
|
||
Unless otherwise specified, the "length" property of a built-in function object | ||
has the attributes { [[Writable]]: false, [[Enumerable]]: false, | ||
[[Configurable]]: true }. | ||
includes: [propertyHelper.js] | ||
features: [Intl.Locale, Intl.Locale-info] | ||
---*/ | ||
|
||
verifyProperty(Intl.Locale.prototype.getNumberingSystems, "length", { | ||
value: 0, | ||
writable: false, | ||
enumerable: false, | ||
configurable: true, | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (C) 2025 André Bargull. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-Intl.Locale.prototype.getTextInfo | ||
description: > | ||
Intl.Locale.prototype.getTextInfo.length is 0. | ||
info: | | ||
ECMAScript Standard Built-in Objects | ||
|
||
Every built-in function object, including constructors, has a "length" property | ||
whose value is a non-negative integral Number. Unless otherwise specified, | ||
this value is the number of required parameters shown in the subclause heading | ||
for the function description. Optional parameters and rest parameters are not | ||
included in the parameter count. | ||
|
||
Unless otherwise specified, the "length" property of a built-in function object | ||
has the attributes { [[Writable]]: false, [[Enumerable]]: false, | ||
[[Configurable]]: true }. | ||
includes: [propertyHelper.js] | ||
features: [Intl.Locale, Intl.Locale-info] | ||
---*/ | ||
|
||
verifyProperty(Intl.Locale.prototype.getTextInfo, "length", { | ||
value: 0, | ||
writable: false, | ||
enumerable: false, | ||
configurable: true, | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (C) 2025 André Bargull. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-Intl.Locale.prototype.getTimeZones | ||
description: > | ||
Intl.Locale.prototype.getTimeZones.length is 0. | ||
info: | | ||
ECMAScript Standard Built-in Objects | ||
|
||
Every built-in function object, including constructors, has a "length" property | ||
whose value is a non-negative integral Number. Unless otherwise specified, | ||
this value is the number of required parameters shown in the subclause heading | ||
for the function description. Optional parameters and rest parameters are not | ||
included in the parameter count. | ||
|
||
Unless otherwise specified, the "length" property of a built-in function object | ||
has the attributes { [[Writable]]: false, [[Enumerable]]: false, | ||
[[Configurable]]: true }. | ||
includes: [propertyHelper.js] | ||
features: [Intl.Locale, Intl.Locale-info] | ||
---*/ | ||
|
||
verifyProperty(Intl.Locale.prototype.getTimeZones, "length", { | ||
value: 0, | ||
writable: false, | ||
enumerable: false, | ||
configurable: true, | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you instead update the other tests to use verifyPrimordialCallableProperty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
verifyPrimordialCallableProperty
doesn't support accessor methods, therefore I've instead used plainverifyProperty
throughout this PR.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it does, and I'm specifically planning for uses like test/intl402/Locale/prototype/baseName/descriptor.js:
I'm also open to making even better accommodations, e.g.