File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ function Compiler (vm, options) {
6666 // set inenumerable VM properties
6767 def ( vm , '$' , makeHash ( ) )
6868 def ( vm , '$el' , el )
69+ def ( vm , '$options' , options )
6970 def ( vm , '$compiler' , compiler )
7071
7172 // set parent VM
@@ -252,7 +253,7 @@ CompilerProto.setupObserver = function () {
252253
253254 function registerHook ( hook , fn ) {
254255 observer . on ( 'hook:' + hook , function ( ) {
255- fn . call ( compiler . vm , options )
256+ fn . call ( compiler . vm )
256257 } )
257258 }
258259
Original file line number Diff line number Diff line change @@ -851,8 +851,8 @@ describe('UNIT: API', function () {
851851 it ( 'should be called before compile' , function ( ) {
852852
853853 var called = false ,
854- Test = Vue . extend ( { created : function ( options ) {
855- assert . ok ( options . ok )
854+ Test = Vue . extend ( { created : function ( ) {
855+ assert . ok ( this . $ options. ok )
856856 called = true
857857 } } )
858858 new Test ( { ok : true } )
@@ -864,10 +864,10 @@ describe('UNIT: API', function () {
864864
865865 describe ( 'ready' , function ( ) {
866866
867- it ( 'should be called after compile with options ' , function ( ) {
867+ it ( 'should be called after compile' , function ( ) {
868868 var called = false ,
869- hook = function ( options ) {
870- assert . ok ( options . ok )
869+ hook = function ( ) {
870+ assert . ok ( this . $ options. ok )
871871 assert . notOk ( this . $compiler . init )
872872 called = true
873873 } ,
You can’t perform that action at this time.
0 commit comments