Comments (4)
Interesting, do you know which package is causing this?
from esparse.
@programmeruser2 Hi! Just looked into this for you and it looks like there was an issue with the .replit file. If you add a closing quotation at the end of the run command it should work. I attached a screenshot of how I got my fork to work as well as my forked repl.
My repl:
from esparse.
@Obaida-Albaroudi Yes, it does work if you tell the packager to ignore the current directory, which is functionally equivalent to turning it off. The bug still persists if you don't.
from esparse.
I'm having the same error, but I'm not sure if it's the same bug.
I've narrowed it down to a minimal example (playground):
package main
import (
"github.com/amasad/esparse/logging"
"github.com/amasad/esparse/parser"
)
func main() {
logger, _ := logging.NewStderrLog(logging.StderrOptions{})
path := "file.js"
parser.Parse(logger, logging.Source{
Index: 0,
AbsolutePath: path,
PrettyPath: path,
Contents: `(a = () => {}) => {}`,
}, parser.ParseOptions{})
}
This outputs:
panic: Scope location 0 must be greater than 5 [recovered]
panic: Scope location 0 must be greater than 5
goroutine 1 [running]:
github.com/amasad/esparse/parser.Parse.func1(0xc000191f38)
/tmp/gopath258687768/pkg/mod/github.com/amasad/[email protected]/parser/parser.go:7827 +0x6b
panic(0x51bd60, 0xc0000102c0)
/usr/local/go-faketime/src/runtime/panic.go:965 +0x1b9
github.com/amasad/esparse/parser.(*parser).pushScopeForParsePass(0xc000188000, 0x2, 0x0, 0x0)
/tmp/gopath258687768/pkg/mod/github.com/amasad/[email protected]/parser/parser.go:272 +0x39f
github.com/amasad/esparse/parser.(*parser).parseParenExpr(0xc000188000, 0x0, 0x0, 0x0, 0x0)
/tmp/gopath258687768/pkg/mod/github.com/amasad/[email protected]/parser/parser.go:1759 +0x6c5
github.com/amasad/esparse/parser.(*parser).parsePrefix(0xc000188000, 0x0, 0x0, 0x7f7500000000, 0x0, 0x0)
/tmp/gopath258687768/pkg/mod/github.com/amasad/[email protected]/parser/parser.go:1915 +0x15cf
github.com/amasad/esparse/parser.(*parser).parseExpr(0xc000188000, 0x0, 0x400, 0x30, 0x7f7569803e00)
/tmp/gopath258687768/pkg/mod/github.com/amasad/[email protected]/parser/parser.go:2435 +0x45
github.com/amasad/esparse/parser.(*parser).parseStmt(0xc000188000, 0x101, 0x0, 0x0, 0x0)
/tmp/gopath258687768/pkg/mod/github.com/amasad/[email protected]/parser/parser.go:4592 +0x110
github.com/amasad/esparse/parser.(*parser).parseStmtsUpTo(0xc000188000, 0x0, 0x101, 0x7, 0x541f14, 0x7)
/tmp/gopath258687768/pkg/mod/github.com/amasad/[email protected]/parser/parser.go:4834 +0xa6
github.com/amasad/esparse/parser.Parse(0xc0000620c0, 0x0, 0x541f14, 0x7, 0x541f14, 0x7, 0x5445b8, 0x14, 0x0, 0x0, ...)
/tmp/gopath258687768/pkg/mod/github.com/amasad/[email protected]/parser/parser.go:7851 +0x1d0
main.main()
/tmp/sandbox989750109/prog.go:11 +0x125
Program exited: status 2.
I think it's having trouble with an arrow function as the default parameter of another arrow function.
I would try and fix this and open a PR, but I have absolutely no experience with Go.
from esparse.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esparse.