From 48eb5f853aae413a34f5f6be6df8b27ca342c8c6 Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Thu, 30 Apr 2015 14:12:01 -0700 Subject: [PATCH] Bring C1Pjs exception handling up-to-date --- docs/pcjs/demos/components.xsl | 2 +- modules/c1pjs/lib/cpu.js | 2 +- modules/c1pjs/lib/debugger.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/pcjs/demos/components.xsl b/docs/pcjs/demos/components.xsl index adf645804..bd142a09c 100644 --- a/docs/pcjs/demos/components.xsl +++ b/docs/pcjs/demos/components.xsl @@ -376,7 +376,7 @@
- +
diff --git a/modules/c1pjs/lib/cpu.js b/modules/c1pjs/lib/cpu.js index d080bc116..246bfab1d 100644 --- a/modules/c1pjs/lib/cpu.js +++ b/modules/c1pjs/lib/cpu.js @@ -1114,7 +1114,7 @@ C1PCPU.prototype.run = function() this.halt(); this.update(); this.setBusy(false); - this.setError(e.message); + this.setError(e.stack || e.message); return; } setTimeout(function(cpu) { return function() {cpu.run();}; }(this), this.calcRemainingTime()); diff --git a/modules/c1pjs/lib/debugger.js b/modules/c1pjs/lib/debugger.js index 442c9c97a..cf35a8765 100644 --- a/modules/c1pjs/lib/debugger.js +++ b/modules/c1pjs/lib/debugger.js @@ -794,7 +794,7 @@ if (DEBUGGER) { } catch(e) { fCompleted = undefined; - this.cpu.setError(e.message || e); + this.cpu.setError(e.stack || e.message); } if (fCompleted !== undefined) this.cIns++; /*