sgzwiz / brython

Automatically exported from code.google.com/p/brython
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

"prompt" command shall probably accept two arguments #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
With console_fr.html:

prompt("Hello", "world")

display a dialog with "Hello" shown, but the input is not pre-filled with 
"world"

Possible workaround, by adding :
<script type="text/javascript">
    patch = {
        __getattr__ : function(attr){
            var res = this[attr]
            if(res===undefined){$raise('AttributeError','module has no attribute '+attr)}
            return res
        },
        prompt : function(s1,s2){ return prompt(s1, s2) }
    }
</script>

and using:
patch.prompt("Hello", "world")

Original issue reported on code.google.com by pedro.ro...@gmail.com on 27 Dec 2012 at 3:52

GoogleCodeExporter commented 9 years ago
Correct, fixed in the next version

Original comment by pierre.q...@gmail.com on 28 Dec 2012 at 8:43