Skip to content
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

TypedArray implementations have a null prototype instead of the TypedArray intrinsic #1565

Open
andreabergia opened this issue Aug 14, 2024 · 2 comments
Labels
Arrays bug Issues considered a bug Ecma Incompatibility Issues about Rhino being incompatible with the EcmaScript spec

Comments

@andreabergia
Copy link
Contributor

This should return an object with all the various TypedArray methods defined on it (find, map, etc), but it returns undefined in rhino:

Object.getPrototypeOf(Int8Array).prototype

The following should also be true, but are not:

Object.getPrototypeOf(Int8Array).prototype !== undefined && 
  Object.getPrototypeOf(Int8Array).prototype == Object.getPrototypeOf(Uint8Array).prototype
Object.getPrototypeOf(Int8Array.prototype) === Object.getPrototypeOf(Uint8Array).prototype
@p-bakker p-bakker added Ecma Incompatibility Issues about Rhino being incompatible with the EcmaScript spec Arrays labels Aug 14, 2024
@p-bakker p-bakker changed the title Typed array prototype is not correct according to the spec TypedArray implementations have a null prototype instead of the TypedArray intrinsic Aug 16, 2024
@p-bakker
Copy link
Collaborator

Due to this, all TypedArray implementations are missing the static .from. and .of methods

@p-bakker
Copy link
Collaborator

Strongly consider implementing the required NativeTypedArray class using Lambdas, see #1411 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arrays bug Issues considered a bug Ecma Incompatibility Issues about Rhino being incompatible with the EcmaScript spec
Projects
None yet
Development

No branches or pull requests

2 participants