From 0ec06e7353f6119401aed87d9a3678756ce8dea0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sat, 11 Mar 2017 20:53:35 +0100 Subject: [PATCH] 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 --- src/core/PaperScript.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/PaperScript.js b/src/core/PaperScript.js index 3192d70a..6272c74d 100644 --- a/src/core/PaperScript.js +++ b/src/core/PaperScript.js @@ -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