Right, I think this is what Matt and I are getting at. Also, I think it shouldn't be impossible to track jQuery changes. The internals might change, but if we're mostly error checking published API, that should be fairly stable.
-- dz On Tue, May 19, 2009 at 11:02 AM, Andrea Giammarchi <andrea.giammar...@gmail.com> wrote: > rather than another branch with dirty code in the middle, I would prefer a > dedicated jQuery.debug.js as external file able to wrap "everything" and > redefine the library itself. > > in this way you can use always latest jQuery version and add, locally, a > script with jQuery.debug.js file where inside you'll find something like: > > jQuery = $ = (function($){ > function jQuery(){ > if(this instanceof jQuery) > throw new Error("it does not make sense to use new $"); > return $.apply(null, arguments); > }; > jQuery.prototype = $.prototype; > return jQuery; > })($); > > the same could be done for methods, in prototype or static. > > This is worthy if what you need to check are arguments, scopes, other rather > than core code itself ( at least that should be jQuery problem, I mean > errors check ) > > On Tue, May 19, 2009 at 3:23 PM, Matt Kruse <m...@thekrusefamily.com> wrote: >> >> On May 19, 7:51 am, David Zhou <da...@nodnod.net> wrote: >> > I wonder if it's feasible to monkeypatch debugging wrappers around >> > jQuery core methods. You don't even need it to throw errors -- a >> > simple console.log warning would suffice. >> >> Definitely feasible. See something I posted here a while ago: >> >> http://groups.google.com/group/jquery-dev/browse_thread/thread/5360f7b3d67a2ddc >> >> The problem is that jQuery changes fairly frequently (unfortunately) >> and the debug plugin would need to constantly be changed to stay up-to- >> date since it would be so closely tied to the jQuery code. >> >> It would be better to put the debugging into the source itself, then >> use a builder to create a debug version and a release version. >> >> In the absence of that, though, it would be fantastic to have a group >> of people working on a debug plugin. >> >> Matt Kruse >> >> >> > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to jquery-dev@googlegroups.com To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~----------~----~----~----~------~----~------~--~---