mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge.
This commit is contained in:
commit
eae300dcb7
@ -115,12 +115,12 @@ var Utils = {
|
||||
consoleService.logStringMessage(text);
|
||||
},
|
||||
|
||||
error: function(text) { // pass as many arguments as you want, it'll print them all
|
||||
error: function() { // pass as many arguments as you want, it'll print them all
|
||||
var text = this.expandArgumentsForLog(arguments);
|
||||
Components.utils.reportError(text);
|
||||
Cu.reportError('tabcandy error: ' + text);
|
||||
},
|
||||
|
||||
trace: function(text) { // pass as many arguments as you want, it'll print them all
|
||||
trace: function() { // pass as many arguments as you want, it'll print them all
|
||||
var text = this.expandArgumentsForLog(arguments);
|
||||
if(typeof(printStackTrace) != 'function')
|
||||
this.log(text + ' trace: you need to include stacktrace.js');
|
||||
@ -131,6 +131,18 @@ var Utils = {
|
||||
}
|
||||
},
|
||||
|
||||
assert: function(label, condition) {
|
||||
if(!condition) {
|
||||
var text = 'tabcandy assert: ' + label;
|
||||
if(typeof(printStackTrace) == 'function') {
|
||||
var calls = printStackTrace();
|
||||
text += '\n' + calls[3];
|
||||
}
|
||||
|
||||
Cu.reportError(text);
|
||||
}
|
||||
},
|
||||
|
||||
expandObject: function(obj) {
|
||||
var s = obj + ' = {';
|
||||
for(prop in obj) {
|
||||
@ -177,6 +189,12 @@ var Utils = {
|
||||
return (event.button == 2);
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
// ___ Time
|
||||
getMilliseconds: function() {
|
||||
var date = new Date();
|
||||
return date.getTime();
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user