Handle XHR response error #137

Merged
BehindTheMath merged 6 commits from feature/handle-response-error into master 2018-03-15 15:12:32 -05:00
3 changed files with 72 additions and 64 deletions
Showing only changes of commit c9e292af6e - Show all commits

View File

@@ -142,6 +142,8 @@ Pjax.prototype = {
doRequest: require("./lib/send-request.js"),
handleResponse: require("./lib/proto/handle-response.js"),
loadUrl: function(href, options) {
options = typeof options === "object" ?
extend({}, this.options, options) :
@@ -155,66 +157,7 @@ Pjax.prototype = {
trigger(document, "pjax:send", options)
// Do the request
this.request = this.doRequest(href, options, function(html, request) {
// Fail if unable to load HTML via AJAX
if (html === false) {
trigger(document, "pjax:complete pjax:error", options)
return
}
// push scroll position to history
var currentState = window.history.state || {}
window.history.replaceState({
url: currentState.url || window.location.href,
title: currentState.title || document.title,
uid: currentState.uid || newUid(),
scrollPos: [document.documentElement.scrollLeft || document.body.scrollLeft,
document.documentElement.scrollTop || document.body.scrollTop]
},
document.title, window.location)
var oldHref = href
if (request.responseURL) {
if (href !== request.responseURL) {
href = request.responseURL
}
}
else if (request.getResponseHeader("X-PJAX-URL")) {
href = request.getResponseHeader("X-PJAX-URL")
}
else if (request.getResponseHeader("X-XHR-Redirected-To")) {
href = request.getResponseHeader("X-XHR-Redirected-To")
}
// Add back the hash if it was removed
var a = document.createElement("a")
a.href = oldHref
var oldHash = a.hash
a.href = href
if (oldHash && !a.hash) {
a.hash = oldHash
href = a.href
}
this.state.href = href
this.state.options = clone(options)
try {
this.loadContent(html, options)
}
catch (e) {
if (!this.options.debug) {
if (console && console.error) {
console.error("Pjax switch fail: ", e)
}
return this.latestChance(href)
}
else {
throw e
}
}
}.bind(this))
this.request = this.doRequest(href, options, this.handleResponse.bind(this))
},
afterAllSwitches: function() {

View File

@@ -0,0 +1,65 @@
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
var clone = require("./lib/clone.js")
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
var newUid = require("./lib/uniqueid.js")
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
var trigger = require("./lib/events/trigger.js")
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
module.export = function(responseText, request, href) {
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
// Fail if unable to load HTML via AJAX
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
if (responseText === false) {
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
trigger(document, "pjax:complete pjax:error", this.options)
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
return
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
}
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
// push scroll position to history
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
var currentState = window.history.state || {}
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
window.history.replaceState({
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
url: currentState.url || window.location.href,
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
title: currentState.title || document.title,
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
uid: currentState.uid || newUid(),
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
scrollPos: [document.documentElement.scrollLeft || document.body.scrollLeft,
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
document.documentElement.scrollTop || document.body.scrollTop]
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
},
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
document.title, window.location)
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
// Check for redirects
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
var oldHref = href
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
if (request.responseURL) {
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
if (href !== request.responseURL) {
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
href = request.responseURL
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
}
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
}
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
else if (request.getResponseHeader("X-PJAX-URL")) {
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
href = request.getResponseHeader("X-PJAX-URL")
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
}
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
else if (request.getResponseHeader("X-XHR-Redirected-To")) {
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
href = request.getResponseHeader("X-XHR-Redirected-To")
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
}
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
// Add back the hash if it was removed
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
var a = document.createElement("a")
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
a.href = oldHref
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
var oldHash = a.hash
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
a.href = href
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
if (oldHash && !a.hash) {
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
a.hash = oldHash
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
href = a.href
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
}
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
this.state.href = href
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
this.state.options = clone(this.options)
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
try {
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
this.loadContent(responseText, this.options)
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
}
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
catch (e) {
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
if (!this.options.debug) {
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
if (console && console.error) {
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
console.error("Pjax switch fail: ", e)
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
}
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
return this.latestChance(href)
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
}
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
else {
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
throw e
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
}
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
}
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
}
robinnorth commented 2018-03-10 13:01:00 -05:00 (Migrated from github.com)
Review

This needs to be tempOptions = clone(this.options), or you'll mutate the current instance's options

This needs to be `tempOptions = clone(this.options)`, or you'll mutate the current instance's options
robinnorth commented 2018-03-10 13:02:53 -05:00 (Migrated from github.com)
Review

This also needs to clone this.options, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.

This also needs to clone `this.options`, but you could probably just do this once at the top of the method rather than repeating the assignment of the request to your temporary event options.
BehindTheMath commented 2018-03-10 23:18:18 -05:00 (Migrated from github.com)
Review

Good point.

Good point.
BehindTheMath commented 2018-03-10 23:21:19 -05:00 (Migrated from github.com)
Review

Good point.

Good point.

View File

@@ -13,21 +13,21 @@ module.exports = function(location, options, callback) {
request.onreadystatechange = function() {
if (request.readyState === 4) {
if (request.status === 200) {
callback(request.responseText, request)
callback(request.responseText, request, location)
}
else {
callback(null, request)
callback(null, request, location)
}
}
}
request.onerror = function(e) {
console.log(e)
callback(null, request)
callback(null, request, location)
}
request.ontimeout = function() {
callback(null, request)
callback(null, request, location)
}
// Prepare the request payload for forms, if available