mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-06 13:37:25 +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
@@ -581,7 +581,7 @@ void GenStruct(const Parser &parser, StructDef &struct_def, std::string *code_pt
|
||||
code += object_name + ".prototype." + MakeCamel(field.name, false);
|
||||
code += "Array = function() {\n" + offset_prefix;
|
||||
code += "new " + GenType(vectorType) + "Array(this.bb.bytes().buffer, "
|
||||
"this.bb.__vector(this.bb_pos + offset), "
|
||||
"this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), "
|
||||
"this.bb.__vector_len(this.bb_pos + offset)) : null;\n};\n\n";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user