-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Cleanup makeGetSlabs in src/parseTools.js. NFC. #13290
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
Conversation
sbc100
commented
Jan 20, 2021
- Make fall throughs more obvious.
- Remove break after return.
- Remove unused final return (it was unreachable).
src/parseTools.js
Outdated
} | ||
return []; | ||
throw 'what, exactly, can we do for unknown types in TA2?! ' + [new Error().stack, ptr, type, allowMultiple, unsigned]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably fix this error message too. I think TA2 refers to USE_TYPED_ARRAYS which was removed in 2015.
Do you know why this function used to return more than one thing? Were there multiple memory views that we used to try to keep in sync somehow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, as you said, this is super-old...
I believe we used to not have a single linear memory, but separate ones per type. This was one of the approaches experimented with in the very early days.
Today I think this can return a single item, and the error here can just be "internal error".
146d248
to
e9fa04e
Compare
src/parseTools.js
Outdated
} | ||
return []; | ||
throw 'what, exactly, can we do for unknown types in TA2?! ' + [new Error().stack, ptr, type, allowMultiple, unsigned]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, as you said, this is super-old...
I believe we used to not have a single linear memory, but separate ones per type. This was one of the approaches experimented with in the very early days.
Today I think this can return a single item, and the error here can just be "internal error".
- Make fall throughs more obvious. - Remove break after return. - Remove unused final return (it was unreachable).
e9fa04e
to
9ae6e46
Compare
Followup on #13290. We only deal with a single heap these days so we can remove some of the complexity here.
Followup on #13290. We only deal with a single heap these days so we can remove some of the complexity here.
Followup on #13290. We only deal with a single heap these days so we can remove some of the complexity here.