Was I clear enough? Probably not. Let me try to clarify.
I am saying that even if one puts debug code in here :
// $ ( defined as: )
function(selector, context) {
/*
here insert all the debugging, testing and teaching
measures you can think of
*/
// The jQuery object is actually just the init
constructor'enhanced'
return new jQuery.fn.init(selector, context);
}
Even in this limited scope this debug version will be very usefull.
no plugins or anything "awesome".
Also, I preffer to call my jQ development version "SAFE&SLOW". I have
noticed that this title brings the message home much quicker ;o)
-- DBJ
On May 20, 11:21 am, DBJDBJ <[email protected]> wrote:
> It would be quite nice if. $ ( defined as: )
>
> function(selector, context) {
> // The jQuery object is actually just the init
> constructor
> 'enhanced'
> return new jQuery.fn.init(selector, context);
> }
>
> if the above will have a few sanity checks so that one can do this :
>
> try {
> jq = $("...", "......") ;} catch ( x )
>
> {
> // x.number === jQuery.error_code
> // x. message == "jQuery error message"
>
> }
>
> This would remove 90% of issues and will explain to a lot of people a
> lot about jQuery ...
>
> PS: of course to even start jQuery in the presence of serious abuses
> like Object.prototype extensions one is always welcomed to start
> fromhttp://dbj.org/jquery.1.3.2.safe.slow.js ....
>
> -- DBJ
>
> On May 19, 2:13 pm, Julian Aubourg <[email protected]> wrote:
>
> > Oh yes, I understood, I was just answering to the last statement you made in
> > your previous post about logging rather than throwing exceptions :)
>
> > 2009/5/19 David Zhou <[email protected]>
>
> > > Well, there's no reason not to throw exceptions too. The point was a
> > > script that monkeypatched jQuery to allow for some of the debugging
> > > features being discussed.
>
> > > -- dz
>
> > > On Tue, May 19, 2009 at 9:00 AM, Julian Aubourg
> > > <[email protected]> wrote:
> > > > I dunno.
> > > > From what I witnessed, when jQuery starts to complain/halt, the problem
> > > is
> > > > generally elsewhere, especially when you keep references to nodes/select
> > > > results like I personnaly do. Exceptions would be nice imo, so that you
> > > get
> > > > the callstack. Logs are good as long as all of the application being
> > > > developped is heavily "consoled" or else you won't know anything about
> > > the
> > > > context of the problem.
> > > > Of course, I'm talking from the point of view of someone who develops
> > > sites
> > > > that are ultra-heavy in the js department.
>
> > > > 2009/5/19 David Zhou <[email protected]>
>
> > > >> 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.
>
> > > >> -- dz
>
> > > >> On Tue, May 19, 2009 at 8:38 AM, Julian Aubourg
> > > >> <[email protected]> wrote:
> > > >> > jquery.debug.js / jquery.release.js ? ;)
> > > >> > I really like this idea. When I first started using jQuery, I
> > > sometimes
> > > >> > had
> > > >> > some issues determining what it was I was doing wrong when jQuery
> > > >> > complained
> > > >> > deep in its internal functions.
>
> > > >> > 2009/5/19 Matt Kruse <[email protected]>
>
> > > >> >> On May 19, 5:32 am, DBJDBJ <[email protected]> wrote:
> > > >> >> > This is an discussion on library develeopment philosophy.
> > > >> >> > There are only two sides to this coin: fast and dangerous and safe
> > > >> >> > and
> > > >> >> > slow.
>
> > > >> >> I think this is another use for a jQuery "development" build. One
> > > that
> > > >> >> would generate warnings of empty selector results, invalid
> > > >> >> arguments,
> > > >> >> etc. It could also detect possible conflicts like this that would
> > > >> >> cause jQuery to misbehave and alert the developer.
>
> > > >> >> Once development is done, you swap in the "production" version of
> > > >> >> jQuery and avoid the penalty his that comes with all the debug
> > > >> >> stuff.
>
> > > >> >> Matt Kruse- Hide quoted text -
>
> > - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---