Ver código fonte

Fix flatbuffers.js int64 (#602)

Lutz Roeder 5 anos atrás
pai
commit
58dcd0ba3e
1 arquivos alterados com 5 adições e 0 exclusões
  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);
     }