objc-js 0.0.12 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -1
- package/binding.gyp +7 -2
- package/build/Release/nobjc_native.node +0 -0
- package/dist/index.d.ts +116 -1
- package/dist/index.js +117 -2
- package/dist/native.d.ts +2 -2
- package/dist/native.js +2 -2
- package/package.json +1 -1
- package/src/native/debug.h +19 -0
- package/src/native/ffi-utils.h +342 -0
- package/src/native/method-forwarding.h +5 -0
- package/src/native/method-forwarding.mm +110 -58
- package/src/native/nobjc.mm +3 -0
- package/src/native/protocol-impl.mm +26 -7
- package/src/native/protocol-storage.h +61 -0
- package/src/native/subclass-impl.h +20 -0
- package/src/native/subclass-impl.mm +1001 -0
- package/src/native/type-conversion.h +6 -8
|
@@ -472,21 +472,19 @@ inline void SetInvocationReturnFromJS(NSInvocation *invocation,
|
|
|
472
472
|
break;
|
|
473
473
|
}
|
|
474
474
|
case '@': {
|
|
475
|
-
// Log the result
|
|
476
|
-
NSLog(@"Result for selector %s: %s", selectorName, result.IsObject() ? "Object" : "nil");
|
|
477
|
-
|
|
478
475
|
if (result.IsObject()) {
|
|
479
476
|
Napi::Object resultObj = result.As<Napi::Object>();
|
|
480
477
|
if (resultObj.InstanceOf(ObjcObject::constructor.Value())) {
|
|
481
478
|
ObjcObject *objcObj = Napi::ObjectWrap<ObjcObject>::Unwrap(resultObj);
|
|
482
479
|
id objcValue = objcObj->objcObject;
|
|
483
|
-
NSLog(@"ObjcObject: %@", objcValue);
|
|
484
480
|
[invocation setReturnValue:&objcValue];
|
|
485
|
-
} else {
|
|
486
|
-
|
|
481
|
+
} else if (result.IsNull() || result.IsUndefined()) {
|
|
482
|
+
id nilValue = nil;
|
|
483
|
+
[invocation setReturnValue:&nilValue];
|
|
487
484
|
}
|
|
488
|
-
} else {
|
|
489
|
-
|
|
485
|
+
} else if (result.IsNull() || result.IsUndefined()) {
|
|
486
|
+
id nilValue = nil;
|
|
487
|
+
[invocation setReturnValue:&nilValue];
|
|
490
488
|
}
|
|
491
489
|
break;
|
|
492
490
|
}
|