Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
31 lines (22 sloc)
626 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| define( [ | |
| "../core" | |
| ], function( jQuery ) { | |
| "use strict"; | |
| function getAll( context, tag ) { | |
| // Support: IE <=9 - 11 only | |
| // Use typeof to avoid zero-argument method invocation on host objects (#15151) | |
| var ret; | |
| if ( typeof context.getElementsByTagName !== "undefined" ) { | |
| ret = context.getElementsByTagName( tag || "*" ); | |
| } else if ( typeof context.querySelectorAll !== "undefined" ) { | |
| ret = context.querySelectorAll( tag || "*" ); | |
| } else { | |
| ret = []; | |
| } | |
| if ( tag === undefined || tag && jQuery.nodeName( context, tag ) ) { | |
| return jQuery.merge( [ context ], ret ); | |
| } | |
| return ret; | |
| } | |
| return getAll; | |
| } ); |