Skip to content

Commit

Permalink
fix: correctly initialize Array when values contain a single integer …
Browse files Browse the repository at this point in the history
…element (#6235)

* Correctly initialize Array when values contain a single integer element
  • Loading branch information
iamdavidmartin committed Jan 7, 2021
1 parent 8cc85d0 commit c410678
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ export class JavaArray extends Array<any> {
// splice sends a single object
values = [values];
}
super(...values);
if (values.length !== 1) {
super(...values);
} else {
super();
this.push(values[0]);
}
Object.setPrototypeOf(this, Object.create(JavaArray.prototype));
this.mapper = mapper;
}
Expand Down

0 comments on commit c410678

Please sign in to comment.