public void JScriptEngine_Interrupt() { var checkpoint = new ManualResetEvent(false); ThreadPool.QueueUserWorkItem(state => { checkpoint.WaitOne(); engine.Interrupt(); }); engine.AddHostObject("checkpoint", checkpoint); TestUtil.AssertException <OperationCanceledException>(() => engine.Execute("checkpoint.Set(); while (true) { var foo = 'hello'; }")); Assert.AreEqual(Math.E * Math.PI, engine.Evaluate("Math.E * Math.PI")); }