8000 fix: check _Vue before accessing (#632) · joshmossas/nativescript-vue@29e7f47 · GitHub
[go: up one dir, main page]

Skip to content

Commit 29e7f47

Browse files
authored
fix: check _Vue before accessing (nativescript-vue#632)
allows calling registerElement from webpack
1 parent 6841583 commit 29e7f47

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

platform/nativescript/util/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ export function setVue(Vue) {
1010
_Vue = Vue
1111
}
1212

13-
export const canBeLeftOpenTag = function (el) {
13+
export const canBeLeftOpenTag = function(el) {
1414
return getViewMeta(el).canBeLeftOpenTag
1515
}
1616

17-
export const isUnaryTag = function (el) {
17+
export const isUnaryTag = function(el) {
1818
return getViewMeta(el).isUnaryTag
1919
}
2020

@@ -74,22 +74,22 @@ export function trace(message) {
7474
return infoTrace()
7575
}
7676

77-
if (!_Vue.config.suppressRenderLogs) {
77+
if (_Vue && !_Vue.config.suppressRenderLogs) {
7878
console.log(
7979
`{NSVue (Vue: ${VUE_VERSION} | NSVue: ${NS_VUE_VERSION})} -> ${message}`
8080
)
8181
}
8282
}
8383

8484
export function before(original, thisArg, wrap) {
85-
return function (...args) {
85+
return function(...args) {
8686
wrap.call(null, ...args)
8787
original.call(thisArg, ...args)
8888
}
8989
}
9090

9191
export function after(original, thisArg, wrap) {
92-
return function (...args) {
92+
return function(...args) {
9393
original.call(thisArg, ...args)
9494
wrap.call(null, ...args)
9595
}

0 commit comments

Comments
 (0)
0