Skip to content

Commit e9ad07b

Browse files
authored
[test] Add assertion that constructor is a wrapper (#90)
Wasm functions configured as constructors by configureAll are wrapped (as opposed to mutated in-place) to allow them to be called with `new`. Add an assertion that the constructor that appears on the JS side is not pointer-identical with the unwrapped Wasm function.
1 parent 97b27bd commit e9ad07b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

test/js-api/custom-descriptors/configure-all.any.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,7 @@ test(() => {
438438

439439
const MyStruct = constructors.MyStruct;
440440
assert_equals(proto.constructor, MyStruct);
441+
assert_not_equals(MyStruct, makeStructWithProto);
441442

442443
assert_true(Object.hasOwn(MyStruct, "prototype"));
443444
assert_true(Object.hasOwn(MyStruct, "method"));

0 commit comments

Comments
 (0)