Browse Source

Fix foolish mistakes

better-aggressive
Oskar Segersvärd 9 years ago
parent
commit
4e692342fa
  1. 2
      src/Module.js
  2. 9
      test/function/namespace-missing-export/_config.js

2
src/Module.js

@ -80,7 +80,7 @@ class SyntheticNamespaceDeclaration {
if ( !original ) { if ( !original ) {
const err = new Error( `Export '${reference.name}' is not defined by '${this.module.id}'` ); const err = new Error( `Export '${reference.name}' is not defined by '${this.module.id}'` );
err.code = 'MISSING_EXPORT'; err.code = 'MISSING_EXPORT';
err.file = this.id; err.file = this.module.id;
throw err; throw err;
} }

9
test/function/namespace-missing-export/_config.js

@ -1,12 +1,9 @@
var assert = require( 'assert' ); var assert = require( 'assert' );
var path = require( 'path' );
module.exports = { module.exports = {
solo: true,
error: function ( err ) { error: function ( err ) {
console.log( err.message ); assert.equal( path.normalize( err.file ), path.resolve( __dirname, 'empty.js' ) );
// assert.equal( path.normalize(err.file), path.resolve( __dirname, 'main.js' ) ); assert.ok( /Export 'foo' is not defined by/.test( err.message ) );
// assert.deepEqual( err.loc, { line: 8, column: 0 });
assert.ok( /Export "foo" is not defined by/.test( err.message ) );
} }
}; };

Loading…
Cancel
Save