On 10/14/2009 06:36 PM, Mike Shaver wrote:
Our implementation of String.prototype.match checks the context in which it's called, to see if it need bother with the expense of constructing the result array (it needn't, if the match call is being used simply as a test, which isn't unheard of on the web). That optimization aged pretty well, and indeed benchmarks often encourage such context-sensitivity.
It aged well because it obeys the fundamental principle of optimization: "Lying is fine as long as you don't get caught." You haven't changed the meaning of the language. document.all is in a different category, because it's observable.
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss