X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fevent.js;h=8a9e48b02343e57ddfc5a88a17dd4c8937184cbf;hb=66975de2d249643779e2b3daad0457f7f5f92508;hp=70c721f823d0160631dd329b66d9d535b2bf35ee;hpb=a00e63ea5a2c26f8e6384b5d1e2247be44c727e9;p=jquery.git diff --git a/test/unit/event.js b/test/unit/event.js index 70c721f..8a9e48b 100644 --- a/test/unit/event.js +++ b/test/unit/event.js @@ -232,8 +232,8 @@ test("bind(), with different this object", function() { }; jQuery("#firstp") - .bind("click", handler1, thisObject).click().unbind("click", handler1) - .bind("click", data, handler2, thisObject).click().unbind("click", handler2); + .bind("click", jQuery.proxy(handler1, thisObject)).click().unbind("click", handler1) + .bind("click", data, jQuery.proxy(handler2, thisObject)).click().unbind("click", handler2); ok( !jQuery.data(jQuery("#firstp")[0], "events"), "Event handler unbound when using different this object and data." ); }); @@ -706,15 +706,15 @@ test(".live()/.die()", function() { jQuery("#foo").trigger("click", true).die("click"); // Test binding with different this object - jQuery("#foo").live("click", function(e){ equals( this.foo, "bar", "live with event scope" ); }, { foo: "bar" }); + jQuery("#foo").live("click", jQuery.proxy(function(e){ equals( this.foo, "bar", "live with event scope" ); }, { foo: "bar" })); jQuery("#foo").trigger("click").die("click"); // Test binding with different this object, event data, and trigger data - jQuery("#foo").live("click", true, function(e, data){ + jQuery("#foo").live("click", true, jQuery.proxy(function(e, data){ equals( e.data, true, "live with with different this object, event data, and trigger data" ); equals( this.foo, "bar", "live with with different this object, event data, and trigger data" ); equals( data, true, "live with with different this object, event data, and trigger data") - }, { foo: "bar" }); + }, { foo: "bar" })); jQuery("#foo").trigger("click", true).die("click"); // Verify that return false prevents default action