Skip to content

Commit

Permalink
work on evanw#184: instrumentation: fix problems "new" keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
stoand committed Mar 11, 2023
1 parent f862d41 commit 1889dd6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/js_printer/js_printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -1757,6 +1757,7 @@ const (
isDeleteTarget
isCallTargetOrTemplateTag
parentWasUnaryOrBinary
parentWasNew
)

var enableInst = true
Expand Down Expand Up @@ -1811,6 +1812,10 @@ func (p *printer) printExpr(expr js_ast.Expr, level js_ast.L, flags printExprFla
enableInstLocal = false
}

if flags == forbidCall {
enableInstLocal = false
}

if enableInstLocal {
p.instrumentExprStart(expr.Loc)
}
Expand Down

0 comments on commit 1889dd6

Please sign in to comment.