MCPcopy Create free account
hub / github.com/dop251/goja / TestEmptyCodeError

Function TestEmptyCodeError

compiler_test.go:2842–2850  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2840}
2841
2842func TestEmptyCodeError(t *testing.T) {
2843 if _, err := New().RunString(`i`); err == nil {
2844 t.Fatal("Expected an error")
2845 } else {
2846 if e := err.Error(); e != "ReferenceError: i is not defined at <eval>:1:1(0)" {
2847 t.Fatalf("Unexpected error: '%s'", e)
2848 }
2849 }
2850}
2851
2852func TestForOfArray(t *testing.T) {
2853 const SCRIPT = `

Callers

nothing calls this directly

Calls 3

NewFunction · 0.85
RunStringMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…