mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-20 15:15:06 +00:00
[JS/TS] Size prefix support (#5326)
* WIP size prefix support * Consider size prefix in overloaded variant * Work on code gen * Disabled helper functions in code gen * Enabled helper functions in code gen * Fix size prefixed test * Fix bad function call * Add SIZE_PREFIX_LENGTH * Fix review comments
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
b56d60f058
commit
0bb3ce6935
@@ -53,6 +53,15 @@ NamespaceA.TableInFirstNS.getRootAsTableInFirstNS = function(bb, obj) {
|
||||
return (obj || new NamespaceA.TableInFirstNS).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.ByteBuffer} bb
|
||||
* @param {NamespaceA.TableInFirstNS=} obj
|
||||
* @returns {NamespaceA.TableInFirstNS}
|
||||
*/
|
||||
NamespaceA.TableInFirstNS.getSizePrefixedRootAsTableInFirstNS = function(bb, obj) {
|
||||
return (obj || new NamespaceA.TableInFirstNS).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {NamespaceA.NamespaceB.TableInNestedNS=} obj
|
||||
* @returns {NamespaceA.NamespaceB.TableInNestedNS|null}
|
||||
@@ -184,6 +193,15 @@ NamespaceC.TableInC.getRootAsTableInC = function(bb, obj) {
|
||||
return (obj || new NamespaceC.TableInC).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.ByteBuffer} bb
|
||||
* @param {NamespaceC.TableInC=} obj
|
||||
* @returns {NamespaceC.TableInC}
|
||||
*/
|
||||
NamespaceC.TableInC.getSizePrefixedRootAsTableInC = function(bb, obj) {
|
||||
return (obj || new NamespaceC.TableInC).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {NamespaceA.TableInFirstNS=} obj
|
||||
* @returns {NamespaceA.TableInFirstNS|null}
|
||||
@@ -282,6 +300,15 @@ NamespaceA.SecondTableInA.getRootAsSecondTableInA = function(bb, obj) {
|
||||
return (obj || new NamespaceA.SecondTableInA).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.ByteBuffer} bb
|
||||
* @param {NamespaceA.SecondTableInA=} obj
|
||||
* @returns {NamespaceA.SecondTableInA}
|
||||
*/
|
||||
NamespaceA.SecondTableInA.getSizePrefixedRootAsSecondTableInA = function(bb, obj) {
|
||||
return (obj || new NamespaceA.SecondTableInA).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {NamespaceC.TableInC=} obj
|
||||
* @returns {NamespaceC.TableInC|null}
|
||||
|
||||
Reference in New Issue
Block a user