chore: simplify variable (#1332)

master
kzhang 2019-06-03 16:04:01 +08:00 committed by Yiyu He
parent 132c9ee63f
commit 23f7f545ab
1 changed files with 1 additions and 3 deletions

View File

@ -287,11 +287,9 @@ module.exports = {
get URL() {
/* istanbul ignore else */
if (!this.memoizedURL) {
const protocol = this.protocol;
const host = this.host;
const originalUrl = this.originalUrl || ''; // avoid undefined in template string
try {
this.memoizedURL = new URL(`${protocol}://${host}${originalUrl}`);
this.memoizedURL = new URL(`${this.origin}${originalUrl}`);
} catch (err) {
this.memoizedURL = Object.create(null);
}