Friday, January 25th, 2008
Sexy JavaScript?
How can you not post something called Sexy JavaScript?
JAVASCRIPT:
-
-
// Sexy JavaScript
-
// runs assertNotNull(iframeElement) in IE, otherwise assertNull(iframeElement)
-
// taken from test code for http://yura.thinkweb2.com/scripting/contextMenu/
-
-
testShimExists: function() { with(this) {
-
this[Prototype.Browser.IE ? 'assertNotNull' : 'assertNull'](iframeElement);
-
}},
-





2 rating from 51 votes







i’m definitely no expert in javascript so i was wonddering what assertNotNull is usable for. And apparently, it does not fit in the definition of Agile Development:
http://blogs.pathf.com/agileajax/2007/12/assertnotnullth.html
Nothing is sexier than browser detection in your test suite.
As someone that is not that familiar with Unit Test I don’t see a whole lot of value in that code, or purpose.
henrah read my mind, I don’t see the sexiness.
Oh, I’m confused! Is this a JavaScript code or a Silvia Saint picture?
There is a big difference between sexy and crappy.
@pixeline: Keep in mind that what you linked is an opinion piece that deals with Java, not JavaScript. In this case, testing that the shim exists is sufficient; anything further would be verified by functional tests (does the shim adjust when I move the DHTML layer, etc.).
Dion, are you just scouring Pastie for post ideas now? ;-)
Hhmm.. i don’t have idea with this post. What is this about?
The title is interesting… hm.. hm.. i confuse..
- yuhirocks from hgh