-
Notifications
You must be signed in to change notification settings - Fork 192
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(sdk-rtl/src/delimArray): Fixed issue with single element number array #927
Conversation
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.
looks good to me, nice catch!
@drstrangelooker I think we're hitting the issue where the It would be really nice if GitHub offered the option for a maintainer to "run Actions with secrets" for a PR - or maybe the UI at the top of this article can be limited to certain trusted forks? I think maybe there needs to be an intermediate step of a forked PR is created against a non- I'm gonna let DevRel drive that.
|
also, another side effect of running a PR from a fork is that the
|
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.
Good find, good fix
Based on the all the info added here and offline discussion with @joeldodge79, the failing jobs aren't related to the changes in this PR. Go going ahead with the merge. Thanks @joeldodge79 @jkaster for the review. |
Issue
DelimArray internally extends Array provided by javascript.
The issue of initialising an array via Array constructor with single number argument is that the newly created array will be of length specified as the argument, with actual value as undefined unlike when we pass array with more than one values (MDN reference).
Since DelimArray internally initialises array via Array constructor, we get unexpected output with array of single number.
Fix
Instead of creating an array with the values during the initialisation step, we can use
Array.prototype.push
method to populate the aforementioned array object with the values passed to the DelimArray in the initialisation step.Developer Checklist ℹ️
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #<issue_number_goes_here> 🦕