mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-30 12:10:01 +00:00
Fixed JS outputting helper for Int64Array.
Change-Id: I7d23fa3416feb78ea18d2c451e7b4e1d9be11bfc
This commit is contained in:
@@ -102,6 +102,8 @@ inline bool IsInteger(BaseType t) { return t >= BASE_TYPE_UTYPE &&
|
|||||||
t <= BASE_TYPE_ULONG; }
|
t <= BASE_TYPE_ULONG; }
|
||||||
inline bool IsFloat (BaseType t) { return t == BASE_TYPE_FLOAT ||
|
inline bool IsFloat (BaseType t) { return t == BASE_TYPE_FLOAT ||
|
||||||
t == BASE_TYPE_DOUBLE; }
|
t == BASE_TYPE_DOUBLE; }
|
||||||
|
inline bool IsLong (BaseType t) { return t == BASE_TYPE_LONG ||
|
||||||
|
t == BASE_TYPE_ULONG; }
|
||||||
|
|
||||||
extern const char *const kTypeNames[];
|
extern const char *const kTypeNames[];
|
||||||
extern const char kTypeSizes[];
|
extern const char kTypeSizes[];
|
||||||
|
|||||||
@@ -576,7 +576,7 @@ void GenStruct(const Parser &parser, StructDef &struct_def, std::string *code_pt
|
|||||||
|
|
||||||
// For scalar types, emit a typed array helper
|
// For scalar types, emit a typed array helper
|
||||||
auto vectorType = field.value.type.VectorType();
|
auto vectorType = field.value.type.VectorType();
|
||||||
if (IsScalar(vectorType.base_type)) {
|
if (IsScalar(vectorType.base_type) && !IsLong(vectorType.base_type)) {
|
||||||
GenDocComment(code_ptr, "@returns {" + GenType(vectorType) + "Array}");
|
GenDocComment(code_ptr, "@returns {" + GenType(vectorType) + "Array}");
|
||||||
code += object_name + ".prototype." + MakeCamel(field.name, false);
|
code += object_name + ".prototype." + MakeCamel(field.name, false);
|
||||||
code += "Array = function() {\n" + offset_prefix;
|
code += "Array = function() {\n" + offset_prefix;
|
||||||
|
|||||||
Reference in New Issue
Block a user