I bumped into something this morning that I thought might be worth pointing
out -- mostly because I was surprised to have seemingly-valid ES3 code break
on an ES5 browser without strict mode in play.
One of my developers has a habit of writing tests like
if (!hasOwnProperty(console))
//
[+es5-discuss]
Hi Wes,
In Annex E, Additions and Changes in the 5th Edition that Introduce
Incompatibilities with the 3rd Edition, we list 27 potential compat
problems, including the one you encountered:
In particular, in Edition 5 built-in functions that are specified to
actually use the
What's the point of checking existence of method via such strict test? Why
hasOwnProperty and not much more commonly used typeof console != undefined,
window.console, etc.
Is there even a guarantee of any kind that method in question (e.g. console) is
an own property of window or global
Or am I missing something?
Yes -- programmers do all kinds of crazy and unexpected things. :)
Wes
--
Wesley W. Garland
Director, Product Development
PageMail, Inc.
+1 613 542 2787 x 102
___
es-discuss mailing list
es-discuss@mozilla.org
Le 30/01/2011 16:58, Tom Van Cutsem a écrit :
2011/1/28 David Bruant bru...@enseirb-matmeca.fr
mailto:bru...@enseirb-matmeca.fr
Based on that definition, we could have a stronger definition of
derived traps:
Derived trap are defined as ES code using fundamental traps in
5 matches
Mail list logo