-
Notifications
You must be signed in to change notification settings - Fork 31
remove after dependency #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
return this._initialPageSkipped = true; | ||
} | ||
|
||
return page.apply(this, arguments); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a need to store initialPageSkipped
on the instance? It could be simplified to:
var page = this.page;
var initialPageSkipped = false;
this.page = function() {
if (this._assumesPageview && !initialPageSkipped) {
return initialPageSkipped = true;
}
return page.apply(this, arguments);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point. fixed!
lib/protos.js
Outdated
if (this._assumesPageview) { | ||
if (this._initialPageSkipped) return page.apply(this, arguments); | ||
|
||
return this._initialPageSkipped = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similar to my question #123
what do we expect this method to return ? It's a bit confusing reading that line, because it appears that we're returning a boolean, but that doesn't appear to be the intention. If the method return null, it might be clearer if we just used two lines, one to set the var, the other to explicitly return.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥
For https://segment.atlassian.net/browse/LIB-1430
This PR removes the dependency on "after" which violated customer CSP with a new Function() call.