From b86be27b08646c345c2ed189f42aa8a9ff366987 Mon Sep 17 00:00:00 2001 From: Bogdan Chadkin Date: Mon, 1 Aug 2016 22:08:09 +0300 Subject: [PATCH 1/3] failing test for #813 --- test/function/cycles-pathological-3/_config.js | 12 ++++++++++++ test/function/cycles-pathological-3/a.js | 3 +++ test/function/cycles-pathological-3/b.js | 3 +++ test/function/cycles-pathological-3/c.js | 3 +++ test/function/cycles-pathological-3/main.js | 1 + test/function/cycles-pathological-3/x.a.js | 2 ++ test/function/cycles-pathological-3/x.b.js | 2 ++ test/function/cycles-pathological-3/x.c.js | 2 ++ 8 files changed, 28 insertions(+) create mode 100644 test/function/cycles-pathological-3/_config.js create mode 100644 test/function/cycles-pathological-3/a.js create mode 100644 test/function/cycles-pathological-3/b.js create mode 100644 test/function/cycles-pathological-3/c.js create mode 100644 test/function/cycles-pathological-3/main.js create mode 100644 test/function/cycles-pathological-3/x.a.js create mode 100644 test/function/cycles-pathological-3/x.b.js create mode 100644 test/function/cycles-pathological-3/x.c.js diff --git a/test/function/cycles-pathological-3/_config.js b/test/function/cycles-pathological-3/_config.js new file mode 100644 index 0000000..6956788 --- /dev/null +++ b/test/function/cycles-pathological-3/_config.js @@ -0,0 +1,12 @@ +var assert = require( 'assert' ); + +module.exports = { + solo: true, + description: 'resolves more pathological cyclical dependencies gracefully', + options: { + onwarn: function ( message ) { + console.log(message); + // assert.ok( /unable to evaluate without/.test( message ) ); + } + } +}; diff --git a/test/function/cycles-pathological-3/a.js b/test/function/cycles-pathological-3/a.js new file mode 100644 index 0000000..c77b86b --- /dev/null +++ b/test/function/cycles-pathological-3/a.js @@ -0,0 +1,3 @@ +import * as x from "./x.a.js"; +x.b(); +x.c(); \ No newline at end of file diff --git a/test/function/cycles-pathological-3/b.js b/test/function/cycles-pathological-3/b.js new file mode 100644 index 0000000..b93201c --- /dev/null +++ b/test/function/cycles-pathological-3/b.js @@ -0,0 +1,3 @@ +import * as x from "./x.b.js"; + +export function b() {} \ No newline at end of file diff --git a/test/function/cycles-pathological-3/c.js b/test/function/cycles-pathological-3/c.js new file mode 100644 index 0000000..60a9826 --- /dev/null +++ b/test/function/cycles-pathological-3/c.js @@ -0,0 +1,3 @@ +import * as x from "./x.c.js"; + +export function c() {} \ No newline at end of file diff --git a/test/function/cycles-pathological-3/main.js b/test/function/cycles-pathological-3/main.js new file mode 100644 index 0000000..1580611 --- /dev/null +++ b/test/function/cycles-pathological-3/main.js @@ -0,0 +1 @@ +import './a.js'; \ No newline at end of file diff --git a/test/function/cycles-pathological-3/x.a.js b/test/function/cycles-pathological-3/x.a.js new file mode 100644 index 0000000..e73df11 --- /dev/null +++ b/test/function/cycles-pathological-3/x.a.js @@ -0,0 +1,2 @@ +export * from "./b.js"; +export * from "./c.js"; \ No newline at end of file diff --git a/test/function/cycles-pathological-3/x.b.js b/test/function/cycles-pathological-3/x.b.js new file mode 100644 index 0000000..c3e2ed3 --- /dev/null +++ b/test/function/cycles-pathological-3/x.b.js @@ -0,0 +1,2 @@ +export * from "./a.js"; +export * from "./c.js"; \ No newline at end of file diff --git a/test/function/cycles-pathological-3/x.c.js b/test/function/cycles-pathological-3/x.c.js new file mode 100644 index 0000000..2f49591 --- /dev/null +++ b/test/function/cycles-pathological-3/x.c.js @@ -0,0 +1,2 @@ +export * from "./a.js"; +export * from "./b.js"; \ No newline at end of file From c64da6ebcfd244402310d6a464d395b912609357 Mon Sep 17 00:00:00 2001 From: Philipp Weinfurter Date: Fri, 5 Aug 2016 23:51:07 +0200 Subject: [PATCH 2/3] Initialize member in constructor, fixes #813 --- src/Bundle.js | 1 - src/Module.js | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle.js b/src/Bundle.js index 7b937d4..430983b 100644 --- a/src/Bundle.js +++ b/src/Bundle.js @@ -218,7 +218,6 @@ export default class Bundle { this.moduleById.set( id, module ); return this.fetchAllDependencies( module ).then( () => { - module.exportsAll = blank(); keys( module.exports ).forEach( name => { module.exportsAll[name] = module.id; }); diff --git a/src/Module.js b/src/Module.js index 1cac43a..5942901 100644 --- a/src/Module.js +++ b/src/Module.js @@ -35,6 +35,7 @@ export default class Module { // imports and exports, indexed by local name this.imports = blank(); this.exports = blank(); + this.exportsAll = blank(); this.reexports = blank(); this.exportAllSources = []; From a945b77eb31c9fc8dcbeb004a1e69bb5093cfeb5 Mon Sep 17 00:00:00 2001 From: Bogdan Chadkin Date: Sat, 6 Aug 2016 14:38:49 +0300 Subject: [PATCH 3/3] Clean up test --- test/function/cycles-pathological-3/_config.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/test/function/cycles-pathological-3/_config.js b/test/function/cycles-pathological-3/_config.js index 6956788..155e2f6 100644 --- a/test/function/cycles-pathological-3/_config.js +++ b/test/function/cycles-pathological-3/_config.js @@ -1,12 +1,3 @@ -var assert = require( 'assert' ); - module.exports = { - solo: true, - description: 'resolves more pathological cyclical dependencies gracefully', - options: { - onwarn: function ( message ) { - console.log(message); - // assert.ok( /unable to evaluate without/.test( message ) ); - } - } + description: 'resolves more pathological cyclical dependencies gracefully' };