refactor(cloudcmd) emitify, exec: make global to prevent additonal loading of extensions

This commit is contained in:
coderaiser 2017-02-13 16:21:12 +02:00
parent 8bc07ca700
commit 5a989cd62f
3 changed files with 7 additions and 12 deletions

View file

@ -1,5 +1,11 @@
'use strict';
// prevent additional loading of exec by spero, remedy, ishtar, salam, omnes
window.exec = require('execon');
// prevent additional loading of emitify
window.Emitify = require('emitify');
window.CloudCmd = (config) => {
window.Util = require('../common/util');
window.CloudFunc = require('../common/cloudfunc');

View file

@ -24,7 +24,7 @@ function uploadDirectory(items) {
return item.webkitGetAsEntry();
});
array = array.map(function(name) {
array = array.map((name) => {
const result = [
'/modules/' + name,
'/lib/' + name,
@ -34,12 +34,6 @@ function uploadDirectory(items) {
return result;
});
if (!window.Emitify)
window.Emitify = require('emitify');
if (!window.exec)
window.exec = require('execon');
const url = CloudCmd.join(array);
load.js(url, () => {

View file

@ -15,11 +15,6 @@ const currify = require('currify/legacy');
const exec = require('execon');
const emitify = require('emitify');
// prevent loading of exec by spero, remedy, ishtar, salam, omnes
window.exec = exec;
// prevent loading of emitify
window.Emitify = emitify;
const RESTful = require('./rest');
function OperationProto(operation, data) {