Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

stop coercing falsy values to null before xhr.send() #11593

Closed
wants to merge 1 commit into from

Conversation

johnhoffman
Copy link
Contributor

This is intended to resolve #11552.

@@ -109,7 +109,12 @@ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDoc
}
}

xhr.send(post || null);
if (post === false) {
Copy link
Member

Choose a reason for hiding this comment

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

Why special-case false only and not all falsy values ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That would be ideal. See #11552. Unfortunately Travis CI E2E tests failed in that case. If this fails, I'll dig deeper since it implies strongly that something is wrong with the tests. This is my first attempt at contributing to angular, so perhaps I don't understand the intended workflow well yet. I've been unable to build/test on my local machine per these instructions: https://docs.angularjs.org/misc/contribute.

Copy link
Member

Choose a reason for hiding this comment

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

@johnhoffman, this build has failed because of a style error: else should be on the same line as the closing }:

// WRONG
}
else {

// RIGHT
} else {

BTW, not all Travis failures means there is a problem with the code (you have to see the details; sometimes it's an unrelated timeout or something similar).
Additionally, you shouldn't create new PRs just to rerun the tests on Travis. Amending the latest commit and force-pushing to your repo, will update the PR and restart the Travis job.

Just so you know for future PRs :)
In any case, this is a legitimate failure, but I still wonder why only allow false ?


I've been unable to build/test on my local machine per these instructions

What was the problem ? You should be able to run the tests and it is always better to have them pass locally first, in order to avoid losing time (Travis takes much longer) and wasting resources.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your guidance, @gkalpak. I was able to fix my npm installation using https://github.com/brock/node-reinstall. I updated the code and new tests to reflect what I believe we should expect. Unit tests passed and E2E may be failing for extraneous reasons as you suggested. I'll update the PR per your instructions.

@gkalpak
Copy link
Member

gkalpak commented Apr 16, 2015

@johnhoffman, could you, please, squash all commits into one and add fix the commit message header and add Closes #11552 at the bottom of the commit message ? (For more info on commit message conventions take a look here).

Other than that it LGTM.

@johnhoffman
Copy link
Contributor Author

Thanks, @gkalpak. Commits are squashed. Does the commit message look good?

@gkalpak
Copy link
Member

gkalpak commented Apr 17, 2015

It LGTM. Thx @johnhoffman !

@caitp
Copy link
Contributor

caitp commented Apr 17, 2015

LGTM

@caitp
Copy link
Contributor

caitp commented Apr 17, 2015

I'm of the opinion that we should also land this into 1.3 --- but lets let it bake for a bit first

@caitp caitp closed this in e04a887 Apr 17, 2015
netman92 pushed a commit to netman92/angular.js that referenced this pull request Aug 8, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

$httpBackend coersion of falsy values to null before xhr.send()
4 participants