Browse Source

Merge pull request #885 from rollup/always-clone

prevent leaky state, always clone magic-string
rewrite
Rich Harris 8 years ago
committed by GitHub
parent
commit
c272984a07
  1. 2
      src/Module.js
  2. 6
      test/test.js

2
src/Module.js

@ -448,7 +448,7 @@ export default class Module {
}
render ( es ) {
const magicString = this.magicString;
const magicString = this.magicString.clone();
this.statements.forEach( statement => {
if ( !statement.isIncluded ) {

6
test/test.js

@ -290,10 +290,12 @@ describe( 'rollup', function () {
}
}, config.options );
( config.skip ? describe.skip : config.solo ? describe.only : describe)( dir, () => {
( config.skip ? describe.skip : config.solo ? describe.only : describe )( dir, () => {
const promise = rollup.rollup( options );
PROFILES.forEach( profile => {
it( 'generates ' + profile.format, () => {
return rollup.rollup( options ).then( bundle => {
return promise.then( bundle => {
const options = extend( {}, config.options, {
dest: FORM + '/' + dir + '/_actual/' + profile.format + '.js',
format: profile.format

Loading…
Cancel
Save