Reserved words

J

jeff

/*

I accidentally discovered that doing this:

var class="X";

Crashes Safari javascript.

So, is there a list of reserved words in javascript, and is there a
javascript error console in Safari? Finding that took entirely to long...

*/
 
T

Thomas 'PointedEars' Lahn

jeff said:

What is the point of this? You don't expect the code in the posting to be
executed somehow, do you?
I accidentally discovered that doing this:

var class="X";

Crashes Safari javascript.

If by "crashes" you mean that this code does not compile because of a syntax
error, then it works as designed: `class' has been a future reserved word
since at least ECMAScript Edition 3. If it actually crashes the browser,
though, then that would be is a very serious bug in that Safari version.
So, is there a list of reserved words in javascript,

No, because, despite loud oversimplifying claims to the contrary, there is
no "javascript".¹

However, the ECMAScript (ES) Language Specification, the standard which
Netscape/Mozilla.org _JavaScript_ and other implementations, including Apple
JavaScriptCore, are based on, defines several keywords and future reserved
words.

Implementations may also define their own reserved words to complement the
specified ones (e.g. `yield' in JavaScript 1.7+, now also mentioned in ES5).
You find them documented at the respective Web site (for example, at the
MSDN Library for Microsoft JScript).
and is there a javascript error console in Safari?

For fitting values of "javascript", yes.
Finding that took entirely to long...

I doubt you have searched for it.

______
¹ <http://PointedEars.de/es-matrix>
 
T

Thomas 'PointedEars' Lahn

jeff said:

While they are somewhat correct about `class' (it is a _future_ reserved
word), you would be well-advised not to use that resource anymore. For
example, `Array' is definitely _not_ a keyword, and Anchor, Area, Button and
other such host objects are no longer part of the JavaScript language (mind
you, that's only one implementation of many) since more than a decade, if
ever.
Which makes more sense... since there is no class exactly in javascript.

There is not in the "javascript" that *you* know. If we foolishly accept
"javascript" as an umbrella term for ECMAScript implementations, then there
are implementations of abandoned Netscape work on ECMAScript Edition 4 that
do support class-based inheritance; most notably, Microsoft JScript .NET
(currently, 7.x, 8.x, and 10.x) and Adobe ActionScript 2.0 and later.

Will you please stop that nonsense?


PointedEars
 
J

John G Harris

there
are implementations of abandoned Netscape work on ECMAScript Edition 4 that
do support class-based inheritance;

ECMAScript Edition 3 is Turing complete and so supports class-based
inheritance. The difference is that all the work has to be done by the
programmer. There is no help from the compiler/translator.

What the proposed Edition 4 did was to include class *definitions* which
the compiler has to understand. Class definitions include inheritance
details of course.

John
 
D

Dr J R Stockton

Fri said:
On 5/13/2011 1:05 PM, jeff wrote:

It's an ECMAScipt Reserved Words: http://www.quackit.com/javascript/jav
ascript_reserved_words.cfm


Don't worry about the Hun; he just wants to show off, rather than to be
helpful.

You should have looked in the ECMA or ISO standard for JavaScript.
"External Links" at <http://en.wikipedia.org/wiki/ECMAScript> should
take you there, and so should the newsgroup FAQ.

Standards are very good at answering that sort of question : in this
case, just search for "reserved word". Or Google for 'JavaScript
"reserved words"'.
 
T

Thomas 'PointedEars' Lahn

John said:
ECMAScript Edition 3 is Turing complete and so supports class-based
inheritance.

Not in the usual sense, as you well know. But however pointless it was
bound to be, you just needed to say anything, didn't you?
The difference is that all the work has to be done by the
programmer. There is no help from the compiler/translator.

IOW, there is no built-in support there, and some classical patterns simply
cannot be emulated in all implementations. Thanks for your attention.
[snip irrelevance]


PointedEars
 
T

Thomas 'PointedEars' Lahn

Dr said:
Don't worry about the Hun; he just wants to show off, rather than to be
helpful.

Better to show that and why something is terribly wrong than spouting mostly
nonsense and showing off one's anti-social, xenophobic attitude at every
occasion like you.
You should have looked in the ECMA or ISO standard for JavaScript.

There is no such thing. ECMAScript is not the standard for JavaScript;
JavaScript is an implementation of ECMAScript (one of many), which is an
entirely different concept.
"External Links" at <http://en.wikipedia.org/wiki/ECMAScript> should
take you there,

If you think so, you are invited to use the wiki feature of Wikipedia
instead of complaining about it here.
and so should the newsgroup FAQ.
ACK

Standards are very good at answering that sort of question : in this
case, just search for "reserved word".

There's one gem in the mud.
Or Google for 'JavaScript "reserved words"'.

Most certainly they already did, which led to the aforementioned wannabe
site. Obviously you are not terribly good at giving advice either.


PointedEars
 
B

beegee

Don't worry about the Hun; he just wants to show off, rather than to be
helpful.


I love this group. The guy who signs on as 'Dr' accuses the guy who
signs on with a reference to Mr. Spock of showing off. Rich.

I use Actionscript 3.0 and it actually uses the reserved word
'class' (as Thomas pointed out). It's kind of weird coming from a
javascript background. I'm sure it makes classical OOP programmers
feel right at home but it always feels like a sham to me, unnecessary
and more trouble than it's worth, same with syntactic 'types' in
Actionscript.

bg
 

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,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top