Evan You 10 лет назад
Родитель
Сommit
8523968e7d
5 измененных файлов с 6 добавлено и 6 удалено
  1. 1 1
      src/instance/init.js
  2. 0 0
      src/instance/lifecycle.js
  3. 1 1
      src/instance/state.js
  4. 2 2
      src/vue.js
  5. 2 2
      test/unit/specs/instance/init_spec.js

+ 1 - 1
src/instance/init.js

@@ -89,7 +89,7 @@ exports._init = function (options) {
   this._data = {}
 
   // initialize data observation and scope inheritance.
-  this._initScope()
+  this._initState()
 
   // setup event system and option events.
   this._initEvents()

+ 0 - 0
src/instance/compile.js → src/instance/lifecycle.js


+ 1 - 1
src/instance/scope.js → src/instance/state.js

@@ -12,7 +12,7 @@ var Watcher = require('../watcher')
  * - meta properties
  */
 
-exports._initScope = function () {
+exports._initState = function () {
   this._initProps()
   this._initMeta()
   this._initMethods()

+ 2 - 2
src/vue.js

@@ -72,8 +72,8 @@ Object.defineProperty(p, '$data', {
 
 extend(p, require('./instance/init'))
 extend(p, require('./instance/events'))
-extend(p, require('./instance/scope'))
-extend(p, require('./instance/compile'))
+extend(p, require('./instance/state'))
+extend(p, require('./instance/lifecycle'))
 extend(p, require('./instance/misc'))
 
 /**

+ 2 - 2
test/unit/specs/instance/init_spec.js

@@ -8,7 +8,7 @@ describe('Instance Init', function () {
     },
     _initEvents: jasmine.createSpy(),
     _callHook: jasmine.createSpy(),
-    _initScope: jasmine.createSpy(),
+    _initState: jasmine.createSpy(),
     $mount: jasmine.createSpy()
   }
 
@@ -36,7 +36,7 @@ describe('Instance Init', function () {
 
   it('should call other init methods', function () {
     expect(stub._initEvents).toHaveBeenCalled()
-    expect(stub._initScope).toHaveBeenCalled()
+    expect(stub._initState).toHaveBeenCalled()
   })
 
   it('should call created hook', function () {