[mochikit] Re: callLater and IE

2007-08-22 Thread Jonathan Marshall

All ready, however when I try to submit a ticket I am told:
Internal Error: Submission rejected as potential spam (Akismet says
content is spam)

The patch is:

Index: tests/test_Base.js
===
--- tests/test_Base.js  (revision 1312)
+++ tests/test_Base.js  (working copy)
@@ -26,6 +26,9 @@
 t.is( bind(boundFunc, undefined, foo)(), self foo, boundFunc
partial no self change );
 t.is( bind(boundFunc, not_self, foo)(), not self foo,
boundFunc partial self change );

+t.is( typeof(bind(alert).im_func.apply), function, true, bind
alert worked );
+t.is( typeof(bind(window.print).im_func.apply), function, bind
window.print worked );
+
 // test method
 not_self = {toString: function () { return not self; } };
 self = {toString: function () { return self; } };
Index: MochiKit/Base.js
===
--- MochiKit/Base.js(revision 1312)
+++ MochiKit/Base.js(working copy)
@@ -607,7 +607,7 @@
 var im_preargs = func.im_preargs;
 var im_self = func.im_self;
 var m = MochiKit.Base;
-if (typeof(func) == function  typeof(func.apply) ==
undefined) {
+if (typeof(func) == object  typeof(func.apply) ==
undefined) {
 // this is for cases where JavaScript sucks ass and gives
you a
 // really dumb built-in function like alert() that
doesn't have
 // an apply

I'm not 100% happy with the test patch however as it tests internal
behaviour of bind rather than testing binds' interface, however I
don't know how to non-intrusively test that bind will work with alert
 window.print.



On Aug 21, 5:00 pm, Arnar Birgisson [EMAIL PROTECTED] wrote:
 On 8/21/07, Jonathan Marshall [EMAIL PROTECTED] wrote:

  Changing that to:
  if (typeof(func) == object  typeof( func.apply) == undefined) {
  works for me.

 Good. Would you be able to add some tests using your examples and
 submit them as well as the fix as a patch? Then we can test it on the
 various platforms and commit it if everything works.

 Arnar


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
MochiKit group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~--~~~~--~~--~--~---



[mochikit] Deferred.addCallbackMethod

2007-08-22 Thread Giulio Cesare Solaroli

Hello,

using the excellent MochiKit.Async module, I find myself writing the
following code over and over:

dererred.addCallback(MochiKit.Base.method(anObject, 'aMethod'), aParam, ...);

It look like it would be nice to add a 'addCallbackMethod' to the
Deferred class in order to be able to write the above statement like
this:

deferred.addCallbackMethod(anObject, 'aMethod', aParam, );

Does it make any sense?


Giulio Cesare

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
MochiKit group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~--~~~~--~~--~--~---



[mochikit] Re: Deferred.addCallbackMethod

2007-08-22 Thread Bob Ippolito

On 8/22/07, Giulio Cesare Solaroli [EMAIL PROTECTED] wrote:

 Hello,

 using the excellent MochiKit.Async module, I find myself writing the
 following code over and over:

 dererred.addCallback(MochiKit.Base.method(anObject, 'aMethod'), aParam, ...);

 It look like it would be nice to add a 'addCallbackMethod' to the
 Deferred class in order to be able to write the above statement like
 this:

 deferred.addCallbackMethod(anObject, 'aMethod', aParam, );


Well if you're importing MochiKit then you can just say
method(anObject, 'aMethod') instead of MochiKit.Base.method, and then
it's almost just as short as addCallbackMethod. I don't really see a
reason to add more API.

-bob

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
MochiKit group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~--~~~~--~~--~--~---