Simplify the way the paper namespace is created and populated.

This commit is contained in:
Jürg Lehni 2011-03-04 13:34:31 +00:00
parent c6d79f964c
commit 92bf51a7cc
29 changed files with 38 additions and 50 deletions

View file

@ -114,9 +114,7 @@ var PaperScript = new function() {
}
function run(code) {
// Use paper.extend() to create a paper scope within which the code is
// evaluated.
with (paper.extend()) {
with (paper) {
var tool = /onMouse(?:Up|Down|Move|Drag)/.test(code) && new Tool();
var res = eval(compile(code));
if (tool) {