New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The length of DataView constructor doesn't match between the spec and implementations #787

Closed
arai-a opened this Issue Jan 28, 2017 · 7 comments

Comments

Projects
None yet
6 participants
@arai-a

arai-a commented Jan 28, 2017

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.

  • Firefox Nightly 54.0a1 (2017-01-27) (64-bit)
  • Google Chrome Canary 58.0.2995.0 (Official Build) canary (64 bit)
  • WebKit 10.0.2 (12602.3.12.0.1, r211319)
    (haven't checked on Edge since I don't have environment to test trunk)
@targos

This comment has been minimized.

Show comment
Hide comment
@targos

targos Jan 28, 2017

The value is 1 in Edge 39.15014.

targos commented Jan 28, 2017

The value is 1 in Edge 39.15014.

@ljharb

This comment has been minimized.

Show comment
Hide comment
@ljharb

ljharb Jan 28, 2017

Member

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?

Member

ljharb commented Jan 28, 2017

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?

@arai-a

This comment has been minimized.

Show comment
Hide comment

arai-a commented Jan 28, 2017

@anba

This comment has been minimized.

Show comment
Hide comment
@anba

anba Feb 6, 2017

Contributor

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.

Contributor

anba commented Feb 6, 2017

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.

@evilpie

This comment has been minimized.

Show comment
Hide comment
@evilpie

evilpie Apr 18, 2017

Contributor

Bump

Contributor

evilpie commented Apr 18, 2017

Bump

@rwaldron

This comment has been minimized.

Show comment
Hide comment
@rwaldron
Contributor

rwaldron commented Apr 19, 2017

anba added a commit to anba/ecma262 that referenced this issue Mar 6, 2018

anba added a commit to anba/ecma262 that referenced this issue Mar 6, 2018

anba added a commit to anba/ecma262 that referenced this issue Mar 6, 2018

@ljharb

This comment has been minimized.

Show comment
Hide comment
@ljharb

ljharb Apr 4, 2018

Member

Closing per committee consensus to leave the length at 1.

Member

ljharb commented Apr 4, 2018

Closing per committee consensus to leave the length at 1.

@ljharb ljharb closed this Apr 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment