Closed
Bug 1116390
Opened 9 years ago
Closed 9 years ago
Implement %TypedArray%.prototype.{every, some}
Categories
(Core :: JavaScript: Standard Library, defect)
Core
JavaScript: Standard Library
Tracking
()
RESOLVED
FIXED
mozilla37
People
(Reporter: 446240525, Assigned: 446240525)
References
Details
(Keywords: dev-doc-complete, Whiteboard: [DocArea=JS])
Attachments
(1 file, 1 obsolete file)
14.77 KB,
patch
|
446240525
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Attachment #8542762 -
Flags: review?(evilpies)
Comment 2•9 years ago
|
||
Comment on attachment 8542762 [details] [diff] [review] bug-1116390-v1.patch Review of attachment 8542762 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/tests/ecma_6/TypedArray/every-and-some.js @@ +90,5 @@ > + assertThrowsInstanceOf(() => { > + arr.every(); > + }, TypeError); > + var invalidCallbacks = [undefined, null, 1, false, "", Symbol(), [], {}, /./]; > + invalidCallbacks.every(callback => { forEach :) @@ +105,5 @@ > + // Called from other globals. > + if (typeof newGlobal === "function") { > + var every = newGlobal()[constructor.name].prototype.every; > + var sum = 0; > + every.call(new constructor([1, 2, 3]), v => sum += v); assertEq(..., true) @@ +139,5 @@ > + assertEq(new constructor([1, 2, 3]).some(v => v % 2), true); > + assertEq(new constructor([0, 2, 4]).some(v => v % 2), false); > + assertEq(new constructor([1, 3, 5]).some(v => v > 2), true); > + assertEq(new constructor([1, 3, 5]).some(v => v < 0), false); > + assertEq(new constructor(10).some(v => v !== 0), false); Wouldn't this be true? @@ +213,5 @@ > + assertThrowsInstanceOf(() => { > + arr.some(); > + }, TypeError); > + var invalidCallbacks = [undefined, null, 1, false, "", Symbol(), [], {}, /./]; > + invalidCallbacks.some(callback => { forEach @@ +228,5 @@ > + // Called from other globals. > + if (typeof newGlobal === "function") { > + var some = newGlobal()[constructor.name].prototype.some; > + var sum = 0; > + some.call(new constructor([1, 2, 3]), v => { assertEq(..., false)
Attachment #8542762 -
Flags: review?(evilpies) → review+
Comment on attachment 8542762 [details] [diff] [review] bug-1116390-v1.patch Review of attachment 8542762 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/tests/ecma_6/TypedArray/every-and-some.js @@ +139,5 @@ > + assertEq(new constructor([1, 2, 3]).some(v => v % 2), true); > + assertEq(new constructor([0, 2, 4]).some(v => v % 2), false); > + assertEq(new constructor([1, 3, 5]).some(v => v > 2), true); > + assertEq(new constructor([1, 3, 5]).some(v => v < 0), false); > + assertEq(new constructor(10).some(v => v !== 0), false); I guess you mean line 144? Because the `some` method always returns `false` when called on empty arrays.
Comment 4•9 years ago
|
||
Comment on attachment 8542762 [details] [diff] [review] bug-1116390-v1.patch Review of attachment 8542762 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/tests/ecma_6/TypedArray/every-and-some.js @@ +139,5 @@ > + assertEq(new constructor([1, 2, 3]).some(v => v % 2), true); > + assertEq(new constructor([0, 2, 4]).some(v => v % 2), false); > + assertEq(new constructor([1, 3, 5]).some(v => v > 2), true); > + assertEq(new constructor([1, 3, 5]).some(v => v < 0), false); > + assertEq(new constructor(10).some(v => v !== 0), false); Oh, sorry. I read this as new constructor([10])
Attachment #8542762 -
Attachment is obsolete: true
Attachment #8543509 -
Flags: review+
Comment 7•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/c963d611da18
Flags: in-testsuite+
Keywords: checkin-needed
Comment 8•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/c963d611da18
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
Comment 9•9 years ago
|
||
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some https://developer.mozilla.org/en-US/Firefox/Releases/37#JavaScript
Keywords: dev-doc-needed → dev-doc-complete
You need to log in
before you can comment on or make changes to this bug.
Description
•