mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-14 05:14:28 -08:00
WIP
This commit is contained in:
@@ -13,6 +13,17 @@ const join = arr => arr.reduce(
|
||||
[],
|
||||
)
|
||||
|
||||
const is_error = n =>
|
||||
!n.ok
|
||||
||
|
||||
(
|
||||
n.value instanceof globalThis.run_window.Promise
|
||||
&&
|
||||
n.value.status != null
|
||||
&&
|
||||
!n.value.status.ok
|
||||
)
|
||||
|
||||
export class CallTree {
|
||||
constructor(ui, container) {
|
||||
this.ui = ui
|
||||
@@ -108,7 +119,7 @@ export class CallTree {
|
||||
)
|
||||
: el('span',
|
||||
'call_header '
|
||||
+ (n.ok ? '' : 'error')
|
||||
+ (is_error(n) ? 'error' : '')
|
||||
+ (n.fn.__location == null ? ' native' : '')
|
||||
,
|
||||
// TODO show `this` argument
|
||||
|
||||
@@ -42,10 +42,10 @@ export const stringify_for_header = v => {
|
||||
if(v.status == null) {
|
||||
return `Promise<pending>`
|
||||
} else {
|
||||
if(status.ok) {
|
||||
return `Promise<fulfilled: ${stringify_for_header(status.value)}>`
|
||||
if(v.status.ok) {
|
||||
return `Promise<fulfilled: ${stringify_for_header(v.status.value)}>`
|
||||
} else {
|
||||
return `Promise<fulfilled: ${stringify_for_header(status.error)}>`
|
||||
return `Promise<rejected: ${stringify_for_header(v.status.error)}>`
|
||||
}
|
||||
}
|
||||
} else if(isError(v)) {
|
||||
|
||||
Reference in New Issue
Block a user