Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 1 addition & 21 deletions src/components/output/EsTreePanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,7 @@
const value = computed(() => {
const comments = oxc.value.getComments()
const errors = oxc.value.getDiagnostics()
// TODO: move wrapper to oxc
// const program = oxc.value.ast
const program = JSON.parse(oxc.value.astJson, function (key, value) {
if (
value === null &&
key === 'value' &&
Object.hasOwn(this, 'type') &&
this.type === 'Literal'
) {
if (Object.hasOwn(this, 'bigint')) {
return BigInt(this.bigint)
}
if (Object.hasOwn(this, 'regex')) {
const { regex } = this
try {
return new RegExp(regex.pattern, regex.flags)
} catch {}
}
}
return value
})
const program = oxc.value.ast

Check failure on line 14 in src/components/output/EsTreePanel.vue

View workflow job for this annotation

GitHub Actions / Build Playground

Property 'ast' does not exist on type 'Oxc'.
return { program, comments, errors }
})

Expand Down
Loading