Rely on standard wrapper for single-file compiler versions.

pull/1/head
chriseth 7 years ago committed by yann300
parent 4d5ea4f47f
commit 8a09a4cba1
  1. 3
      src/app/compiler/compiler-worker.js
  2. 8
      src/app/compiler/compiler.js

@ -33,8 +33,7 @@ module.exports = function (self) {
self.postMessage({
cmd: 'versionLoaded',
data: compiler.version(),
acceptsMultipleFiles: compiler.supportsMulti
data: compiler.version()
})
break
case 'compile':

@ -19,7 +19,6 @@ function Compiler (handleImportCall) {
this.event = new EventManager()
var compileJSON
var compilerAcceptsMultipleFiles
var worker = null
@ -74,8 +73,6 @@ function Compiler (handleImportCall) {
if (worker === null) {
var compiler = solc(window.Module)
compilerAcceptsMultipleFiles = compiler.supportsMulti
compileJSON = function (source, optimize, cb) {
var missingInputs = []
var missingInputsCallback = function (path) {
@ -261,7 +258,6 @@ function Compiler (handleImportCall) {
var data = msg.data
switch (data.cmd) {
case 'versionLoaded':
compilerAcceptsMultipleFiles = !!data.acceptsMultipleFiles
onCompilerLoaded(data.data)
break
case 'compiled':
@ -295,10 +291,6 @@ function Compiler (handleImportCall) {
function gatherImports (files, target, importHints, cb) {
importHints = importHints || []
if (!compilerAcceptsMultipleFiles) {
cb(null, files[target])
return
}
// FIXME: This will only match imports if the file begins with one.
// It should tokenize by lines and check each.

Loading…
Cancel
Save