diff --git a/resolver/resolver-test.js b/resolver/resolver-test.js index 6b049fa..d2a6692 100644 --- a/resolver/resolver-test.js +++ b/resolver/resolver-test.js @@ -48,7 +48,7 @@ QUnit.test("timer with teardown", function(){ CALLS = []; }); - +var queues = require("can-queues"); QUnit.test('basics listenTo', 14, function(assert){ var number = new SimpleObservable(1); @@ -56,7 +56,7 @@ QUnit.test('basics listenTo', 14, function(assert){ property: 1 }); - var obs = new ResolverObservable(function(value){ + var obs = new ResolverObservable(function testee(value){ QUnit.equal( value.resolve(6), 6, "resolve returns passed value"); @@ -79,7 +79,7 @@ QUnit.test('basics listenTo', 14, function(assert){ assert.equal(obs.get(), 6, "got unbound value"); listenHandlers = obs.binder[ canSymbol.for("can.meta") ].listenHandlers; QUnit.equal(listenHandlers.size(), 1, "1 handlers after bind"); - + queues.log("flush"); number.set(2); assert.equal(obs.get(), 5, "got updated value"); diff --git a/resolver/resolver.js b/resolver/resolver.js index 4614b8b..1ab263e 100644 --- a/resolver/resolver.js +++ b/resolver/resolver.js @@ -75,6 +75,19 @@ canReflect.assignMap(ResolverObservable.prototype, { } var resolverInstance = this; + + //!steal-remove-start + if(!handler.name) { + Object.defineProperty(handler, "name", { + value: + (bindTarget ? + canReflect.getName(bindTarget) : "")+ + (event ? ".on('"+event+"',handler)" : ".on(handler)")+ + "::"+canReflect.getName(this) + }); + } + //!steal-remove-end + var contextHandler = handler.bind(this.context); contextHandler[getChangesSymbol] = function getChangesDependencyRecord() { return {