diff --git a/js-assembler/runtime-src/runtime.js b/js-assembler/runtime-src/runtime.js index fcc4c38..ad96f2c 100644 --- a/js-assembler/runtime-src/runtime.js +++ b/js-assembler/runtime-src/runtime.js @@ -488,11 +488,12 @@ var Pause = function(onPause) { // onPause: MACHINE -> void - this.onPause = onPause || function(MACHINE) {}; + this.onPause = onPause; }; - + var THE_SINGLETON_PAUSE = new Pause(); var PAUSE = function(onPause) { - throw(new Pause(onPause)); + THE_SINGLETON_PAUSE.onPause = onPause; + throw(THE_SINGLETON_PAUSE); }; @@ -564,7 +565,7 @@ scheduleTrampoline(that, thunk, release); return; } - } else if (e instanceof Pause) { + } else if (e === THE_SINGLETON_PAUSE) { var pauseLock = new ExclusiveLock(); var oldArgcount = that.a; var restarted = false; diff --git a/version.rkt b/version.rkt index 190911b..3e24b9d 100644 --- a/version.rkt +++ b/version.rkt @@ -7,4 +7,4 @@ (provide version) (: version String) -(define version "1.213") +(define version "1.215")