This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 28102 - Use sequence<T> for arguments instead of T[]
Summary: Use sequence<T> for arguments instead of T[]
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: All All
: P2 minor
Target Milestone: Unsorted
Assignee: Domenic Denicola
QA Contact: contributor
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-25 23:17 UTC by Joshua Bell
Modified: 2015-08-28 04:16 UTC (History)
3 users (show)

See Also:


Attachments

Description Joshua Bell 2015-02-25 23:17:52 UTC
There are a couple of places where T[] ("pass by reference") is used for constructor arguments:

On interface Path2D:
 Constructor(Path2D[] paths, optional CanvasFillRule fillRule = "nonzero")

On interface WebSocket:
 Constructor(DOMString url, optional (DOMString or DOMString[]) protocols)

In both of these cases, sequence<T> ("pass by value") seems to make more sense, since in neither case does the platform object modify the array.

Is this usage intentional?
Comment 1 Ian 'Hixie' Hickson 2015-03-04 21:23:45 UTC
This stuff keeps changing and I haven't kept up with what the right answer is. So my plan for the last year or so has been to let WebIDL settle so I can see what comes out on top, then I'll go through and update the spec.