From 98e63ad42486ff4ba483eec0af8e7a683542ad69 Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Fri, 31 Aug 2018 18:55:38 +0100 Subject: [PATCH 1/2] Fix message events already declared --- lib/modules/console/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/modules/console/index.js b/lib/modules/console/index.js index 97fa303b..208b389a 100644 --- a/lib/modules/console/index.js +++ b/lib/modules/console/index.js @@ -77,7 +77,7 @@ class Console { this.events.emit('runcode:register', 'Web3', Web3, false); this.events.emit('runcode:register', 'EmbarkJS', EmbarkJS, false); - this.events.on('code-generator-ready', () => { + this.events.once('code-generator-ready', () => { if (this.ipc.connected) { return; } From e6911a5e151589983e920b5fbe448bc66c2bc414 Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Fri, 31 Aug 2018 19:01:00 +0100 Subject: [PATCH 2/2] Fix test --- test/console.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/console.js b/test/console.js index dac075a7..f02d4a99 100644 --- a/test/console.js +++ b/test/console.js @@ -8,7 +8,7 @@ let version = require('../package.json').version; describe('embark.Console', function() { let ipc = new IPC({ipcRole: 'none'}); let plugins = new Plugins({plugins: {}}); - let events = {on: () => {}, setCommandHandler: () => {}, emit: () => {}}; + let events = {once: () => {}, setCommandHandler: () => {}, emit: () => {}}; let console = new Console({}, {plugins, version, ipc, events}); describe('#executeCmd', function() {