mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-27 09:02:17 +00:00
[typescript] Size-prefixed root accessors not taking into account size prefix (#5717)
* [typescript/javascript] Size-prefixed root accessor needs to account for the size prefix. * [typescript] Add parentheses after "new" expression. * Update generated test files
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
6da1cf79d9
commit
9cadf05d89
@@ -59,6 +59,7 @@ NamespaceA.TableInFirstNS.getRootAsTableInFirstNS = function(bb, obj) {
|
||||
* @returns {NamespaceA.TableInFirstNS}
|
||||
*/
|
||||
NamespaceA.TableInFirstNS.getSizePrefixedRootAsTableInFirstNS = function(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new NamespaceA.TableInFirstNS).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
@@ -199,6 +200,7 @@ NamespaceC.TableInC.getRootAsTableInC = function(bb, obj) {
|
||||
* @returns {NamespaceC.TableInC}
|
||||
*/
|
||||
NamespaceC.TableInC.getSizePrefixedRootAsTableInC = function(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new NamespaceC.TableInC).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
@@ -306,6 +308,7 @@ NamespaceA.SecondTableInA.getRootAsSecondTableInA = function(bb, obj) {
|
||||
* @returns {NamespaceA.SecondTableInA}
|
||||
*/
|
||||
NamespaceA.SecondTableInA.getSizePrefixedRootAsSecondTableInA = function(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new NamespaceA.SecondTableInA).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user