Closed Bug 1313112 Opened 8 years ago Closed 8 years ago

Deprecate and remove ArrayBuffer.slice

Categories

(Core :: JavaScript: Standard Library, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla53
Tracking Status
firefox53 --- fixed

People

(Reporter: evilpie, Assigned: evilpie)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-complete, site-compat)

Attachments

(1 file)

Another "generic" function that was added to the constructor. I think this method is relatively unknown, because it's not documented on MDN and almost nobody really needs to work on ArrayBuffers.

We should land a warning in this cycle and then remove it in the next cycle.
Assignee: nobody → evilpies
Summary: Deprecate and remove ArrayBuffers.slice → Deprecate and remove ArrayBuffer.slice
Jukka, are you using this?  I ask because you made some noises about SharedArrayBuffer's slice (though that could have been the instance method, not the static method).
Flags: needinfo?(jujjyl)
(In reply to Tom Schuster [:evilpie] from comment #0)
> Another "generic" function that was added to the constructor. I think this
> method is relatively unknown, because it's not documented on MDN and almost
> nobody really needs to work on ArrayBuffers.
> 
> We should land a warning in this cycle and then remove it in the next cycle.

Is this the function that is being removed? https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/slice . It is documented on MDN. Why would we remove that, it seems like an useful functionality?

(In reply to Lars T Hansen [:lth] from comment #1)
> Jukka, are you using this?  I ask because you made some noises about
> SharedArrayBuffer's slice (though that could have been the instance method,
> not the static method).

We are using that, and have a polyfill to add SharedArrayBuffer.slice() as well. I don't know off the top of my head though what the extent of our usage of that is, and if we could remove all uses. However, it's an useful function, I don't think we should remove that? (What's the alternative code form?) Since it is documented, we should also modify the documentation page to show that it's deprecated and point to the alternative code paths. Also, is there a standards body discussion about this somewhere?

(Or perhaps I missed the point altogether, and it's about some other function signature and not the exact one I linked to?)
Flags: needinfo?(jujjyl)
It's not about prototype's property that's in the MDN page, but constructor's property.
so, literally "ArrayBuffer.slice".
Yes, importantly:

ArrayBuffer.prototype.slice is in Ecma262
SharedArrayBuffer.prototype.slice is in the SAB+Atomics proposal (and now in Firefox)

ArrayBuffer.slice is a Firefox-only static method with a different signature; a dead-end feature
There is no SharedArrayBuffer.slice
Thanks, that makes sense. Yeah, we don't use ArrayBuffer.slice(myBuffer, ...), but only myBuffer.slice(...), so removing the static version sounds ok to me.
Depends on: 1316913
The warning patch landed in 52, should we risk removing this in 53?
I haven't actually tested this, because of my laptop situation, but I am pretty optimistic this will work.
Attachment #8817697 - Flags: review?(arai.unmht)
Comment on attachment 8817697 [details] [diff] [review]
Remove non-standard static ArrayBuffers.slice (not ArrayBuffer.prototype.slice)

Review of attachment 8817697 [details] [diff] [review]:
-----------------------------------------------------------------

looks good :)
Attachment #8817697 - Flags: review?(arai.unmht) → review+
Pushed by evilpies@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/26d101a9edac
Remove non-standard static ArrayBuffers.slice. r=arai
https://hg.mozilla.org/mozilla-central/rev/26d101a9edac
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: