1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
4 <title>Interpreter - JavaScript Interactive Interpreter
</title>
5 <link href=
"interpreter.css" rel=
"stylesheet" type=
"text/css" />
6 <script type=
"text/javascript" src=
"../../MochiKit/MochiKit.js"></script>
7 <script type=
"text/javascript" src=
"interpreter.js"></script>
11 Interpreter - JavaScript Interactive Interpreter
15 This demo is a JavaScript interpreter. Type some code into
16 the text input and press enter to see the results. It uses
17 <a href=
"http://mochikit.com">MochiKit
</a>'s
18 <a href=
"../../doc/html/MochiKit/DOM.html">MochiKit.DOM
</a>
19 to manipulate the display. It also supports waiting for
20 <a href=
"../../doc/html/MochiKit/Async.html">MochiKit.Async
</a>
21 Deferreds via
<tt>blockOn(aDeferred)
</tt>.
27 <a href=
"index.html" class=
"view-source">index.html
</a> |
28 <a href=
"interpreter.js" class=
"view-source">interpreter.js
</a>
31 <form id=
"interpreter_form" autocomplete=
"off">
32 <div id=
"interpreter_area">
33 <div id=
"interpreter_output"></div>
36 <input id=
"interpreter_text" name=
"input_text" type=
"text" class=
"textbox" size=
"100" />
39 <textarea id=
"interpreter_textarea" name=
"input_textarea" type=
"text" class=
"textbox" cols=
"97" rows=
"10"></textarea>
47 To show the signature of a MochiKit function and link
48 to its documentation, type help(fn) on any MochiKit
52 To write multi-line code snippets, use the lower text area
53 and press ctrl-enter or cmd-enter to submit.
56 <tt>function name() {}
</tt> syntax might not end up in
57 window scope, so use
<tt>name = function () {}
</tt>
61 If you want to stuff something into the output window
62 other than the
<tt>repr(...)
</tt> of the expression
63 result, use the
<tt>writeln(...)
</tt> function.
64 It accepts anything that MochiKit.DOM does, so you can
65 even put styled stuff in there!
68 Use
<tt>clear()
</tt> to clear the interpreter window.
71 You can use
<tt>blockOn(aDeferred)
</tt> to wait on a
72 Deferred. This expression must be used by itself, so
73 the value must be obtained from
<tt>_
</tt> or
74 <tt>last_exc
</tt>. Typing any expression will
78 Up and down arrow keys work as a rudimentary history
81 <tt>_
</tt> is the value of the last expression
82 that was not
<tt>undefined
</tt>,
<tt>last_exc
</tt> is
83 the value of the last unhandled exception.