Re: browsers & standards
- From: Dr John Stockton <jrs@xxxxxxxxxxxxxxxxxx>
- Date: Wed, 9 Nov 2005 16:07:10 +0000
JRS: In article <dkqhuq02pk8@xxxxxxxxxxxxxxxxx>, dated Tue, 8 Nov 2005
09:58:14, seen in news:comp.lang.javascript, Matt Kruse
<newsgroups@xxxxxxxxxxxxx> posted :
>Dr John Stockton wrote:
>> One may not be able to do object/feature detection.
>> ...
>> <FAQENTRY> to enable sound feature detection on toFixed, ISTM that the
>> FAQ should indicate a test value that can be used to prove toFixed to
>> be good, or at least to have no known error. 0.77.toFixed(0) may be
>> such a test, or a part thereof.
>
>I think most people understand that feature detection can only decide if
>features are available. There is, of course, no way to determine if a
>feature behaves according to standards or expectations.
There is *no* reasonable way to tell reliably whether a feature works as
expected under *all* circumstances. And that applies to *all* features
(remember how Easter Eggs are often invoked).
An anti-French browser writer could, for example, impose a limit on the
number of cedillas on a page. Or 4195835/3145727 might give
1.333739068902037589.
However, where it is known that a particular "error" occurs, and that
error affects more than just rendering, it can easily be tested for.
AIUI, new Date(1e12).getYear() may return any of 2001, 101, 1 (example
of the last requested). It's perfectly easy to test which it gives, and
to adapt operations accordingly (though there are better solutions in
that case).
I think that OK = !!+(0.77.toFixed(0)) is a sound test for the
goodness of toFixed() - but I cannot confirm that, whereas the FAQ
writer might know or ask to be told, and then we could all know.
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
.
- References:
- Re: browsers & standards
- From: Dr John Stockton
- Re: browsers & standards
- From: Matt Kruse
- Re: browsers & standards
- Prev by Date: Re: Handle dynamic properties of DIVs
- Next by Date: Re: Detect a specific keypress
- Previous by thread: Re: browsers & standards
- Next by thread: Re: browsers & standards
- Index(es):
Relevant Pages
|