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

jQuery: the quest for JSDoc completeness continues... #1471

Merged
merged 8 commits into from Dec 26, 2013

Conversation

Projects
None yet
2 participants
@johnnyreilly
Copy link
Member

johnnyreilly commented Dec 24, 2013

Now the rip-roaring excitement of addClass / removeClass / toggleClass and serialize / serializeArray and friends.

Merry Christmas!

@basarat

This comment has been minimized.

Copy link
Member

basarat commented Dec 25, 2013

Thanks @johnnyreilly don't know why the tests are failing. Would appreciate if you could check? As always please leave a comment to notify :)

Tests started to fail with this commit : johnnyreilly@3649e33 tests: https://travis-ci.org/borisyankov/DefinitelyTyped/builds/15926359

@johnnyreilly

This comment has been minimized.

Copy link
Member

johnnyreilly commented Dec 25, 2013

Hi @basarat,

I've fixed the problem by switching XMLHttpRequest: XMLHttpRequest to XMLHttpRequest: any. The test on this page http://api.jquery.com/ajaxComplete/ references responseHTML on XMLHttpRequest. However, digging around I can't find any mention of responseHTML on XMLHttpRequest. For instance:

https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest

and

http://www.w3.org/TR/XMLHttpRequest1/#xmlhttprequest

There's these which are close:

readonly attribute DOMString responseText;
readonly attribute Document responseXML;

But no responseHTML. So I think the test is actually invalid and the jQuery documentation is incorrect. I could make a better test which respected the XMLHttpRequest object as defined by standards or we could leave this as any for now. What do you think?

@basarat

This comment has been minimized.

Copy link
Member

basarat commented Dec 26, 2013

I could make a better test which respected the XMLHttpRequest object as defined by standards

You are right. The test is incorrect. Awesome catch! Verified from source as well : https://github.com/jquery/jquery/blob/master/src/ajax/xhr.js?source=cc

jQuery: now with valid ajaxComplete test
Also with corrected jquerymobile attr test
@johnnyreilly

This comment has been minimized.

Copy link
Member

johnnyreilly commented Dec 26, 2013

No worries - my first thought was that this was a bug in the lib.d.ts definition of XMLHttpRequest. I was very surprised it was actually a mistake in the jQuery API documentation!

I've made a more valid test and I've also fixed an invalid attr related test in the jquerymobile test pack that was causing a failure.

@basarat

This comment has been minimized.

Copy link
Member

basarat commented Dec 26, 2013

@johnnyreilly Thanks!

basarat added a commit that referenced this pull request Dec 26, 2013

Merge pull request #1471 from johnnyreilly/master
jQuery: the quest for JSDoc completeness continues...

@basarat basarat merged commit a97cb15 into DefinitelyTyped:master Dec 26, 2013

1 check passed

default The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment