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

jQuery.type error for AsyncFunction #4027

Closed
Zhang-Wei-666 opened this issue Mar 28, 2018 · 4 comments
Closed

jQuery.type error for AsyncFunction #4027

Zhang-Wei-666 opened this issue Mar 28, 2018 · 4 comments

Comments

@Zhang-Wei-666
Copy link

!function(){

var toString = {}.toString,
      asyncFn = async function asyncFn(){/* ... */};

console.log( typeof( asyncFn ) );// function
console.log( jQuery.type( asyncFn ) );// object
console.log( toString.call( asyncFn ) );// [object AsyncFunction]

// class2type[ "[object AsyncFunction]" ] = "function";

}();

@mgol
Copy link
Member

mgol commented Mar 28, 2018

Thanks for the report. However, we've deprecated jQuery.type in 3.3.0 (see #3605) so we don't plan to fix edge cases in its behavior. There's an open API ticket to document that deprecation: jquery/api.jquery.com#1076.

@mgol mgol closed this as completed Mar 28, 2018
@Zhang-Wei-666
Copy link
Author

but ...

$( async function(){
// This callback is not run ...
})

@gibson042
Copy link
Member

Such callbacks have been invoked since version 3.3.0: https://jsfiddle.net/p7k1yzoq/2/

@Zhang-Wei-666
Copy link
Author

@gibson042 O Thanks, i'm wrong, I'm allways use for version 3.1.0

@lock lock bot locked as resolved and limited conversation to collaborators Sep 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants