File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
packages/bootstrap-vue-3/src Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ declare var MozMutationObserver: any
3
3
4
4
export const HAS_WINDOW_SUPPORT = typeof window !== 'undefined'
5
5
export const HAS_DOCUMENT_SUPPORT = typeof document !== 'undefined'
6
+ export const HAS_ELEMENT_SUPPORT = typeof Element !== 'undefined'
6
7
export const HAS_NAVIGATOR_SUPPORT = typeof navigator !== 'undefined'
7
8
export const HAS_PROMISE_SUPPORT = typeof Promise !== 'undefined'
8
9
Original file line number Diff line number Diff line change 1
1
import { Comment , Slot , VNode } from 'vue'
2
- import { DOCUMENT } from '../constants/env'
2
+ import { DOCUMENT , HAS_ELEMENT_SUPPORT } from '../constants/env'
3
3
import { AnimationFrame } from '../types/safeTypes'
4
4
import { HAS_WINDOW_SUPPORT } from './env'
5
5
import { toString } from './stringUtils'
6
6
7
- const ELEMENT_PROTO = Element . prototype
7
+ const ELEMENT_PROTO = HAS_ELEMENT_SUPPORT ? Element . prototype : undefined
8
8
9
9
// See: https://developer.mozilla.org/en-US/docs/Web/API/Element/matches#Polyfill
10
10
/* istanbul ignore next */
11
11
export const matchesEl =
12
- ELEMENT_PROTO . matches ||
13
- ( ELEMENT_PROTO as any ) . msMatchesSelector ||
14
- ELEMENT_PROTO . webkitMatchesSelector
12
+ ELEMENT_PROTO ? .matches ||
13
+ ( ELEMENT_PROTO as any ) ? .msMatchesSelector ||
14
+ ELEMENT_PROTO ? .webkitMatchesSelector
15
15
16
16
/**
17
17
* @param el
@@ -215,7 +215,7 @@ export const matches = (el: Element, selector: string) =>
215
215
// See: https://developer.mozilla.org/en-US/docs/Web/API/Element/closest
216
216
/* istanbul ignore next */
217
217
export const closestEl =
218
- ELEMENT_PROTO . closest ||
218
+ ELEMENT_PROTO ? .closest ||
219
219
function ( this : Element , sel : string ) {
220
220
let el = this
221
221
if ( ! el ) return null
You can’t perform that action at this time.
0 commit comments