diff --git a/src/builtin.js b/src/builtin.js index 072ef16904..f27923a7ab 100644 --- a/src/builtin.js +++ b/src/builtin.js @@ -211,6 +211,12 @@ Sk.builtin.getattr = function(obj, name, default_) return ret; }; +Sk.builtin.raw_input = function(obj, name, default_) +{ + var x = prompt(obj.v); + return new Sk.builtin.str(x); +}; + Sk.builtin.input = function(obj, name, default_) { var x = prompt(obj.v); diff --git a/src/builtindict.js b/src/builtindict.js index caba1b3a86..d7f1394f36 100644 --- a/src/builtindict.js +++ b/src/builtindict.js @@ -38,6 +38,7 @@ Sk.builtins = { 'tuple': Sk.builtin.tuple, 'type': Sk.builtin.type, 'input': Sk.builtin.input, +'raw_input': Sk.builtin.raw_input, /*'read': Sk.builtin.read,*/ 'jseval': Sk.builtin.jseval, 'jsmillis': Sk.builtin.jsmillis,