mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-08-13 14:38:49 -04:00
Let paper be an instance of Base, and use its #extend() function to create scopes that inherit from paper but do not directly modify it.
This commit is contained in:
parent
2c78a0a08b
commit
0b3c57ff88
2 changed files with 5 additions and 3 deletions
src/util
|
@ -4,7 +4,9 @@ var PaperScript = new function() {
|
|||
}
|
||||
|
||||
function run(code) {
|
||||
with (paper) {
|
||||
// Use paper.extend() to create a paper scope within which the code is
|
||||
// evaluated.
|
||||
with (paper.extend()) {
|
||||
return eval(compile(code));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue