(t *testing.T)
| 2840 | } |
| 2841 | |
| 2842 | func 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 | |
| 2852 | func TestForOfArray(t *testing.T) { |
| 2853 | const SCRIPT = ` |