stash changed

This commit is contained in:
pengfei.zhou
2019-07-19 09:52:43 +08:00
parent d8cf7bee4d
commit 6bcc9ffe49
9 changed files with 173 additions and 5 deletions

View File

@@ -29,7 +29,7 @@ import { loge } from "../util/log";
declare function nativeRequire(moduleName: string): boolean
declare function nativeBridge(contextId: string, namespace: string, method: string, args?: any, callbackId?: string): boolean
declare function nativeBridge(contextId: string, namespace: string, method: string, callbackId?: string, args?: any): boolean
export function jsCallResolve(contextId: string, callbackId: string, args?: any) {
const context = gContexts.get(contextId)
@@ -77,7 +77,7 @@ export class Context {
callNative(namespace: string, method: string, args?: any): Promise<any> {
const callbackId = uniqueId('callback')
nativeBridge(this.id, namespace, method, args, callbackId)
nativeBridge(this.id, namespace, method, callbackId, args)
return new Promise((resolve, reject) => {
this.callbacks.set(callbackId, {
resolve,