code-dot-org/code-dot-org — pull request #143 by cpirich (2014-10-08 23:57:02+00:00)
Title: Js interpreter

Adds Neil Fraser's JS Interpreter to our project.

Enabled this for editCode levels only.

For now, there is no difference in normal execution (this is a good thing!) - but the code is now running in a sandbox with only the object model that we want exposed.

Previously, the user could type Javascript like alert(document.cookie); - and many other scary things!

Now, the user's blocks and/or javascript are run in a JS interpreter without access to document/window/etc. and this could also enable improving stepping in a javascript mode, variable inspection, step mode, breakpoints, callstack, etc. (TBD)