fixed mutating inline values (#5942)

Co-authored-by: Kamil Rojewski <kamil.rojewski@gmail.com>
This commit is contained in:
Kamil Rojewski
2020-06-04 18:08:41 +02:00
committed by GitHub
parent d026e6f071
commit 38ed69eb3d
8 changed files with 45 additions and 194 deletions

View File

@@ -167,13 +167,7 @@ Rapunzel.prototype.hairLength = function() {
* @returns {boolean}
*/
Rapunzel.prototype.mutate_hair_length = 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;
};
@@ -226,13 +220,7 @@ BookReader.prototype.booksRead = function() {
* @returns {boolean}
*/
BookReader.prototype.mutate_books_read = 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;
};