Skip to content
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

Merged
merged 1 commit into from Nov 15, 2016
Merged

refactor(http): remove all facade methods from http module #12870

merged 1 commit into from Nov 15, 2016

Conversation

alfaproject
Copy link
Contributor

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x")

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[x] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

Does this PR introduce a breaking change? (check one with "x")

[ ] Yes
[x] No

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')();
Copy link
Contributor Author

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') {
Copy link
Contributor

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 ) {

Copy link
Contributor Author

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. (;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right :)

@vicb vicb added comp: http refactoring Issue that involves refactoring or code-cleanup labels Nov 14, 2016
return newOptions.merge(new RequestOptions({url: url}));
}

return newOptions.merge(new RequestOptions({method: method, url: url}));
Copy link
Contributor

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 = {}) {
Copy link
Contributor

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 || {});

Copy link
Contributor Author

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, nv

@vicb vicb added the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Nov 14, 2016
@vicb
Copy link
Contributor

vicb commented Nov 14, 2016

Thanks for the PR !

@vicb vicb added action: merge The PR is ready for merge by the caretaker pr_state: LGTM and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Nov 14, 2016
@vicb vicb merged commit 13ba2f9 into angular:master Nov 15, 2016
alexeagle pushed a commit to alexeagle/angular that referenced this pull request Nov 17, 2016
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes refactoring Issue that involves refactoring or code-cleanup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants