Skip to content

Commit

Permalink
fix(core): fix jscore promise & execute queue
Browse files Browse the repository at this point in the history
  • Loading branch information
zoomchan-cxj committed Jul 8, 2021
1 parent b49cf4b commit 65fabb1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion core/js/global/ios/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ __GLOBAL__.enqueueNativeCall = (moduleID, methodID, params, onFail, onSucc) => {
__GLOBAL__._queue[2].push(params);

if (typeof nativeFlushQueueImmediate !== 'undefined') {
nativeFlushQueueImmediate(__GLOBAL__._queue);
const originalQueue = [...__GLOBAL__._queue];
__GLOBAL__._queue = [[], [], [], __GLOBAL__._callID];
nativeFlushQueueImmediate(originalQueue);
}
};

Expand Down
2 changes: 1 addition & 1 deletion core/js/global/ios/promise.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,6 @@ Promise.prototype['catch'] = function (onRejected) {
return this.then(null, onRejected);
};

global.Promise = global.Promise || Promise;
global.Promise = Promise;

/* eslint-disable */
6 changes: 3 additions & 3 deletions core/src/napi/jsc/native_source_code_ios.cc

Large diffs are not rendered by default.

0 comments on commit 65fabb1

Please sign in to comment.