Implement the .at() proposal
Categories
(Core :: JavaScript: Standard Library, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox85 | --- | fixed |
People
(Reporter: yulia, Assigned: evilpie)
References
(Blocks 1 open bug, )
Details
(Keywords: dev-doc-complete)
Attachments
(5 files, 1 obsolete file)
https://github.com/tabatkins/proposal-item-method
The proposal is currently on Stage 2.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 1•4 years ago
|
||
Assignee | ||
Comment 2•4 years ago
|
||
I noticed this while looking at the iongraph for a simple item call
with a constant parameter. The input is boxed because before optimization
it is apparently an untyped PHI.
Depends on D90732
Updated•4 years ago
|
Assignee | ||
Comment 3•4 years ago
|
||
I only added some very basic tests here under the assumption that
test262 is going to add a broader range of tests.
Depends on D90732
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Comment 4•4 years ago
|
||
Apparently the item
proposal advanced to Stage 3, but with String.prototype.item
still included. However there seems to be some agreement that this should probably not be part of the proposal at least without a better justification: https://github.com/tc39/proposal-item-method/issues/20
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Comment 6•4 years ago
|
||
bugherder |
Updated•4 years ago
|
Assignee | ||
Comment 8•4 years ago
|
||
Comment 10•4 years ago
|
||
Comment 11•4 years ago
|
||
bugherder |
Assignee | ||
Comment 12•4 years ago
|
||
André pointed out that we will need to handle Array.prototype[@@unscopables]
at some point: https://github.com/tc39/proposal-item-method/issues/30.
Assignee | ||
Comment 13•4 years ago
|
||
I opened another issue for the web compatibility issue with Yui2 that broke bugzilla: https://github.com/tc39/proposal-item-method/issues/31
Comment 14•4 years ago
|
||
Backed out for the reason mentioned above: https://hg.mozilla.org/mozilla-central/rev/b8d82fc2371e020ade6144aa7f5892bf979761bb
Updated•4 years ago
|
Assignee | ||
Comment 15•4 years ago
|
||
There are too many web compatibility issues. Keeping this on Nightly is not going
to be useful.
Comment 16•4 years ago
|
||
Comment 17•4 years ago
|
||
bugherder |
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Comment 18•4 years ago
|
||
Comment 19•4 years ago
|
||
Comment 20•4 years ago
|
||
bugherder |
Assignee | ||
Updated•4 years ago
|
Comment 21•4 years ago
|
||
It doesn't seem to work with this test from http://kangax.github.io/compat-table/esnext/ :
return [
'Int8Array',
'Uint8Array',
'Uint8ClampedArray',
'Int16Array',
'Uint16Array',
'Int32Array',
'Uint32Array',
'Float32Array',
'Float64Array',
'BigInt64Array',
'BigUint64Array'
].every(function (TypedArray) {
var Constructor = globalThis[TypedArray];
if (typeof Constructor !== 'function') {
return true;
}
var arr = new Constructor([1, 2, 3]);
return arr.at(0) === 1
&& arr.at(-3) === 1
&& arr.at(1) === 2
&& arr.at(-2) === 2
&& arr.at(2) === 3
&& arr.at(-1) === 3
&& arr.at(3) === undefined
&& arr.at(-4) === undefined;
});
Should it?
Assignee | ||
Comment 22•4 years ago
|
||
The error is "can't convert 1 to BigInt". Coming from doing new BigInt64Array([1, 2, 3])
(via new Constructor ..
) So the test is wrong and the failure is unrelated to at
.
Updated•4 years ago
|
Comment 23•4 years ago
|
||
Setting this to dev-doc-complete. @rumyra documented it, the details are all available at https://github.com/mdn/content/issues/307, and the pages should appear on MDN in the next 24 hours or so.
Description
•