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({ self.postMessage({
cmd: 'versionLoaded', cmd: 'versionLoaded',
data: compiler.version(), data: compiler.version()
acceptsMultipleFiles: compiler.supportsMulti
}) })
break break
case 'compile': case 'compile':

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

Loading…
Cancel
Save