mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 15:02:52 -05:00
Merge pull request #765 from mzgoddard/execute-is-promise-deopt
Write src/engine/execute so it can be optimized
This commit is contained in:
commit
b07bbd4745
1 changed files with 5 additions and 1 deletions
|
@ -15,7 +15,11 @@ const blockUtility = new BlockUtility();
|
||||||
* @return {boolean} True if the value appears to be a Promise.
|
* @return {boolean} True if the value appears to be a Promise.
|
||||||
*/
|
*/
|
||||||
const isPromise = function (value) {
|
const isPromise = function (value) {
|
||||||
return value && value.then && typeof value.then === 'function';
|
return (
|
||||||
|
value !== null &&
|
||||||
|
typeof value === 'object' &&
|
||||||
|
typeof value.then === 'function'
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue