mirror of https://github.com/embarklabs/embark.git
in embarkJS, if no arguments are passed default to []
This commit is contained in:
parent
3ea6e53218
commit
fd984b0e6c
|
@ -76,7 +76,7 @@ var EmbarkJS =
|
||||||
var self = this;
|
var self = this;
|
||||||
var contractParams;
|
var contractParams;
|
||||||
|
|
||||||
contractParams = args;
|
contractParams = args || [];
|
||||||
|
|
||||||
contractParams.push({
|
contractParams.push({
|
||||||
from: this.web3.eth.accounts[0],
|
from: this.web3.eth.accounts[0],
|
||||||
|
@ -5907,83 +5907,14 @@ var EmbarkJS =
|
||||||
/***/ function(module, exports) {
|
/***/ function(module, exports) {
|
||||||
|
|
||||||
// shim for using process in browser
|
// shim for using process in browser
|
||||||
|
|
||||||
var process = module.exports = {};
|
var process = module.exports = {};
|
||||||
|
|
||||||
// cached from whatever global is present so that test runners that stub it
|
|
||||||
// don't break things. But we need to wrap it in a try catch in case it is
|
|
||||||
// wrapped in strict mode code which doesn't define any globals. It's inside a
|
|
||||||
// function because try/catches deoptimize in certain engines.
|
|
||||||
|
|
||||||
var cachedSetTimeout;
|
|
||||||
var cachedClearTimeout;
|
|
||||||
|
|
||||||
(function () {
|
|
||||||
try {
|
|
||||||
cachedSetTimeout = setTimeout;
|
|
||||||
} catch (e) {
|
|
||||||
cachedSetTimeout = function () {
|
|
||||||
throw new Error('setTimeout is not defined');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
cachedClearTimeout = clearTimeout;
|
|
||||||
} catch (e) {
|
|
||||||
cachedClearTimeout = function () {
|
|
||||||
throw new Error('clearTimeout is not defined');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} ())
|
|
||||||
function runTimeout(fun) {
|
|
||||||
if (cachedSetTimeout === setTimeout) {
|
|
||||||
//normal enviroments in sane situations
|
|
||||||
return setTimeout(fun, 0);
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
// when when somebody has screwed with setTimeout but no I.E. maddness
|
|
||||||
return cachedSetTimeout(fun, 0);
|
|
||||||
} catch(e){
|
|
||||||
try {
|
|
||||||
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
|
||||||
return cachedSetTimeout.call(null, fun, 0);
|
|
||||||
} catch(e){
|
|
||||||
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
|
|
||||||
return cachedSetTimeout.call(this, fun, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
function runClearTimeout(marker) {
|
|
||||||
if (cachedClearTimeout === clearTimeout) {
|
|
||||||
//normal enviroments in sane situations
|
|
||||||
return clearTimeout(marker);
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
// when when somebody has screwed with setTimeout but no I.E. maddness
|
|
||||||
return cachedClearTimeout(marker);
|
|
||||||
} catch (e){
|
|
||||||
try {
|
|
||||||
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
|
||||||
return cachedClearTimeout.call(null, marker);
|
|
||||||
} catch (e){
|
|
||||||
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
|
|
||||||
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
|
|
||||||
return cachedClearTimeout.call(this, marker);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
var queue = [];
|
var queue = [];
|
||||||
var draining = false;
|
var draining = false;
|
||||||
var currentQueue;
|
var currentQueue;
|
||||||
var queueIndex = -1;
|
var queueIndex = -1;
|
||||||
|
|
||||||
function cleanUpNextTick() {
|
function cleanUpNextTick() {
|
||||||
if (!draining || !currentQueue) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
draining = false;
|
draining = false;
|
||||||
if (currentQueue.length) {
|
if (currentQueue.length) {
|
||||||
queue = currentQueue.concat(queue);
|
queue = currentQueue.concat(queue);
|
||||||
|
@ -5999,7 +5930,7 @@ var EmbarkJS =
|
||||||
if (draining) {
|
if (draining) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var timeout = runTimeout(cleanUpNextTick);
|
var timeout = setTimeout(cleanUpNextTick);
|
||||||
draining = true;
|
draining = true;
|
||||||
|
|
||||||
var len = queue.length;
|
var len = queue.length;
|
||||||
|
@ -6016,7 +5947,7 @@ var EmbarkJS =
|
||||||
}
|
}
|
||||||
currentQueue = null;
|
currentQueue = null;
|
||||||
draining = false;
|
draining = false;
|
||||||
runClearTimeout(timeout);
|
clearTimeout(timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
process.nextTick = function (fun) {
|
process.nextTick = function (fun) {
|
||||||
|
@ -6028,7 +5959,7 @@ var EmbarkJS =
|
||||||
}
|
}
|
||||||
queue.push(new Item(fun, args));
|
queue.push(new Item(fun, args));
|
||||||
if (queue.length === 1 && !draining) {
|
if (queue.length === 1 && !draining) {
|
||||||
runTimeout(drainQueue);
|
setTimeout(drainQueue, 0);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ EmbarkJS.Contract.prototype.deploy = function(args) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var contractParams;
|
var contractParams;
|
||||||
|
|
||||||
contractParams = args;
|
contractParams = args || [];
|
||||||
|
|
||||||
contractParams.push({
|
contractParams.push({
|
||||||
from: this.web3.eth.accounts[0],
|
from: this.web3.eth.accounts[0],
|
||||||
|
|
Loading…
Reference in New Issue