mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-18 11:04:26 +00:00
fixed mutating inline values (#5942)
Co-authored-by: Kamil Rojewski <kamil.rojewski@gmail.com>
This commit is contained in:
@@ -171,13 +171,7 @@ NamespaceA.NamespaceB.StructInNestedNS.prototype.a = function() {
|
||||
* @returns {boolean}
|
||||
*/
|
||||
NamespaceA.NamespaceB.StructInNestedNS.prototype.mutate_a = function(value) {
|
||||
var offset = this.bb.__offset(this.bb_pos, 0);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.bb.writeInt32(this.bb_pos + offset, value);
|
||||
this.bb.writeInt32(this.bb_pos + 0, value);
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -193,13 +187,7 @@ NamespaceA.NamespaceB.StructInNestedNS.prototype.b = function() {
|
||||
* @returns {boolean}
|
||||
*/
|
||||
NamespaceA.NamespaceB.StructInNestedNS.prototype.mutate_b = function(value) {
|
||||
var offset = this.bb.__offset(this.bb_pos, 4);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.bb.writeInt32(this.bb_pos + offset, value);
|
||||
this.bb.writeInt32(this.bb_pos + 4, value);
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -170,13 +170,7 @@ a():number {
|
||||
* @returns boolean
|
||||
*/
|
||||
mutate_a(value:number):boolean {
|
||||
var offset = this.bb!.__offset(this.bb_pos, 0);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.bb!.writeInt32(this.bb_pos + offset, value);
|
||||
this.bb!.writeInt32(this.bb_pos + 0, value);
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -192,13 +186,7 @@ b():number {
|
||||
* @returns boolean
|
||||
*/
|
||||
mutate_b(value:number):boolean {
|
||||
var offset = this.bb!.__offset(this.bb_pos, 4);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.bb!.writeInt32(this.bb_pos + offset, value);
|
||||
this.bb!.writeInt32(this.bb_pos + 4, value);
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user