Skip to content

Commit

Permalink
fix(ios): convert KrollPromise to JSValueRef for return types of old …
Browse files Browse the repository at this point in the history
…proxies
  • Loading branch information
sgtcoolguy committed Jan 26, 2021
1 parent 33508b6 commit 62ee5c5
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2018 by Appcelerator, Inc. All Rights Reserved.
* Copyright (c) 2009-2021 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/
Expand All @@ -10,6 +10,7 @@
#import "KrollContext.h"
#import "KrollMethod.h"
#import "KrollObject.h"
#import "KrollPromise.h"
#import <objc/runtime.h>

/*
Expand Down Expand Up @@ -362,5 +363,8 @@ JSValueRef TiBindingTiValueFromNSObject(JSContextRef jsContext, NSObject *obj)
JSValue *jsValue = (JSValue *)obj;
return jsValue.JSValueRef;
}
if ([obj isKindOfClass:[KrollPromise class]]) {
return ((KrollPromise *)obj).JSValue.JSValueRef;
}
return TiBindingTiValueFromProxy(jsContext, (TiProxy *)obj);
}

0 comments on commit 62ee5c5

Please sign in to comment.