(t *testing.T)
| 155 | } |
| 156 | |
| 157 | func TestContextExceptionPrimitiveFallback(t *testing.T) { |
| 158 | useStableOwnerHooksForLegacySubtests(t) |
| 159 | |
| 160 | rt := NewRuntime() |
| 161 | defer rt.Close() |
| 162 | ctx := rt.NewContext() |
| 163 | defer ctx.Close() |
| 164 | |
| 165 | result := ctx.Eval(`throw 42`) |
| 166 | defer result.Free() |
| 167 | require.True(t, result.IsException()) |
| 168 | require.True(t, ctx.HasException()) |
| 169 | require.EqualError(t, ctx.Exception(), "javascript exception") |
| 170 | require.False(t, ctx.HasException()) |
| 171 | require.Nil(t, ctx.Exception()) |
| 172 | } |
| 173 | |
| 174 | func TestContextInternalStateHelpers(t *testing.T) { |
| 175 | var nilCtx *Context |
nothing calls this directly
no test coverage detected