mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
feat(napi/transform): display semantic error (#6160)
This commit is contained in:
parent
f27d59f748
commit
15552ac499
1 changed files with 6 additions and 4 deletions
|
|
@ -97,12 +97,14 @@ pub fn transform(
|
||||||
}
|
}
|
||||||
|
|
||||||
fn transpile(ctx: &TransformContext<'_>) -> CodegenReturn {
|
fn transpile(ctx: &TransformContext<'_>) -> CodegenReturn {
|
||||||
let (symbols, scopes) = SemanticBuilder::new(ctx.source_text())
|
let semantic_ret = SemanticBuilder::new(ctx.source_text())
|
||||||
// Estimate transformer will triple scopes, symbols, references
|
// Estimate transformer will triple scopes, symbols, references
|
||||||
.with_excess_capacity(2.0)
|
.with_excess_capacity(2.0)
|
||||||
.build(&ctx.program())
|
.with_check_syntax_error(true)
|
||||||
.semantic
|
.build(&ctx.program());
|
||||||
.into_symbol_table_and_scope_tree();
|
ctx.add_diagnostics(semantic_ret.errors);
|
||||||
|
|
||||||
|
let (symbols, scopes) = semantic_ret.semantic.into_symbol_table_and_scope_tree();
|
||||||
let ret = Transformer::new(
|
let ret = Transformer::new(
|
||||||
ctx.allocator,
|
ctx.allocator,
|
||||||
ctx.file_path(),
|
ctx.file_path(),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue