Skip to content

Commit

Permalink
fix #3845: some incorrect error message locations
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Jul 25, 2024
1 parent 892d2a7 commit 78f89e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@

Previously esbuild's CLI could crash if it was invoked with flags that aren't valid for a "build" API call and the `--analyze` flag is present. This was caused by esbuild's internals attempting to add a Go plugin (which is how `--analyze` is implemented) to a null build object. The panic has been fixed in this release.
* Fix incorrect location of certain error messages ([#3845](https://github.com/evanw/esbuild/issues/3845))
This release fixes a regression that caused certain errors relating to variable declarations to be reported at an incorrect location. The regression was introduced in version 0.18.7 of esbuild.
## 0.23.0
**_This release deliberately contains backwards-incompatible changes._** To avoid automatically picking up releases like this, you should either be pinning the exact version of `esbuild` in your `package.json` file (recommended) or be using a version range syntax that only accepts patch upgrades such as `^0.22.0` or `~0.22.0`. See npm's documentation about [semver](https://docs.npmjs.com/cli/v6/using-npm/semver/) for more information.
Expand Down
2 changes: 1 addition & 1 deletion internal/js_parser/js_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -1605,7 +1605,7 @@ func (p *parser) hoistSymbols(scope *js_ast.Scope) {
func (p *parser) declareBinding(kind ast.SymbolKind, binding js_ast.Binding, opts parseStmtOpts) {
js_ast.ForEachIdentifierBinding(binding, func(loc logger.Loc, b *js_ast.BIdentifier) {
if !opts.isTypeScriptDeclare || (opts.isNamespaceScope && opts.isExport) {
b.Ref = p.declareSymbol(kind, binding.Loc, p.loadNameFromRef(b.Ref))
b.Ref = p.declareSymbol(kind, loc, p.loadNameFromRef(b.Ref))
}
})
}
Expand Down

0 comments on commit 78f89e4

Please sign in to comment.