mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
parent
4c035ada36
commit
5245436e36
3 changed files with 6 additions and 5 deletions
|
@ -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);
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue