Closed GoogleCodeExporter closed 8 years ago
I might create an optional "strict" lib that can be included when debugging
otherwise
I don't want to bloat the code with lots of unnecessary checks on arguments.
Original comment by dean.edw...@gmail.com
on 1 May 2007 at 8:07
Maybe it's more a job for a lint, instead of a strict modus... Like the array
literal [1,2,] will not run in all
browsers...
Original comment by doek...@gmail.com
on 10 Jul 2007 at 9:16
A debug module could include code like this:
extend(EventTarget, {
addEventListener: function(target, type, listener) {
assert(arguments.length >= 3, "Not enough arguments.", SyntaxError);
assert(target && target.nodeType, "Invalid target.", TypeError);
assertType(listener, "function");
return base(this, arguments);
},
dispatchEvent: function(target, event) {
assert(arguments.length >= 2, "Not enough arguments.", SyntaxError);
return base(this, arguments);
},
removeEventListener: function(target, type, listener) {
assert(arguments.length >= 3, "Not enough arguments.", SyntaxError);
assertType(listener, "function");
return base(this, arguments);
}
});
Original comment by dean.edw...@gmail.com
on 12 Jul 2007 at 5:00
Now I get what you mean.
I'll get to it, when I've got time. Let me own this bug.
Original comment by doek...@gmail.com
on 12 Jul 2007 at 5:05
I checked in some code that you can use as a starting point:
http://base2.googlecode.com/svn/trunk/src/base2/DOM/strict/
Original comment by dean.edw...@gmail.com
on 12 Jul 2007 at 8:49
That pretty much fixes this bug ;-)
But now we have an entry-point for these kind of bugs.
Original comment by doek...@gmail.com
on 13 Jul 2007 at 3:12
Ha ha. I just noticed that my examples are wrong as I'm missing the useCapture
parameter. :-)
Original comment by dean.edw...@gmail.com
on 13 Jul 2007 at 3:26
Brilliant
Original comment by doek...@gmail.com
on 13 Jul 2007 at 3:35
I had to change the title of this. It was bugging me. :-P
Original comment by dean.edw...@gmail.com
on 13 Jul 2007 at 5:42
Original comment by doek...@gmail.com
on 14 Jul 2007 at 6:57
Closing bug.
Original comment by doek...@gmail.com
on 14 Jul 2007 at 7:47
Re-opening bug.
assertArity is not a known function. Is probably in your new lang/main1.js?
And shouldn't we put assertTarget in a seperate file (domAssert.js)?
Original comment by doek...@gmail.com
on 21 Jul 2007 at 2:01
assertArity is there now. Closing bug.
Original comment by dean.edw...@gmail.com
on 14 Sep 2007 at 7:23
Original issue reported on code.google.com by
doek...@gmail.com
on 13 Apr 2007 at 8:54Attachments: