Skip to content

Commit

Permalink
[js] initially grow BytesBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
Simn committed Sep 6, 2017
1 parent 826083e commit ab34ef9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions std/js/_std/haxe/io/BytesBuffer.hx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class BytesBuffer {
public function new() {
pos = 0;
size = 0;
grow(0);
}

inline function get_length() : Int {
Expand Down

3 comments on commit ab34ef9

@Simn
Copy link
Member Author

@Simn Simn commented on ab34ef9 Sep 6, 2017

Choose a reason for hiding this comment

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

@ncannasse: Please check if this is alright or if you want to fix this differently. Your BytesBuffer JS implementation clearly assumes that grow has been called at some point, otherwise there are null-values for both the buffer and u8 fields.

@ncannasse
Copy link
Member

Choose a reason for hiding this comment

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

@Simn since we check for pos/size before writing this should not be needed, unless I forgot one?

@Simn
Copy link
Member Author

@Simn Simn commented on ab34ef9 Sep 6, 2017

Choose a reason for hiding this comment

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

Please sign in to comment.