Browse Source

Merge branch 'master' into no-aggressive

gh-335
Rich-Harris 9 years ago
parent
commit
b48af86534
  1. 4
      src/Declaration.js
  2. 1
      test/form/sourcemaps-inline/_config.js
  3. 1
      test/form/sourcemaps/_config.js
  4. 9
      test/function/resolves-namespace-default/_config.js
  5. 3
      test/function/resolves-namespace-default/main.js
  6. 1
      test/function/resolves-namespace-default/mod.js
  7. 18
      test/test.js

4
src/Declaration.js

@ -76,10 +76,12 @@ export class SyntheticDefaultDeclaration {
}
addReference ( reference ) {
// Bind the reference to `this` declaration.
reference.declaration = this;
// Don't change the name to `default`; it's not a valid identifier name.
if ( reference.name === 'default' ) return;
reference.declaration = this;
this.name = reference.name;
}

1
test/form/sourcemaps-inline/_config.js

@ -1,5 +1,6 @@
module.exports = {
description: 'correct sourcemaps are written (inline)',
skipIfWindows: true,
options: {
sourceMap: 'inline'
}

1
test/form/sourcemaps/_config.js

@ -1,5 +1,6 @@
module.exports = {
description: 'correct sourcemaps are written (separate file)',
skipIfWindows: true,
options: {
sourceMap: true
}

9
test/function/resolves-namespace-default/_config.js

@ -0,0 +1,9 @@
var assert = require('assert');
module.exports = {
description: "namespace's 'default' properties should be available",
exports: function ( exports ) {
assert.equal( exports, 42 );
}
};

3
test/function/resolves-namespace-default/main.js

@ -0,0 +1,3 @@
import * as mod from './mod.js';
export default mod.default();

1
test/function/resolves-namespace-default/mod.js

@ -0,0 +1 @@
export default function () { return 42; }

18
test/test.js

@ -46,13 +46,19 @@ describe( 'rollup', function () {
assert.equal( typeof rollup.rollup, 'function' );
});
it( 'fails without options or options.entry', function () {
rollup.rollup().catch( function (err) {
assert( /must supply options\.entry/.test( err.toString() ) );
it( 'fails without options', function () {
return rollup.rollup().then( function () {
throw new Error( 'Missing expected error' );
}, function (err) {
assert.equal( 'You must supply options.entry to rollup', err.message );
});
});
rollup.rollup().catch( function (err) {
assert( /must supply options\.entry/.test( err.toString() ) );
it( 'fails without options.entry', function () {
return rollup.rollup({}).then( function () {
throw new Error( 'Missing expected error' );
}, function (err) {
assert.equal( 'You must supply options.entry to rollup', err.message );
});
});
});
@ -221,6 +227,8 @@ describe( 'rollup', function () {
var config = require( FORM + '/' + dir + '/_config' );
if ( config.skipIfWindows && process.platform === 'win32' ) return;
var options = extend( {}, config.options, {
entry: FORM + '/' + dir + '/main.js'
});

Loading…
Cancel
Save