Remove support for Esprima as Acorn.js does everything we need.

This commit is contained in:
Jürg Lehni 2014-04-30 16:26:04 +02:00
parent e96ec6a2f1
commit 43f319e762
3 changed files with 3 additions and 13 deletions

View file

@ -26,7 +26,6 @@
"devDependencies": { "devDependencies": {
"straps": "~1.5.2", "straps": "~1.5.2",
"acorn": "git://github.com/paperjs/acorn#0.3.2", "acorn": "git://github.com/paperjs/acorn#0.3.2",
"esprima": "~1.0.3",
"stats.js": "r11" "stats.js": "r11"
}, },
"keywords": [ "keywords": [

View file

@ -10,5 +10,4 @@
# #
# All rights reserved. # 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/acorn/acorn.js -o ../bower_components/acorn/acorn.min.js -c -m -b ascii_only=true,beautify=falsefy=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

View file

@ -15,16 +15,12 @@
* @namespace * @namespace
*/ */
Base.exports.PaperScript = (function() { 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. // Just declaring the local vars is enough, as they will be undefined.
var exports, define, var exports, define,
// The scope into which the library is loaded. // The scope into which the library is loaded.
scope = this; scope = this;
/*#*/ if (__options.parser == 'acorn') {
/*#*/ include('../../bower_components/acorn/acorn.min.js', { exports: false }); /*#*/ 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 // We need some browser info for dealing with source maps and code offsets
var ua = navigator.userAgent, var ua = navigator.userAgent,
@ -287,11 +283,7 @@ Base.exports.PaperScript = (function() {
sourceMap.sourcesContent = [code]; sourceMap.sourcesContent = [code];
} }
// Now do the parsing magic // Now do the parsing magic
/*#*/ if (__options.parser == 'acorn') { walkAST(scope.acorn.parse(code, { ranges: true }));
walkAST(scope.acorn.parse(code, { ranges: true, locations: true }));
/*#*/ } else if (__options.parser == 'esprima') {
walkAST(scope.esprima.parse(code, { range: true, loc: true }));
/*#*/ }
if (sourceMap) { if (sourceMap) {
// Adjust the line offset of the resulting code if required. // Adjust the line offset of the resulting code if required.