mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-13 21:14:28 -08:00
WIP
This commit is contained in:
@@ -13,11 +13,23 @@ export const patch_promise = window => {
|
||||
(resolve, reject) => {
|
||||
fn(
|
||||
(value) => {
|
||||
status = {ok: true, value}
|
||||
if(is_constructor_finished) {
|
||||
this.status = status
|
||||
if(value instanceof window.Promise.Original) {
|
||||
value
|
||||
.then(v => {
|
||||
this.status = {ok: true, value: v}
|
||||
resolve(v)
|
||||
})
|
||||
.catch(e => {
|
||||
this.status = {ok: false, error: e}
|
||||
reject(e)
|
||||
})
|
||||
} else {
|
||||
status = {ok: true, value}
|
||||
if(is_constructor_finished) {
|
||||
this.status = status
|
||||
}
|
||||
resolve(value)
|
||||
}
|
||||
resolve(value)
|
||||
},
|
||||
(error) => {
|
||||
status = {ok: false, error}
|
||||
|
||||
Reference in New Issue
Block a user