From e653cca04ce131ff8358447a01ae55469a51173a Mon Sep 17 00:00:00 2001 From: Jeroen van Veen Date: Tue, 28 Feb 2017 20:43:31 +0100 Subject: [PATCH] Pass optional acorn options from browserify to detective. --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 45cbeac..82c26c3 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,6 @@ var fs = require('fs'); var path = require('path'); -var relativePath = require('cached-path-relative') +var relativePath = require('cached-path-relative'); var browserResolve = require('browser-resolve'); var nodeResolve = require('resolve'); @@ -33,6 +33,7 @@ function Deps (opts) { }); }; this.cache = opts.cache; + this.acorn = {parse: {acorn: opts.acorn}}; this.fileCache = opts.fileCache; this.pkgCache = opts.packageCache || {}; this.pkgFileCache = {}; @@ -475,7 +476,7 @@ Deps.prototype.parseDeps = function (file, src, cb) { return []; } - try { var deps = detective(src) } + try { var deps = detective(src, this.acorn) } catch (ex) { var message = ex && ex.message ? ex.message : ex; this.emit('error', new Error(