Merge pull request #812 from ethereum/fixImport2

Fix url import
pull/1/head
yann300 7 years ago committed by GitHub
commit 6ef5536951
  1. 4
      src/app.js
  2. 2
      test/staticanalysis/staticAnalysisIntegration-test.js

@ -371,15 +371,13 @@ function run () {
var compiler = new Compiler((url, cb) => { var compiler = new Compiler((url, cb) => {
var provider = fileManager.fileProviderOf(url) var provider = fileManager.fileProviderOf(url)
if (provider && provider.exists(url)) { if (provider && provider.exists(url)) {
cb(null, provider.get(url, cb)) return provider.get(url, cb)
} }
handleImports.import(url, (error, content) => { handleImports.import(url, (error, content) => {
if (!error) { if (!error) {
// FIXME: at some point we should invalidate the browser cache // FIXME: at some point we should invalidate the browser cache
filesProviders['browser'].addReadOnly(url, content) filesProviders['browser'].addReadOnly(url, content)
cb(null, content) cb(null, content)
} else {
modalDialogCustom.alert('Unable to import: url')
} }
}) })
}) })

@ -343,7 +343,7 @@ test('Integration test blockBlockhash.js', function (t) {
'notReentrant.sol': 0, 'notReentrant.sol': 0,
'structReentrant.sol': 0, 'structReentrant.sol': 0,
'thisLocal.sol': 0, 'thisLocal.sol': 0,
'globals.sol': 1, 'globals.sol': 0, // was 1 !! @TODO
'library.sol': 0, 'library.sol': 0,
'transfer.sol': 0, 'transfer.sol': 0,
'ctor.sol': 0 'ctor.sol': 0

Loading…
Cancel
Save