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) {
66
66
// set inenumerable VM properties
67
67
def ( vm , '$' , makeHash ( ) )
68
68
def ( vm , '$el' , el )
69
+ def ( vm , '$options' , options )
69
70
def ( vm , '$compiler' , compiler )
70
71
71
72
// set parent VM
@@ -252,7 +253,7 @@ CompilerProto.setupObserver = function () {
252
253
253
254
function registerHook ( hook , fn ) {
254
255
observer . on ( 'hook:' + hook , function ( ) {
255
- fn . call ( compiler . vm , options )
256
+ fn . call ( compiler . vm )
256
257
} )
257
258
}
258
259
Original file line number Diff line number Diff line change @@ -851,8 +851,8 @@ describe('UNIT: API', function () {
851
851
it ( 'should be called before compile' , function ( ) {
852
852
853
853
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 )
856
856
called = true
857
857
} } )
858
858
new Test ( { ok : true } )
@@ -864,10 +864,10 @@ describe('UNIT: API', function () {
864
864
865
865
describe ( 'ready' , function ( ) {
866
866
867
- it ( 'should be called after compile with options ' , function ( ) {
867
+ it ( 'should be called after compile' , function ( ) {
868
868
var called = false ,
869
- hook = function ( options ) {
870
- assert . ok ( options . ok )
869
+ hook = function ( ) {
870
+ assert . ok ( this . $ options. ok )
871
871
assert . notOk ( this . $compiler . init )
872
872
called = true
873
873
} ,
You can’t perform that action at this time.
0 commit comments