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

Integer-Indexed exotic object vs TypedArray object #1617

Open
jmdyck opened this issue Jul 9, 2019 · 2 comments
Open

Integer-Indexed exotic object vs TypedArray object #1617

jmdyck opened this issue Jul 9, 2019 · 2 comments
Labels

Comments

@jmdyck
Copy link
Collaborator

jmdyck commented Jul 9, 2019

22.2.7 Properties of TypedArray Instances tells us that "TypedArray instances are Integer-Indexed exotic objects."

An Integer-Indexed exotic object (IIEO) is an object that behaves as if it had internal methods as specified in 9.4.5 Integer-Indexed Exotic Objects.

A TypedArray instance aka TypedArray object (TAO) is presumably an object that was created via one of the TypedArray constructors. And every TypedArray constructor creates the resulting TAO via a call to AllocateTypedArray(), which calls IntegerIndexedObjectCreate(), which underlines that every TAO is an IIEO.

Is the converse true? Is every IIEO a TAO, or are there non-TAO IIEOs? The spec doesn't define any (the spec's only call to IntegerIndexedObjectCreate is in AllocateTypedArray), but presumably an implementation could define such a thing. However, I'm having trouble imagining it, given that every IIEO must have a [[TypedArrayName]] internal slot, whose value must be a constructor name in Table 60 (see 9.4.5.8 IntegerIndexedElementGet). That is, it seems like a non-TAO IIEO would look a lot like a TAO IIEO.

For some perspective, consider an analogous situation for arrays. Conceivably, the spec could have one term for any object whose internal methods conform to 9.4.2 Array Exotic Objects, and a distinct term for any object created by 22.1.1 The Array constructor, leaving room for an implementation to define a 9.4.2-array that isn't a 22.1.1-array. But it doesn't make that distinction. So why does it make the analogous distinction for IIEO/TAO?

@jmdyck jmdyck added the question label Jul 9, 2019
@jmdyck
Copy link
Collaborator Author

jmdyck commented Aug 20, 2020

If there's no rationale for the distinction, I think we could just replace occurrences of "Integer-Indexed exotic object" with "TypedArray exotic object" (and similarly in the 3 IntegerIndexed operation names).

@syg
Copy link
Contributor

syg commented Aug 11, 2021

Agree, I might take the time to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants