Commit 5c86a00a authored by Grandschtroumpf's avatar Grandschtroumpf Committed by yann300

use `events` instead of `event` for EventEmitter

parent 43c260d2
...@@ -16,12 +16,12 @@ class PluginManagerProxy { ...@@ -16,12 +16,12 @@ class PluginManagerProxy {
registry.get('compilersartefacts').api['__last'] = new CompilerAbstract(languageVersion, data, source) registry.get('compilersartefacts').api['__last'] = new CompilerAbstract(languageVersion, data, source)
event.trigger('sendCompilationResult', [file, source, languageVersion, data]) event.trigger('sendCompilationResult', [file, source, languageVersion, data])
} }
instance.event.on('compilationFinished', this._listener) instance.events.on('compilationFinished', this._listener)
} }
unregister (instance) { unregister (instance) {
if (!this._listener) { if (!this._listener) {
instance.event.on('compilationFinished', this._listener) instance.events.on('compilationFinished', this._listener)
} }
} }
......
'use strict' 'use strict'
var EventEmitter = require('events') const EventEmitter = require('events')
var EventManager = require('../../lib/events') var EventManager = require('../../lib/events')
var globalRegistry = require('../../global/registry') var globalRegistry = require('../../global/registry')
var CompilerImport = require('../compiler/compiler-imports') var CompilerImport = require('../compiler/compiler-imports')
...@@ -14,7 +14,7 @@ class FileManager { ...@@ -14,7 +14,7 @@ class FileManager {
constructor (localRegistry) { constructor (localRegistry) {
this.openedFiles = {} // list all opened files this.openedFiles = {} // list all opened files
this.event = new EventManager() this.event = new EventManager()
this.nodeEvent = new EventEmitter() this.events = new EventEmitter()
this._components = {} this._components = {}
this._components.compilerImport = new CompilerImport() this._components.compilerImport = new CompilerImport()
this._components.registry = localRegistry || globalRegistry this._components.registry = localRegistry || globalRegistry
...@@ -44,7 +44,7 @@ class FileManager { ...@@ -44,7 +44,7 @@ class FileManager {
self._deps.localhostExplorer.event.register('closed', (event) => { this.removeTabsOf(self._deps.localhostExplorer) }) self._deps.localhostExplorer.event.register('closed', (event) => { this.removeTabsOf(self._deps.localhostExplorer) })
self.event.register('currentFileChanged', (file, provider) => { self.event.register('currentFileChanged', (file, provider) => {
this.nodeEvent.emit('currentFileChanged', file) this.events.emit('currentFileChanged', file)
}) })
} }
......
...@@ -20,7 +20,7 @@ const CompilerContainer = require('./compileTab/compilerContainer.js') ...@@ -20,7 +20,7 @@ const CompilerContainer = require('./compileTab/compilerContainer.js')
class CompileTab { class CompileTab {
constructor (registry) { constructor (registry) {
this.event = new EventEmitter() this.events = new EventEmitter()
this._view = { this._view = {
el: null, el: null,
warnCompilationSlow: null, warnCompilationSlow: null,
...@@ -81,7 +81,7 @@ class CompileTab { ...@@ -81,7 +81,7 @@ class CompileTab {
this.compiler.event.register('compilationFinished', (success, data, source) => { this.compiler.event.register('compilationFinished', (success, data, source) => {
if (success) { if (success) {
// forwarding the event to the appManager infra // forwarding the event to the appManager infra
this.event.emit('compilationFinished', source.target, source, this.data.selectedVersion, data) this.events.emit('compilationFinished', source.target, source, this.data.selectedVersion, data)
// Store the contracts // Store the contracts
this.data.contractsDetails = {} this.data.contractsDetails = {}
this.compiler.visitContracts((contract) => { this.compiler.visitContracts((contract) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment