PaperScript: Give global.acorn the preference over the bundled one.

So people can load their own preferred version in sketch.paperjs.org

Relates to #1183
This commit is contained in:
Jürg Lehni 2017-03-11 20:53:35 +01:00
parent 29e7aba587
commit 0ec06e7353

View file

@ -37,8 +37,10 @@ Base.exports.PaperScript = function() {
function parse(code, options) {
// NOTE: When using load.js, Acorn will end up in global.acorn and will
// not be immediately available, so we need to check for it here again:
return (acorn || global.acorn).parse(code, options);
// not be immediately available, so we need to check for it here again.
// We also give global.acorn the preference over the bundled one, so
// people can load their own preferred version in sketch.paperjs.org
return (global.acorn || acorn).parse(code, options);
}
// Operators to overload