Skip to content

Commit 28ceb35

Browse files
authored
Merge pull request #110 from Karang/master
Fix undefined varint for SizeOf and Write
2 parents 4a82135 + 9451d0c commit 28ceb35

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/compiler.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,9 @@ class Compiler {
220220
if (!functions[type]) {
221221
if (this.types[type] !== 'native') {
222222
functions[type] = this.compileType(this.types[type])
223-
if (functions[type].startsWith('ctx')) { functions[type] = this.wrapCode('return ' + this.callType(functions[type].split('.')[1])) }
223+
if (functions[type].startsWith('ctx')) {
224+
functions[type] = 'function () { return ' + functions[type] + '(...arguments) }'
225+
}
224226
if (!isNaN(functions[type])) { functions[type] = this.wrapCode(' return ' + functions[type]) }
225227
} else {
226228
functions[type] = `native.${type}`

0 commit comments

Comments
 (0)