Skip to content

Commit fd984b0

Browse files
committed
in embarkJS, if no arguments are passed default to []
1 parent 3ea6e53 commit fd984b0

File tree

2 files changed

+6
-75
lines changed

2 files changed

+6
-75
lines changed

js/build/embark.bundle.js

Lines changed: 5 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ var EmbarkJS =
7676
var self = this;
7777
var contractParams;
7878

79-
contractParams = args;
79+
contractParams = args || [];
8080

8181
contractParams.push({
8282
from: this.web3.eth.accounts[0],
@@ -5907,83 +5907,14 @@ var EmbarkJS =
59075907
/***/ function(module, exports) {
59085908

59095909
// shim for using process in browser
5910-
var process = module.exports = {};
5911-
5912-
// cached from whatever global is present so that test runners that stub it
5913-
// don't break things. But we need to wrap it in a try catch in case it is
5914-
// wrapped in strict mode code which doesn't define any globals. It's inside a
5915-
// function because try/catches deoptimize in certain engines.
59165910

5917-
var cachedSetTimeout;
5918-
var cachedClearTimeout;
5919-
5920-
(function () {
5921-
try {
5922-
cachedSetTimeout = setTimeout;
5923-
} catch (e) {
5924-
cachedSetTimeout = function () {
5925-
throw new Error('setTimeout is not defined');
5926-
}
5927-
}
5928-
try {
5929-
cachedClearTimeout = clearTimeout;
5930-
} catch (e) {
5931-
cachedClearTimeout = function () {
5932-
throw new Error('clearTimeout is not defined');
5933-
}
5934-
}
5935-
} ())
5936-
function runTimeout(fun) {
5937-
if (cachedSetTimeout === setTimeout) {
5938-
//normal enviroments in sane situations
5939-
return setTimeout(fun, 0);
5940-
}
5941-
try {
5942-
// when when somebody has screwed with setTimeout but no I.E. maddness
5943-
return cachedSetTimeout(fun, 0);
5944-
} catch(e){
5945-
try {
5946-
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
5947-
return cachedSetTimeout.call(null, fun, 0);
5948-
} catch(e){
5949-
// 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
5950-
return cachedSetTimeout.call(this, fun, 0);
5951-
}
5952-
}
5953-
5954-
5955-
}
5956-
function runClearTimeout(marker) {
5957-
if (cachedClearTimeout === clearTimeout) {
5958-
//normal enviroments in sane situations
5959-
return clearTimeout(marker);
5960-
}
5961-
try {
5962-
// when when somebody has screwed with setTimeout but no I.E. maddness
5963-
return cachedClearTimeout(marker);
5964-
} catch (e){
5965-
try {
5966-
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
5967-
return cachedClearTimeout.call(null, marker);
5968-
} catch (e){
5969-
// 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.
5970-
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
5971-
return cachedClearTimeout.call(this, marker);
5972-
}
5973-
}
5974-
5975-
5976-
5977-
}
5911+
var process = module.exports = {};
59785912
var queue = [];
59795913
var draining = false;
59805914
var currentQueue;
59815915
var queueIndex = -1;
59825916

59835917
function cleanUpNextTick() {
5984-
if (!draining || !currentQueue) {
5985-
return;
5986-
}
59875918
draining = false;
59885919
if (currentQueue.length) {
59895920
queue = currentQueue.concat(queue);
@@ -5999,7 +5930,7 @@ var EmbarkJS =
59995930
if (draining) {
60005931
return;
60015932
}
6002-
var timeout = runTimeout(cleanUpNextTick);
5933+
var timeout = setTimeout(cleanUpNextTick);
60035934
draining = true;
60045935

60055936
var len = queue.length;
@@ -6016,7 +5947,7 @@ var EmbarkJS =
60165947
}
60175948
currentQueue = null;
60185949
draining = false;
6019-
runClearTimeout(timeout);
5950+
clearTimeout(timeout);
60205951
}
60215952

60225953
process.nextTick = function (fun) {
@@ -6028,7 +5959,7 @@ var EmbarkJS =
60285959
}
60295960
queue.push(new Item(fun, args));
60305961
if (queue.length === 1 && !draining) {
6031-
runTimeout(drainQueue);
5962+
setTimeout(drainQueue, 0);
60325963
}
60335964
};
60345965

js/embark.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ EmbarkJS.Contract.prototype.deploy = function(args) {
2929
var self = this;
3030
var contractParams;
3131

32-
contractParams = args;
32+
contractParams = args || [];
3333

3434
contractParams.push({
3535
from: this.web3.eth.accounts[0],

0 commit comments

Comments
 (0)