From 43f319e762bb088950b8bfa0dffe3d5afdc17aaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Wed, 30 Apr 2014 16:26:04 +0200 Subject: [PATCH] Remove support for Esprima as Acorn.js does everything we need. --- bower.json | 1 - build/minify-components.sh | 3 +-- src/core/PaperScript.js | 12 ++---------- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/bower.json b/bower.json index 4ca700e7..4c580fbd 100644 --- a/bower.json +++ b/bower.json @@ -26,7 +26,6 @@ "devDependencies": { "straps": "~1.5.2", "acorn": "git://github.com/paperjs/acorn#0.3.2", - "esprima": "~1.0.3", "stats.js": "r11" }, "keywords": [ diff --git a/build/minify-components.sh b/build/minify-components.sh index 82a4bdd6..4fd60e46 100755 --- a/build/minify-components.sh +++ b/build/minify-components.sh @@ -10,5 +10,4 @@ # # All rights reserved. -../node_modules/.bin/uglifyjs ../bower_components/acorn/acorn.js -o ../bower_components/acorn/acorn.min.js -c -m -b ascii_only=true,beautify=false -../node_modules/.bin/uglifyjs ../bower_components/esprima/esprima.js -o ../bower_components/esprima/esprima.min.js -c -m -b ascii_only=true,beautify=false +../node_modules/.bin/uglifyjs ../bower_components/acorn/acorn.js -o ../bower_components/acorn/acorn.min.js -c -m -b ascii_only=true,beautify=falsefy=false diff --git a/src/core/PaperScript.js b/src/core/PaperScript.js index 027b8363..2daf02b9 100644 --- a/src/core/PaperScript.js +++ b/src/core/PaperScript.js @@ -15,16 +15,12 @@ * @namespace */ Base.exports.PaperScript = (function() { - // Locally turn of exports and define for inlined acorn / esprima. + // Locally turn of exports and define for inlined acorn. // Just declaring the local vars is enough, as they will be undefined. var exports, define, // The scope into which the library is loaded. scope = this; -/*#*/ if (__options.parser == 'acorn') { /*#*/ include('../../bower_components/acorn/acorn.min.js', { exports: false }); -/*#*/ } else if (__options.parser == 'esprima') { -/*#*/ include('../../bower_components/esprima/esprima.min.js', { exports: false }); -/*#*/ } // We need some browser info for dealing with source maps and code offsets var ua = navigator.userAgent, @@ -287,11 +283,7 @@ Base.exports.PaperScript = (function() { sourceMap.sourcesContent = [code]; } // Now do the parsing magic -/*#*/ if (__options.parser == 'acorn') { - walkAST(scope.acorn.parse(code, { ranges: true, locations: true })); -/*#*/ } else if (__options.parser == 'esprima') { - walkAST(scope.esprima.parse(code, { range: true, loc: true })); -/*#*/ } + walkAST(scope.acorn.parse(code, { ranges: true })); if (sourceMap) { // Adjust the line offset of the resulting code if required.