mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-11 07:27:27 +00:00
Fixed javascript helper for typed arrays of scalars not taking into (#4068)
account underlying buffer's byte offset.
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
af21b9064d
commit
cf0d7829a6
Binary file not shown.
@@ -693,7 +693,7 @@ MyGame.Example.Monster.prototype.inventoryLength = function() {
|
||||
*/
|
||||
MyGame.Example.Monster.prototype.inventoryArray = function() {
|
||||
var offset = this.bb.__offset(this.bb_pos, 14);
|
||||
return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
|
||||
return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -839,7 +839,7 @@ MyGame.Example.Monster.prototype.testnestedflatbufferLength = function() {
|
||||
*/
|
||||
MyGame.Example.Monster.prototype.testnestedflatbufferArray = function() {
|
||||
var offset = this.bb.__offset(this.bb_pos, 30);
|
||||
return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
|
||||
return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1080,7 +1080,7 @@ MyGame.Example.Monster.prototype.testarrayofboolsLength = function() {
|
||||
*/
|
||||
MyGame.Example.Monster.prototype.testarrayofboolsArray = function() {
|
||||
var offset = this.bb.__offset(this.bb_pos, 52);
|
||||
return offset ? new Int8Array(this.bb.bytes().buffer, this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
|
||||
return offset ? new Int8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user