removes expandUrl(url); fixes error message

This commit is contained in:
Yury Delendik 2012-07-19 16:10:26 -05:00
parent f199a8b19e
commit 7a0e91af4b
3 changed files with 4 additions and 11 deletions

View File

@ -572,7 +572,7 @@ var WorkerTransport = (function WorkerTransportClosure() {
}, this);
messageHandler.on('DocError', function transportDocError(data) {
this.workerReadyPromise.reject(data.message);
this.workerReadyPromise.reject(data);
}, this);
messageHandler.on('PageError', function transportError(data) {

View File

@ -86,10 +86,6 @@ function exceptionToString(e) {
return e.message + ('stack' in e ? ' at ' + e.stack.split('\n')[0] : '');
}
function expandUrl(url) {
return combineUrl(window.location.href, url);
}
function nextTask() {
cleanup();
@ -102,7 +98,8 @@ function nextTask() {
log('Loading file "' + task.file + '"\n');
getPdf(expandUrl(task.file), function nextTaskGetPdf(data) {
var absoluteUrl = combineUrl(window.location.href, task.file);
getPdf(absoluteUrl, function nextTaskGetPdf(data) {
var failure;
function continuation() {
task.pageNum = task.firstPage || 1;

View File

@ -33,10 +33,6 @@ function getFileName(url) {
return url.substring(url.lastIndexOf('/', end) + 1, end);
}
function expandUrl(url) {
return PDFJS.combineUrl(window.location.href, url);
}
var Cache = function cacheCache(size) {
var data = [];
this.push = function cachePush(view) {
@ -388,7 +384,7 @@ var PDFView = {
if (typeof url === 'string') { // URL
this.url = url;
document.title = decodeURIComponent(getFileName(url)) || url;
parameters.url = expandUrl(url);
parameters.url = PDFJS.combineUrl(window.location.href, url);
} else if (url && 'byteLength' in url) { // ArrayBuffer
parameters.data = url;
}