File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- var basicSelectors = {
2- 'body' : document . body ,
3- 'window' : window ,
4- 'document' : document
5- } ;
1+ var basicSelectors ;
2+ if ( typeof document !== 'undefined' ) {
3+ baseSelectors . body = document . body ;
4+ baseSelectors . window = window ;
5+ baseSelectors . document = document ;
6+ }
67
78var matchesMethodName = ( ( ) => {
8- const body = document . body ;
9- return typeof ( body . matches ) === 'function' ? 'matches' :
10- typeof ( body . webkitMatchesSelector ) === 'function' ? 'webkitMatchesSelector' : //webkit
11- typeof ( body . mozMatchesSelector ) === 'function' ? 'mozMatchesSelector' : //mozilla
12- typeof ( body . msMatchesSelector ) === 'function' ? 'msMatchesSelector' : //ie
13- typeof ( body . oMatchesSelector ) === 'function' ? 'oMatchesSelector' : //old opera
14- null
9+ if ( typeof document !== 'undefined' ) {
10+ const body = document . body ;
11+ return typeof ( body . matches ) === 'function' ? 'matches' :
12+ typeof ( body . webkitMatchesSelector ) === 'function' ? 'webkitMatchesSelector' : //webkit
13+ typeof ( body . mozMatchesSelector ) === 'function' ? 'mozMatchesSelector' : //mozilla
14+ typeof ( body . msMatchesSelector ) === 'function' ? 'msMatchesSelector' : //ie
15+ typeof ( body . oMatchesSelector ) === 'function' ? 'oMatchesSelector' : //old opera
16+ null
17+ }
1518} ) ( ) ;
1619
1720export default function find ( selector , el ) {
You can’t perform that action at this time.
0 commit comments