Skip to content

Commit d2cf1de

Browse files
committed
emitter cleanup
1 parent d5a0830 commit d2cf1de

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/compiler.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,12 +321,11 @@ CompilerProto.setupObserver = function () {
321321
var compiler = this,
322322
bindings = compiler.bindings,
323323
options = compiler.options,
324-
observer = compiler.observer = new Emitter()
324+
observer = compiler.observer = new Emitter(compiler.vm)
325325

326326
// a hash to hold event proxies for each root level key
327327
// so they can be referenced and removed later
328328
observer.proxies = {}
329-
observer._ctx = compiler.vm
330329

331330
// add own listeners which trigger binding updates
332331
observer

src/emitter.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ EmitterProto.on = function(event, fn){
1111
return this
1212
}
1313

14-
Emitter.prototype.once = function(event, fn){
14+
EmitterProto.once = function(event, fn){
1515
var self = this
1616
this._cbs = this._cbs || {}
1717

@@ -25,7 +25,7 @@ Emitter.prototype.once = function(event, fn){
2525
return this
2626
}
2727

28-
Emitter.prototype.off = function(event, fn){
28+
EmitterProto.off = function(event, fn){
2929
this._cbs = this._cbs || {}
3030

3131
// all
@@ -56,7 +56,7 @@ Emitter.prototype.off = function(event, fn){
5656
return this
5757
}
5858

59-
Emitter.prototype.emit = function(event, a, b, c){
59+
EmitterProto.emit = function(event, a, b, c){
6060
this._cbs = this._cbs || {}
6161
var callbacks = this._cbs[event]
6262

0 commit comments

Comments
 (0)