aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-05-14 11:15:53 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-05-14 11:15:53 -0700
commite43219048bb9c0de5ae2a004c4c300992d879d05 (patch)
treeb28da44447b09f64419e8d0c6dd1420ef021feaa
parente1ea1076ab66da581dc9472df232984d8f230f28 (diff)
handle cancel in window.prompt
-rw-r--r--src/library.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/library.js b/src/library.js
index 57b204e1..82ea327d 100644
--- a/src/library.js
+++ b/src/library.js
@@ -349,6 +349,7 @@ LibraryManager.library = {
typeof window.prompt == 'function') {
// Browser.
result = window.prompt('Input: ');
+ if (result === null) result = '\x00'; // cancel ==> EOF
} else if (typeof readline == 'function') {
// Command line.
result = readline();