branch: master
commit b920afc8144ce5f10bc35892abd09c038251728c
Author: rocky <[email protected]>
Commit: rocky <[email protected]>
trepanjs: handle eval properly
test/gcd.js: more useful
---
realgud/debugger/trepanjs/init.el | 1 +
test/gcd.js | 14 ++++++--------
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/realgud/debugger/trepanjs/init.el
b/realgud/debugger/trepanjs/init.el
index 856c06a..4bd2b39 100644
--- a/realgud/debugger/trepanjs/init.el
+++ b/realgud/debugger/trepanjs/init.el
@@ -136,5 +136,6 @@ realgud-loc-pat struct")
;; it will probably look like step(1)
(setf (gethash "step" realgud:trepanjs-command-hash) "step")
(setf (gethash "next" realgud:trepanjs-command-hash) "next")
+(setf (gethash "eval" realgud:trepanjs-command-hash) "eval('%s')")
(provide-me "realgud:trepanjs-")
diff --git a/test/gcd.js b/test/gcd.js
index 6d7ce32..ee56555 100644
--- a/test/gcd.js
+++ b/test/gcd.js
@@ -37,11 +37,9 @@ function gcd(a, b) {
return gcd(b-a, a);
}
-var a=24;
-
-ask("GCD of 24 and", /^\d+$/, function(b_str) {
- var b = parseInt(b_str, 10);
- console.log(util.format("The GCD of %d and %d is %d", a, b,
- gcd(a, b)));
- process.exit();
-});
+var a = parseInt(process.argv[0]) || 24,
+ b = parseInt(process.argv[0]) || 5;
+
+console.log(util.format("The GCD of %d and %d is %d", a, b,
+ gcd(a, b)));
+process.exit();