Codebase list node-rollup-plugin-commonjs / 297abcc
Add remove parse This patch should be removed when 0.56 hit unstable Bastien Roucariès 5 years ago
3 changed file(s) with 50 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
11 Upstream-Name: rollup-plugin-commonjs
22 Upstream-Contact: https://github.com/rollup/rollup-plugin-commonjs/issues
33 Source: https://github.com/rollup/rollup-plugin-commonjs
4 Files-Excluded: dist/*
45
56 Files: *
67 Copyright: 2015-2018 Rich Harris
0 Subject: remove parse and use acorn
1 author: Bastien Roucariès <rouca@debian.org>
2
3 This is a work arround that should be removed when rollup 0.56 hit unstable
4
5 Forwarded: not-needed
6 from: https://github.com/rollup/rollup-plugin-commonjs/commit/4131fb324043855f90009bd5f2cfe1c8a576a127.patch
7
8 Index: node-rollup-plugin-commonjs/src/index.js
9 ===================================================================
10 --- node-rollup-plugin-commonjs.orig/src/index.js
11 +++ node-rollup-plugin-commonjs/src/index.js
12 @@ -101,7 +101,7 @@ export default function commonjs(options
13
14 const transformPromise = entryModuleIdsPromise
15 .then(entryModuleIds => {
16 - const { isEsModule, hasDefaultExport, ast } = checkEsModule(this.parse, code, id);
17 + const { isEsModule, hasDefaultExport, ast } = checkEsModule(this, code, id);
18 if (isEsModule) {
19 (hasDefaultExport ? esModulesWithDefaultExport : esModulesWithoutDefaultExport)[id] = true;
20 return null;
21 @@ -114,7 +114,7 @@ export default function commonjs(options
22 }
23
24 const transformed = transformCommonjs(
25 - this.parse,
26 + this,
27 code,
28 id,
29 entryModuleIds.indexOf(id) !== -1,
30 Index: node-rollup-plugin-commonjs/src/transform.js
31 ===================================================================
32 --- node-rollup-plugin-commonjs.orig/src/transform.js
33 +++ node-rollup-plugin-commonjs/src/transform.js
34 @@ -1,3 +1,4 @@
35 +import acorn from 'acorn';
36 import { walk } from 'estree-walker';
37 import MagicString from 'magic-string';
38 import { attachScopes, makeLegalIdentifier } from 'rollup-pluginutils';
39 @@ -31,7 +32,7 @@ function deconflict(scope, globals, iden
40
41 function tryParse(parse, code, id) {
42 try {
43 - return parse(code, { allowReturnOutsideFunction: true });
44 + return acorn.parse(code, { allowReturnOutsideFunction: true });
45 } catch (err) {
46 err.message += ` in ${id}`;
47 throw err;
00 version=4
1 opts=\
2 dversionmangle=s/\+(debian|dfsg|ds|deb)(\.\d+)?$//,\
3 filenamemangle=s/.*\/v?([\d\.-]+)\.tar\.gz/node-rollup-plugin-commonjs-$1.tar.gz/ \
1 opts="dversionmangle=s/\+(debian|dfsg|ds|deb)(\.\d+)?$//,repacksuffix=+ds,filenamemangle=s/.*\/v?([\d\.-]+)\.tar\.gz/node-rollup-plugin-commonjs-$1.tar.gz/" \
42 https://github.com/rollup/rollup-plugin-commonjs/tags .*/archive/v?([\d\.]+).tar.gz