mirror of https://github.com/embarklabs/embark.git
window -> global; reorg statements
This commit is contained in:
parent
454fd1214c
commit
3fb4d86e67
|
@ -287,7 +287,7 @@ class CodeGenerator {
|
|||
const self = this;
|
||||
let embarkjsCode = "import EmbarkJS from 'embarkjs';";
|
||||
embarkjsCode += "\nexport default EmbarkJS;";
|
||||
embarkjsCode += "\nwindow.EmbarkJS = EmbarkJS";
|
||||
embarkjsCode += "\nglobal.EmbarkJS = EmbarkJS";
|
||||
let code = "";
|
||||
|
||||
async.waterfall([
|
||||
|
@ -365,17 +365,16 @@ class CodeGenerator {
|
|||
function getImports(web3Location, next) {
|
||||
web3Location = web3Location.replace(/\\/g, '/'); // Import paths must always have forward slashes
|
||||
code += "\nimport Web3 from '" + web3Location + "';\n";
|
||||
code += "\nglobal.Web3 = Web3;\n";
|
||||
|
||||
code += "\n if (typeof web3 !== 'undefined') {";
|
||||
code += "\n } else {";
|
||||
code += "\n if (typeof web3 === 'undefined') {";
|
||||
code += "\n var web3 = new Web3();\n";
|
||||
code += "\n }";
|
||||
code += "\nglobal.web3 = web3;\n";
|
||||
|
||||
let providerCode = self.generateProvider(false);
|
||||
code += providerCode;
|
||||
code += "\nglobal.__embarkContext = __mainContext.__loadManagerInstance;\n";
|
||||
code += "\nwindow.Web3 = Web3;\n";
|
||||
code += "\nwindow.web3 = web3;\n";
|
||||
code += "\nexport default web3;\n";
|
||||
next(null, code);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue