Fix async loading of PaperScript to use correct scope.

This commit is contained in:
msand 2013-11-24 17:19:45 +02:00
parent f7a473a598
commit 900cea3123

View file

@ -315,9 +315,9 @@ paper.PaperScope.prototype.PaperScript = (function(root) {
if (src) {
// If we're loading from a source, request that first and
// then run later.
paper.Http.request('get', src, function(code) {
evaluate(code, scope);
});
paper.Http.request('get', src, function(scope, code) {
evaluate(code, scope);
}.bind(this, scope));
} else {
// We can simply get the code form the script tag.
evaluate(script.innerHTML, scope);