slice(), and so on. The only nitpicky tweak required is to give eval scope, so that loops like
for (var i = 0... don’t clobber the
i variable that mistakes relies on.
It supports loading from GitHub Gists, using CORS. There’s also a
There’s plenty of prior art: bl.ocks.org, tributary.io, and glsl sandbox all pull content from gists, and SLIME and others have pioneered the idea of running code while writing it. I find the
mistakes system for this to be pretty intuitive: instead of having a magic keybinding to evaluate code and to have a mental model of what’s evaluated, it’s very simple: if you have the lines
var a = 1; var b = 2; a + b;
It simply evaluates them in order: line 0, line 0 to 1, line 0 to 2. For me, that’s pretty easy to think about and talk about.
If there’s a syntax error, nothing is printed. I could use something like Esprima to be smarter here, but it’s not the focus.