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

[[ViewedArrayBuffer]] cannot be undefined during usage #604

Merged
merged 1 commit into from
Jan 9, 2019

Conversation

annevk
Copy link
Member

@annevk annevk commented Jan 9, 2019

As far as I can tell there's no way for a %TypedArray%'s [[ViewedArrayBuffer]] internal slot to be undefined. I'm pretty sure this has to be the case as implementations assume this algorithm to never throw (the detached issue is tracked separately by #151).


Preview | Diff

As far as I can tell there's no way for a %TypedArray%'s [[ViewedArrayBuffer]] internal slot to be undefined. I'm pretty sure this has to be the case as implementations assume this algorithm to never throw (the detached issue is tracked separately by #151).
@annevk
Copy link
Member Author

annevk commented Jan 9, 2019

(The only place where I've found ECMAScript says it's undefined is during allocation, when view is created, but the buffer isn't, but at that point no JavaScript can run and do something with the object, afaik.)

@bmeck
Copy link

bmeck commented Jan 9, 2019

Per the usage of the assert in IsDetachedBuffer and lack of checks prior to usage in various locations such as in ValidateTypedArray it would be a bug if it ever could be undefined. This PR looks fine to me.

@annevk annevk merged commit 2084c30 into master Jan 9, 2019
@annevk annevk deleted the annevk/a-view-has-a-buffer branch January 9, 2019 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants