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
refactor(http): remove all facade methods from http module #12870
Conversation
import {global} from '../facade/lang'; | ||
|
||
// Get the global object (https://github.com/tc39/proposal-global) | ||
const global: {[key: string]: any} = typeof this === 'object' ? this : Function('return this')(); |
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.
Can we import the TC39 shim instead?
https://www.npmjs.com/package/system.global
@@ -51,7 +51,7 @@ export abstract class Body { | |||
return ''; | |||
} | |||
|
|||
if (isJsObject(this._body)) { | |||
if (typeof this._body === 'object') { |
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.
if (typeof this._body === 'object' && this._body !== null ) {
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.
null
is already being checked a few lines above. (;
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.
right :)
return newOptions.merge(new RequestOptions({url: url})); | ||
} | ||
|
||
return newOptions.merge(new RequestOptions({method: method, url: url})); |
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.
nit: return newOptions.merge(new RequestOptions({method, url}));
if (!isPresent(argument)) { | ||
argument = {}; | ||
} | ||
dispatchEvent(type: string, argument: any = {}) { |
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.
wouldn't this change the public API ?
cb(argument || {});
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.
This is a spec, so should be good
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.
yep, nv
Thanks for the PR ! |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x")
Does this PR introduce a breaking change? (check one with "x")