1
1
"use strict" ;
2
2
3
3
const hasBigInt64 = typeof BigUint64Array !== "undefined" ;
4
+ const thisPtr = Symbol ( ) ;
4
5
5
6
/** Gets a string from an U32 and an U16 view on a memory. */
6
7
function getStringImpl ( U32 , U16 , ptr ) {
@@ -269,7 +270,7 @@ function demangle(exports, baseModule) {
269
270
} ;
270
271
ctor . prototype = { } ;
271
272
ctor . wrap = function ( thisValue ) {
272
- return Object . create ( ctor . prototype , { "this" : { value : thisValue , writable : false } } ) ;
273
+ return Object . create ( ctor . prototype , { [ thisPtr ] : { value : thisValue , writable : false } } ) ;
273
274
} ;
274
275
if ( classElem ) Object . getOwnPropertyNames ( classElem ) . forEach ( name =>
275
276
Object . defineProperty ( ctor , name , Object . getOwnPropertyDescriptor ( classElem , name ) )
@@ -283,8 +284,8 @@ function demangle(exports, baseModule) {
283
284
let getter = exports [ internalName . replace ( "set:" , "get:" ) ] ;
284
285
let setter = exports [ internalName . replace ( "get:" , "set:" ) ] ;
285
286
Object . defineProperty ( curr , name , {
286
- get : function ( ) { return getter ( this . this ) ; } ,
287
- set : function ( value ) { setter ( this . this , value ) ; } ,
287
+ get : function ( ) { return getter ( this [ thisPtr ] ) ; } ,
288
+ set : function ( value ) { setter ( this [ thisPtr ] , value ) ; } ,
288
289
enumerable : true
289
290
} ) ;
290
291
}
@@ -295,7 +296,7 @@ function demangle(exports, baseModule) {
295
296
Object . defineProperty ( curr , name , {
296
297
value : function ( ...args ) {
297
298
setargc ( args . length ) ;
298
- return elem ( this . this , ...args ) ;
299
+ return elem ( this [ thisPtr ] , ...args ) ;
299
300
}
300
301
} ) ;
301
302
}
0 commit comments