Merge pull request #8544 from Rob--W/compatiblity-safari-strict-error

compatibility.js: Rename parameters in JURL
This commit is contained in:
Yury Delendik 2017-06-19 10:34:33 -05:00 committed by GitHub
commit 679ffc84f6

View File

@ -1713,92 +1713,94 @@ PDFJS.compatibilityChecked = true;
(this._isRelative ? '//' + authority + this.host : '') + (this._isRelative ? '//' + authority + this.host : '') +
this.pathname + this._query + this._fragment; this.pathname + this._query + this._fragment;
}, },
set href(href) { // The named parameter should be different from the setter's function name.
// Otherwise Safari 5 will throw an error (see issue 8541)
set href(value) {
clear.call(this); clear.call(this);
parse.call(this, href); parse.call(this, value);
}, },
get protocol() { get protocol() {
return this._scheme + ':'; return this._scheme + ':';
}, },
set protocol(protocol) { set protocol(value) {
if (this._isInvalid) { if (this._isInvalid) {
return; return;
} }
parse.call(this, protocol + ':', 'scheme start'); parse.call(this, value + ':', 'scheme start');
}, },
get host() { get host() {
return this._isInvalid ? '' : this._port ? return this._isInvalid ? '' : this._port ?
this._host + ':' + this._port : this._host; this._host + ':' + this._port : this._host;
}, },
set host(host) { set host(value) {
if (this._isInvalid || !this._isRelative) { if (this._isInvalid || !this._isRelative) {
return; return;
} }
parse.call(this, host, 'host'); parse.call(this, value, 'host');
}, },
get hostname() { get hostname() {
return this._host; return this._host;
}, },
set hostname(hostname) { set hostname(value) {
if (this._isInvalid || !this._isRelative) { if (this._isInvalid || !this._isRelative) {
return; return;
} }
parse.call(this, hostname, 'hostname'); parse.call(this, value, 'hostname');
}, },
get port() { get port() {
return this._port; return this._port;
}, },
set port(port) { set port(value) {
if (this._isInvalid || !this._isRelative) { if (this._isInvalid || !this._isRelative) {
return; return;
} }
parse.call(this, port, 'port'); parse.call(this, value, 'port');
}, },
get pathname() { get pathname() {
return this._isInvalid ? '' : this._isRelative ? return this._isInvalid ? '' : this._isRelative ?
'/' + this._path.join('/') : this._schemeData; '/' + this._path.join('/') : this._schemeData;
}, },
set pathname(pathname) { set pathname(value) {
if (this._isInvalid || !this._isRelative) { if (this._isInvalid || !this._isRelative) {
return; return;
} }
this._path = []; this._path = [];
parse.call(this, pathname, 'relative path start'); parse.call(this, value, 'relative path start');
}, },
get search() { get search() {
return this._isInvalid || !this._query || this._query === '?' ? return this._isInvalid || !this._query || this._query === '?' ?
'' : this._query; '' : this._query;
}, },
set search(search) { set search(value) {
if (this._isInvalid || !this._isRelative) { if (this._isInvalid || !this._isRelative) {
return; return;
} }
this._query = '?'; this._query = '?';
if (search[0] === '?') { if (value[0] === '?') {
search = search.slice(1); value = value.slice(1);
} }
parse.call(this, search, 'query'); parse.call(this, value, 'query');
}, },
get hash() { get hash() {
return this._isInvalid || !this._fragment || this._fragment === '#' ? return this._isInvalid || !this._fragment || this._fragment === '#' ?
'' : this._fragment; '' : this._fragment;
}, },
set hash(hash) { set hash(value) {
if (this._isInvalid) { if (this._isInvalid) {
return; return;
} }
this._fragment = '#'; this._fragment = '#';
if (hash[0] === '#') { if (value[0] === '#') {
hash = hash.slice(1); value = value.slice(1);
} }
parse.call(this, hash, 'fragment'); parse.call(this, value, 'fragment');
}, },
get origin() { get origin() {