Parcourir la source

Fix flatbuffers.js int64 (#602)

Lutz Roeder il y a 5 ans
Parent
commit
58dcd0ba3e
1 fichiers modifiés avec 5 ajouts et 0 suppressions
  1. 5 0
      source/flatbuffers.js

+ 5 - 0
source/flatbuffers.js

@@ -103,6 +103,11 @@ flatbuffers.Reader = class {
         return this._dataView.getInt64(offset, true);
     }
 
+    int64_(position, offset, defaultValue) {
+        offset = this._offset(position, offset);
+        return offset ? this.int64(position + offset) : defaultValue;
+    }
+
     uint64(offset) {
         return this._dataView.getUint64(offset, true);
     }