Fix sendCompilationResults API call

pull/1/head
jesush 6 years ago committed by yann300
parent b52f24a61a
commit bd45d397e8
  1. 4
      src/app/plugin/pluginAPI.js
  2. 6
      src/app/plugin/pluginManager.js
  3. 5
      src/app/tabs/run-tab.js

@ -45,8 +45,8 @@ module.exports = (pluginManager, fileProviders, fileManager, compiler, udapp) =>
getCompilationResult: (mod, cb) => {
cb(null, compiler.lastCompilationResult)
},
sendCompilationResult: (mod, file, languageVersion, data, cb) => {
pluginManager.receivedDataFrom('sendCompilationResult', mod, file, languageVersion, data)
sendCompilationResult: (mod, file, source, languageVersion, data, cb) => {
pluginManager.receivedDataFrom('sendCompilationResult', mod, [file, source, languageVersion, data])
}
},
udapp: {

@ -195,10 +195,10 @@ module.exports = class PluginManager {
this.post(this.origins[origin], value)
}
}
receivedDataFrom (methodName, mod) {
receivedDataFrom (methodName, mod, argumentsArray) {
// TODO check whether 'mod' as right to do that
arguments.shift()
this.event.trigger(methodName, [arguments])
console.log(argumentsArray)
this.event.trigger(methodName, argumentsArray)
}
post (name, value) {
const self = this

@ -306,9 +306,10 @@ function contractDropdown (events, self) {
}
}
self._deps.pluginManager.event.register('sendCompilationResult', (mod, file, source, languageVersion, data) => {
self._deps.pluginManager.event.register('sendCompilationResult', (file, source, languageVersion, data) => {
// TODO check whether the tab is configured
newlyCompiled(true, data, source)
self._deps.compiler.ldCompilationResult(file, source, languageVersion, data)
newlyCompiled(true)
})
self._deps.compiler.event.register('compilationFinished', newlyCompiled)

Loading…
Cancel
Save