File tree Expand file tree Collapse file tree 3 files changed +23
-16
lines changed Expand file tree Collapse file tree 3 files changed +23
-16
lines changed Original file line number Diff line number Diff line change 1- import { inBrowser , warn , nextTick } from './util/index'
21import config from './config'
2+ import {
3+ warn ,
4+ nextTick ,
5+ devtools
6+ } from './util/index'
37
48// we have two separate queues: one for directive updates
59// and one for user watcher registered via $watch().
@@ -36,10 +40,8 @@ function flushBatcherQueue () {
3640 runBatcherQueue ( userQueue )
3741 // dev tool hook
3842 /* istanbul ignore if */
39- if ( process . env . NODE_ENV !== 'production' ) {
40- if ( inBrowser && window . __VUE_DEVTOOLS_GLOBAL_HOOK__ ) {
41- window . __VUE_DEVTOOLS_GLOBAL_HOOK__ . emit ( 'flush' )
42- }
43+ if ( devtools ) {
44+ devtools . emit ( 'flush' )
4345 }
4446 resetBatcherState ( )
4547}
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import Vue from './instance/vue'
22import directives from './directives/public/index'
33import elementDirectives from './directives/element/index'
44import filters from './filters/index'
5- import { inBrowser } from './util/index'
5+ import { inBrowser , devtools } from './util/index'
66
77Vue . version = '1.0.15'
88
@@ -28,14 +28,15 @@ Vue.options = {
2828export default Vue
2929
3030// devtools global hook
31- /* istanbul ignore if */
32- if ( process . env . NODE_ENV !== 'production' && inBrowser ) {
33- if ( window . __VUE_DEVTOOLS_GLOBAL_HOOK__ ) {
34- window . __VUE_DEVTOOLS_GLOBAL_HOOK__ . emit ( 'init' , Vue )
35- } else if ( / C h r o m e \/ \d + / . test ( navigator . userAgent ) ) {
36- console . log (
37- 'Download the Vue Devtools for a better development experience:\n' +
38- 'https://github.com/vuejs/vue-devtools'
39- )
40- }
31+ /* istanbul ignore next */
32+ if ( devtools ) {
33+ devtools . emit ( 'init' , Vue )
34+ } else if (
35+ process . env . NODE_ENV !== 'production' &&
36+ inBrowser && / C h r o m e \/ \d + / . test ( navigator . userAgent )
37+ ) {
38+ console . log (
39+ 'Download the Vue Devtools for a better development experience:\n' +
40+ 'https://github.com/vuejs/vue-devtools'
41+ )
4142}
Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ export const inBrowser =
66 typeof window !== 'undefined' &&
77 Object . prototype . toString . call ( window ) !== '[object Object]'
88
9+ export const devtools =
10+ inBrowser &&
11+ window . __VUE_DEVTOOLS_GLOBAL_HOOK__
12+
913export const isIE9 =
1014 inBrowser &&
1115 navigator . userAgent . toLowerCase ( ) . indexOf ( 'msie 9.0' ) > 0
You can’t perform that action at this time.
0 commit comments