diff --git a/src/core/PaperScript.js b/src/core/PaperScript.js index 9d4eaf41..94d7a2de 100644 --- a/src/core/PaperScript.js +++ b/src/core/PaperScript.js @@ -481,11 +481,13 @@ Base.exports.PaperScript = function() { if (agent.firefox) code = '\n' + code; script.appendChild(document.createTextNode( - 'paper._execute = function(' + params + ') {' + code + '\n}' + 'document.__paperscript__ = function(' + params + ') {' + + code + + '\n}' )); head.appendChild(script); - func = paper._execute; - delete paper._execute; + func = document.__paperscript__; + delete document.__paperscript__; head.removeChild(script); } else { func = Function(params, code); diff --git a/src/export.js b/src/export.js index 34893d3a..0ac7f578 100644 --- a/src/export.js +++ b/src/export.js @@ -16,7 +16,7 @@ // NOTE: Do not create local variable `var paper` since it would shield the // global one in the whole scope. -paper = new (PaperScope.inject(Base.exports, { +var paper = new (PaperScope.inject(Base.exports, { Base: Base, Numerical: Numerical, Key: Key, diff --git a/src/init.js b/src/init.js index 55ae313b..7083208b 100644 --- a/src/init.js +++ b/src/init.js @@ -16,7 +16,6 @@ // Node.js,only the files included in such a way see each other's variables in // their shared scope. -/* global document:true, window:true */ // Set up a local `window` variable valid across the full the paper.js scope, // pointing to the native window in browsers and the one provided by JSDom in // Node.js