1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 01:58:06 +02:00

Merge pull request #2058 from Pimm/master

Small fixes for normal and potential post-compilation bugs
This commit is contained in:
Yury Delendik 2012-09-20 11:36:55 -07:00
commit 75e928c102
9 changed files with 53 additions and 29 deletions

View file

@ -25,11 +25,18 @@ function MessageHandler(name, comObj) {
var ah = this.actionHandler = {};
ah['console_log'] = [function ahConsoleLog(data) {
console.log.apply(console, data);
}];
ah['console_error'] = [function ahConsoleError(data) {
console.error.apply(console, data);
log.apply(null, data);
}];
// If there's no console available, console_error in the
// action handler will do nothing.
if ('console' in globalScope) {
ah['console_error'] = [function ahConsoleError(data) {
globalScope['console'].error.apply(null, data);
}];
} else {
ah['console_error'] = [function ahConsoleError(data) {
}];
}
ah['_warn'] = [function ah_Warn(data) {
warn(data);
}];
@ -234,7 +241,7 @@ var WorkerMessageHandler = {
return;
}
console.log('page=%d - getOperatorList: time=%dms, len=%d', pageNum,
log('page=%d - getOperatorList: time=%dms, len=%d', pageNum,
Date.now() - start, operatorList.fnArray.length);
// Filter the dependecies for fonts.
@ -266,7 +273,7 @@ var WorkerMessageHandler = {
promise.reject(e);
}
console.log('text indexing: page=%d - time=%dms',
log('text indexing: page=%d - time=%dms',
pageNum, Date.now() - start);
});
}
@ -277,7 +284,7 @@ var consoleTimer = {};
var workerConsole = {
log: function log() {
var args = Array.prototype.slice.call(arguments);
postMessage({
globalScope.postMessage({
action: 'console_log',
data: args
});
@ -285,7 +292,7 @@ var workerConsole = {
error: function error() {
var args = Array.prototype.slice.call(arguments);
postMessage({
globalScope.postMessage({
action: 'console_error',
data: args
});
@ -313,7 +320,7 @@ if (typeof window === 'undefined') {
// throw an exception which will be forwarded on automatically.
PDFJS.LogManager.addLogger({
warn: function(msg) {
postMessage({
globalScope.postMessage({
action: '_warn',
data: msg
});