@@ -47,20 +47,20 @@ impl Js {
47
47
if self . debug {
48
48
self . expose_check_token ( ) ;
49
49
dst. push_str ( & format ! ( "
50
- constructor(public __wasmPtr : number, sym: Symbol) {{
50
+ constructor(public ptr : number, sym: Symbol) {{
51
51
_checkToken(sym);
52
52
}}
53
53
" ) ) ;
54
54
} else {
55
55
dst. push_str ( & format ! ( "
56
- constructor(public __wasmPtr : number) {{}}
56
+ constructor(public ptr : number) {{}}
57
57
" ) ) ;
58
58
}
59
59
60
60
dst. push_str ( & format ! ( "
61
61
free(): void {{
62
- const ptr = this.__wasmPtr ;
63
- this.__wasmPtr = 0;
62
+ const ptr = this.ptr ;
63
+ this.ptr = 0;
64
64
wasm_exports.{}(ptr);
65
65
}}
66
66
" , s. free_function( ) ) ) ;
@@ -111,7 +111,7 @@ impl Js {
111
111
let mut destructors = String :: new ( ) ;
112
112
113
113
if is_method {
114
- passed_args. push_str ( "this.__wasmPtr " ) ;
114
+ passed_args. push_str ( "this.ptr " ) ;
115
115
}
116
116
117
117
for ( i, arg) in arguments. iter ( ) . enumerate ( ) {
@@ -173,7 +173,7 @@ impl Js {
173
173
_assertClass({arg}, {struct_});
174
174
" , arg = name, struct_ = s) ) ;
175
175
}
176
- pass ( & format ! ( "{}.__wasmPtr " , name) ) ;
176
+ pass ( & format ! ( "{}.ptr " , name) ) ;
177
177
}
178
178
shared:: Type :: ByValue ( ref s) => {
179
179
dst. push_str ( s) ;
@@ -184,8 +184,8 @@ impl Js {
184
184
" , arg = name, struct_ = s) ) ;
185
185
}
186
186
arg_conversions. push_str ( & format ! ( "\
187
- const ptr{i} = {arg}.__wasmPtr ;
188
- {arg}.__wasmPtr = 0;
187
+ const ptr{i} = {arg}.ptr ;
188
+ {arg}.ptr = 0;
189
189
" , i = i, arg = name) ) ;
190
190
pass ( & format ! ( "ptr{}" , i) ) ;
191
191
}
@@ -951,7 +951,7 @@ impl Js {
951
951
function _assertClass(instance: any, klass: any) {
952
952
if (!(instance instanceof klass))
953
953
throw new Error(`expected instance of ${klass.name}`);
954
- return instance.__wasmPtr ;
954
+ return instance.ptr ;
955
955
}
956
956
" ) ;
957
957
}
0 commit comments