Skip to content

Commit

Permalink
Fix integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
daxpedda committed Feb 2, 2024
1 parent 90e2e22 commit 451b480
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions crates/cli/tests/reference/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ function getStringFromWasm0(ptr, len) {
ptr = ptr >>> 0;
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
}

const ClassBuilderFinalization = new FinalizationRegistry(ptr => wasm.__wbg_classbuilder_free(ptr >>> 0));
/**
*/
export class ClassBuilder {
Expand All @@ -31,14 +33,14 @@ export class ClassBuilder {
ptr = ptr >>> 0;
const obj = Object.create(ClassBuilder.prototype);
obj.__wbg_ptr = ptr;

ClassBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
return obj;
}

__destroy_into_raw() {
const ptr = this.__wbg_ptr;
this.__wbg_ptr = 0;

ClassBuilderFinalization.unregister(this);
return ptr;
}

Expand Down
4 changes: 3 additions & 1 deletion crates/cli/tests/reference/constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@ function getStringFromWasm0(ptr, len) {
ptr = ptr >>> 0;
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
}

const ClassConstructorFinalization = new FinalizationRegistry(ptr => wasm.__wbg_classconstructor_free(ptr >>> 0));
/**
*/
export class ClassConstructor {

__destroy_into_raw() {
const ptr = this.__wbg_ptr;
this.__wbg_ptr = 0;

ClassConstructorFinalization.unregister(this);
return ptr;
}

Expand Down

0 comments on commit 451b480

Please sign in to comment.