Skip to content

Commit

Permalink
fix: Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
xxuejie committed Dec 23, 2020
1 parent 0ec8295 commit b434692
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/generator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ function serializeTable(buffers) {
fmt.Fprintln(writer, " }")
fmt.Fprintln(writer)
fmt.Fprintln(writer, " toLittleEndianBigUint64() {")
fmt.Fprintln(writer, " return this.view.getUint64(0, true);")
fmt.Fprintln(writer, " return this.view.getBigUint64(0, true);")
fmt.Fprintln(writer, " }")
fmt.Fprintln(writer)
}
Expand Down Expand Up @@ -281,7 +281,7 @@ function serializeTable(buffers) {
case "dynvec":
fmt.Fprintf(writer, ` validate(compatible = false) {
const offsets = verifyAndExtractOffsets(this.view, 0, true);
for (let i = 0; i < len(offsets) - 1; i++) {
for (let i = 0; i < offsets.length - 1; i++) {
new %s(this.view.buffer.slice(offsets[i], offsets[i + 1]), { validate: false }).validate();
}
}
Expand Down Expand Up @@ -579,8 +579,8 @@ export interface UnionType {
fmt.Fprintln(writer, " toLittleEndianUint32(): number;")
case 8:
if options.HasBigInt {
fmt.Fprintln(writer, " toBigEndianUint64(): BigInt;")
fmt.Fprintln(writer, " toLittleEndianUint64(): BigInt;")
fmt.Fprintln(writer, " toBigEndianBigUint64(): bigint;")
fmt.Fprintln(writer, " toLittleEndianBigUint64(): bigint;")
}
}
fmt.Fprintln(writer, " static size(): Number;")
Expand Down

0 comments on commit b434692

Please sign in to comment.