1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-26 17:25:46 +01:00

Default arguments ftw.

This commit is contained in:
Kris Maglione
2013-09-21 16:57:09 -07:00
parent 25aae2cc99
commit 35784406a0
8 changed files with 14 additions and 30 deletions

View File

@@ -588,10 +588,10 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
* @param {string} msg The trace message.
* @param {number} frames The number of frames to print.
*/
dumpStack: function dumpStack(msg, frames) {
dumpStack: function dumpStack(msg="Stack", frames=null) {
let stack = util.stackLines(Error().stack);
stack = stack.slice(1, 1 + (frames || stack.length)).join("\n").replace(/^/gm, " ");
util.dump((arguments.length == 0 ? "Stack" : msg) + "\n" + stack + "\n");
util.dump(msg + "\n" + stack + "\n");
},
/**