Skip to content

@odino odino released this May 19, 2019 · 46 commits to master since this release

This is a bugfix release that fixes #222 through #226 (originally merged in 1.4.x).
An empty string will now not cause a panic when parsed as JSON:

before

⧐  "".json()
panic: runtime error: index out of range

goroutine 1 [running]:
github.com/abs-lang/abs/evaluator.jsonFn(0x580b0b, 0x1, 0x2, 0x69714e, 0x1, 0xc000162370, 0x1, 0x1, 0x559d40, 0x5af060)
	/go/src/github.com/abs-lang/abs/evaluator/functions.go:785 +0x82e
github.com/abs-lang/abs/evaluator.applyMethod(0x580b0b, 0x1, 0x2, 0x69714e, 0x1, 0x5b02c0, 0xc000244070, 0xc00001a5d6, 0x4, 0x0, ...)
	/go/src/github.com/abs-lang/abs/evaluator/evaluator.go:974 +0x1e8
github.com/abs-lang/abs/evaluator.Eval(0x5aeea0, 0xc000236060, 0xc0000125c0, 0x5aeea0, 0xc000236060)
	/go/src/github.com/abs-lang/abs/evaluator/evaluator.go:195 +0x1beb
github.com/abs-lang/abs/evaluator.Eval(0x5aec60, 0xc0001ac300, 0xc0000125c0, 0x5aec60, 0xc0001ac300)
	/go/src/github.com/abs-lang/abs/evaluator/evaluator.go:67 +0x1636
github.com/abs-lang/abs/evaluator.evalProgram(0xc0001aa1a0, 0xc0000125c0, 0x100, 0x7f463a89bfff)
	/go/src/github.com/abs-lang/abs/evaluator/evaluator.go:232 +0x9b
github.com/abs-lang/abs/evaluator.Eval(0x5aefa0, 0xc0001aa1a0, 0xc0000125c0, 0x7f463d0566d0, 0x0)
	/go/src/github.com/abs-lang/abs/evaluator/evaluator.go:61 +0x461
github.com/abs-lang/abs/evaluator.BeginEval(...)
	/go/src/github.com/abs-lang/abs/evaluator/evaluator.go:54
github.com/abs-lang/abs/repl.Run(0xc00001a5d3, 0x9, 0x301)
	/go/src/github.com/abs-lang/abs/repl/repl.go:151 +0xcb
github.com/abs-lang/abs/repl.executor(0xc00001a5d3, 0x9)
	/go/src/github.com/abs-lang/abs/repl/repl.go:129 +0xf9
github.com/abs-lang/abs/vendor/github.com/c-bata/go-prompt.(*Prompt).Run(0xc0000aa100)
	/go/src/github.com/abs-lang/abs/vendor/github.com/c-bata/go-prompt/prompt.go:85 +0x7f2
github.com/abs-lang/abs/repl.Start(0x5ae1e0, 0xc000010010, 0x5ae200, 0xc000010018)
	/go/src/github.com/abs-lang/abs/repl/repl.go:94 +0x263
github.com/abs-lang/abs/repl.BeginRepl(0xc0000121b0, 0x1, 0x1, 0x580ebb, 0x5)
	/go/src/github.com/abs-lang/abs/repl/repl.go:211 +0x326
main.main()
	/go/src/github.com/abs-lang/abs/main.go:20 +0x94

after:

⧐  "".json()

⧐  
Assets 12
You can’t perform that action at this time.