https://tc39.github.io/ecma262/#sec-dataview-buffer-byteoffset-bytelength
24.2.2.1 DataView ( _buffer_ [ , _byteOffset_ [ , _byteLength_ ] ] )
https://tc39.github.io/ecma262/#sec-ecmascript-standard-built-in-objects
Unless otherwise specified, this value is equal to the largest number of
named arguments shown in the subclause headings for the function description.
Optional parameters (which are indicated with brackets: [ ]) or rest
parameters (which are shown using the form 芦...name禄) are not included in the
default argument count.
There is no explicit note for DataView constructor's length, so it should follow the above, and DataView.length should be 1.
Many implementations, however, return 3 for DataView.length.
The value is 1 in Edge 39.15014.
Unless you think it's not web compatible for those browsers to fix the length to 1, then could you file bugs on each of them to fix it?
filed for Firefox
https://bugzilla.mozilla.org/show_bug.cgi?id=1334813
If changing DataView's length from 3 to 1 is the final call for ES2017, we should also consider to change the length of the TypedArray constructors from 3 to 1, because all those constructors have the same signature: ( buffer [ , byteOffset [ , length ] ] ) (ignoring the other overloaded definitions for TypedArray constructors).
Also: test262 still expects DataView.length === 3.
Bump
@anba refers to https://github.com/tc39/test262/blob/master/test/built-ins/DataView/length.js (and others, but start there)
Closing per committee consensus to leave the length at 1.
Most helpful comment
If changing DataView's length from 3 to 1 is the final call for ES2017, we should also consider to change the length of the TypedArray constructors from 3 to 1, because all those constructors have the same signature:
( buffer [ , byteOffset [ , length ] ] )(ignoring the other overloaded definitions for TypedArray constructors).Also: test262 still expects
DataView.length === 3.