Skip to content

Commit 0702441

Browse files
Remove constructor result type check
1 parent 5f9f56c commit 0702441

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

Runtime/src/index.ts

-8
Original file line numberDiff line numberDiff line change
@@ -473,10 +473,6 @@ export class SwiftRuntime {
473473
let result: any;
474474
try {
475475
result = Reflect.construct(obj, decodeValues(argv, argc));
476-
if (typeof result != "object")
477-
throw Error(
478-
`Invalid result type of object constructor of "${obj}": "${result}"`
479-
);
480476
} catch (error) {
481477
writeValue(
482478
error,
@@ -497,10 +493,6 @@ export class SwiftRuntime {
497493
) => {
498494
const obj = this.heap.referenceHeap(ref);
499495
const result = Reflect.construct(obj, decodeValues(argv, argc));
500-
if (typeof result != "object")
501-
throw Error(
502-
`Invalid result type of object constructor of "${obj}": "${result}"`
503-
);
504496
writeUint32(result_obj, this.heap.retain(result));
505497
},
506498
swjs_instanceof: (obj_ref: ref, constructor_ref: ref) => {

0 commit comments

Comments
 (0)