typeof for feature testing host methods

T

Thomas 'PointedEars' Lahn

Peter said:
Peter said:
[...] Thomas 'PointedEars' Lahn [...] wrote:
Peter Michaux wrote:
So do you limit your syntax to the only the syntax valid in the very
first JavaScript enabled browser?
I have said where I draw the line: I won't test for `typeof' anymore because
that would involve evil[tm] eval() at no advantage -- `typeof' is needed for
feature tests. Consequently, I draw the line at what JavaScript 1.1 and
JScript 1.0 introduce, and what ECMAScript Edition 1 specifies.
We now know that your scripts will have syntax and runtime errors in
at least some known browsers
Given the conditions described above, that would be Netscape 2.0.
as you assume some syntax and language and host features (although you may
start testing for all host features).
It would appear that you are unable to make the difference between language
syntax features and features provided by the host environment.

I'm not sure why you would write that. I think I understand the
difference between language syntax, language features and host
features in the context we have been discussing them.

Apparently you do *not* recognize that language syntax can only be maybe
feature-tested with eval() while language features and other features
provided by the host environment do not require this but they require at
least `typeof' in order not to be the least error-prone. You do *not*
recognize that the line that has to be drawn for the former may very well
differ from the line that would be drawn for the latter. And you do *not*
recognize that user agents that support client-side scripting but with a
script engine that does not support the aforementioned language syntax
feature are virtually extinct, not because of their apparent age, but
because of their apparent inadequacy towards today's *no-script* Web
content, computer hardware and software.
You've avoided all of my questions[1] about how you justify your
decisions about which syntax and features to assume even though they
will cause your scripts to throw errors. You criticized me for exactly
this[2]. This is the destination of our long conversation and a very
interesting piece of browser script design. Your avoidance can only
indicate your acknowledgment that you do not have an objectively
superior platform [...]

Believe what you wish. My avoidance of answering your questions exactly as
that would deny your repeated falling victim to the Many Questions Fallacy
indicates nothing but your continued arguing in an irrational way.


EOD

PointedEars
 
P

Peter Michaux

Peter said:
Peter Michaux wrote:
[...] Thomas 'PointedEars' Lahn [...] wrote:
Peter Michaux wrote:
[snip]
I'm not sure why you would write that. I think I understand the
difference between language syntax, language features and host
features in the context we have been discussing them.

Apparently you do *not* recognize that language syntax can only be maybe
feature-tested with eval() while language features and other features
provided by the host environment do not require this but they require at
least `typeof' in order not to be the least error-prone.

I understand that.

You do *not*
recognize that the line that has to be drawn for the former may very well
differ from the line that would be drawn for the latter.

Yes they are different lines.

And you do *not*
recognize that user agents that support client-side scripting but with a
script engine that does not support the aforementioned language syntax
feature are virtually extinct, not because of their apparent age, but
because of their apparent inadequacy towards today's *no-script* Web
content, computer hardware and software.

So you've decided that it is their lack of popularity that makes them
irrelevant and acceptable casualties. I think NN4 and IE4 are
irrelevant for exactly this reason. My choice to use try-catch is
similar to your choice to use typeof. We just have drawn our lines in
slightly different places with neither place being objectively better
than the other.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top