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.
@@ -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
- NSLog(@"Warning: result object is not an ObjcObject instance");
481
+ } else if (result.IsNull() || result.IsUndefined()) {
482
+ id nilValue = nil;
483
+ [invocation setReturnValue:&nilValue];
487
484
  }
488
- } else {
489
- NSLog(@"Warning: result is not an object (type: %d)", result.Type());
485
+ } else if (result.IsNull() || result.IsUndefined()) {
486
+ id nilValue = nil;
487
+ [invocation setReturnValue:&nilValue];
490
488
  }
491
489
  break;
492
490
  }