0

I'm try read source of EventEmitter. I want jump into closure aliasClosure() which is defined in function alias(name)

function alias(name) {
    return function aliasClosure() {
        return this[name].apply(this, arguments);
    };
}

Also:

proto.on = alias('addListener');

I write little script

var ee = new EventEmitter();
function l() {
  console.log('Test');
}

ee.on('foo', l);

ee.emitEvent('foo');

and set breakpoint on line ee.on('foo', l); After F11 in FireBug I'm awaiting jump into return this[name].apply(this, arguments); But I get error message in console:

Resuming debugger: error during debugging loop: TypeError: firstViewRangeElement is null

If I set breakpoint on line return this[name].apply(this, arguments); debugger skip (don't stop) this breakpoing. What I'm doing wrong?

igor_rb
  • 1,821
  • 1
  • 19
  • 34

0 Answers0