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

fix(uint32ArrayFrom): increment index & polyfill for Uint32Array #270

Merged
merged 3 commits into from
Dec 1, 2021

Conversation

texastony
Copy link
Contributor

@texastony texastony commented Nov 29, 2021

Issue #, if available: #269

Description of changes:

  1. Increment index in Uint32Array, which was not happening in the while loop.
  2. Detect if UInt32Array.From is missing, as compared to the generic Array.From

PR is not yet tested on IE 11

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

scottarc
scottarc previously approved these changes Nov 29, 2021
@@ -3,11 +3,12 @@

// IE 11 does not support Array.from, so we do it manually
export function uint32ArrayFrom(a_lookUpTable: Array<number>): Uint32Array {
if (!Array.from) {
if (!Uint32Array.from) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will we need this for other types (Uint8Array.from) in the future?

const return_array = new Uint32Array(a_lookUpTable.length)
let a_index = 0
while (a_index < a_lookUpTable.length) {
return_array[a_index] = a_lookUpTable[a_index]
a_index += 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 this looks like the correct fix

@texastony texastony marked this pull request as draft November 29, 2021 19:27
@texastony texastony marked this pull request as ready for review November 30, 2021 18:23
Copy link
Contributor

@seebees seebees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Tested in IE11

@seebees seebees merged commit a70d603 into aws:master Dec 1, 2021
@texastony texastony deleted the fix_IE11_polyfill branch February 27, 2024 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants