Skip to content

Commit 15a5903

Browse files
committed
work
1 parent 0ee788a commit 15a5903

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

‎examples/foundation.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ console.log(queue);
1111
const ref = new ObjectRef();
1212
ref.value = device;
1313
console.log(ref);
14+
15+
const struct = new CGPoint({ x: 1, y: 2 });
16+
console.log(struct);

‎src/type_conv.mm‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -653,14 +653,12 @@ void toNative(napi_env env, napi_value value, void *result, bool *shouldFree,
653653

654654
return;
655655
} else {
656-
napi_value global, jsObject, jsObjectPrototype, valuePrototype;
656+
napi_value global, jsObject, valueConstructor;
657657
napi_get_global(env, &global);
658658
napi_get_named_property(env, global, "Object", &jsObject);
659-
napi_get_named_property(env, jsObject, "prototype",
660-
&jsObjectPrototype);
661-
napi_get_named_property(env, value, "prototype", &valuePrototype);
659+
napi_get_named_property(env, value, "constructor", &valueConstructor);
662660
bool isEqual;
663-
napi_strict_equals(env, jsObjectPrototype, valuePrototype, &isEqual);
661+
napi_strict_equals(env, jsObject, valueConstructor, &isEqual);
664662

665663
if (!isEqual) {
666664
auto bridgeData = ObjCBridgeData::InstanceData(env);

0 commit comments

Comments
 (0)