Reserved words

Discussion in 'Javascript' started by jeff, May 13, 2011.

  1. jeff

    jeff Guest

    /*

    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...

    */
    jeff, May 13, 2011
    #1
    1. Advertising

  2. jeff

    jeff Guest

    On 5/13/2011 1:05 PM, jeff wrote:
    > /*
    >
    > I accidentally discovered that doing this:
    >
    > var class="X";
    >
    > Crashes Safari javascript.
    >
    > So, is there a list of reserved words in javascript,


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

    Which makes more sense... since there is no class exactly in javascript.

    */


    and is there a
    > javascript error console in Safari? Finding that took entirely to long...
    >
    > */
    >
    >
    >
    >
    jeff, May 13, 2011
    #2
    1. Advertising

  3. jeff wrote:

    > /*


    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>
    --
    Danny Goodman's books are out of date and teach practices that are
    positively harmful for cross-browser scripting.
    -- Richard Cornford, cljs, <cife6q$253$1$> (2004)
    Thomas 'PointedEars' Lahn, May 13, 2011
    #3
  4. jeff wrote:

    > On 5/13/2011 1:05 PM, jeff wrote:
    >> /*
    >>
    >> I accidentally discovered that doing this:
    >>
    >> var class="X";
    >>
    >> Crashes Safari javascript.
    >>
    >> So, is there a list of reserved words in javascript,

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


    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
    --
    Use any version of Microsoft Frontpage to create your site.
    (This won't prevent people from viewing your source, but no one
    will want to steal it.)
    -- from <http://www.vortex-webdesign.com/help/hidesource.htm> (404-comp.)
    Thomas 'PointedEars' Lahn, May 13, 2011
    #4
  5. On Fri, 13 May 2011 at 19:58:08, in comp.lang.javascript, Thomas
    'PointedEars' Lahn wrote:

    <snip>
    >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
    --
    John Harris
    John G Harris, May 14, 2011
    #5
  6. In comp.lang.javascript message <iqjqoo$ivm$>, Fri,
    13 May 2011 13:45:30, jeff <> posted:

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


    >> So, is there a list of reserved words in javascript,

    >
    >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"'.

    --
    (c) John Stockton, nr London UK. ?@merlyn.demon.co.uk IE8 FF3 Op10 Sf5 Cr7
    news:comp.lang.javascript FAQ <http://www.jibbering.com/faq/index.html>.
    <http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
    <http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
    Dr J R Stockton, May 14, 2011
    #6
  7. John G Harris wrote:

    > Thomas 'PointedEars' Lahn wrote:
    >> thereare 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.


    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
    --
    realism: HTML 4.01 Strict
    evangelism: XHTML 1.0 Strict
    madness: XHTML 1.1 as application/xhtml+xml
    -- Bjoern Hoehrmann
    Thomas 'PointedEars' Lahn, May 14, 2011
    #7
  8. Dr J R Stockton wrote:

    > jeff <> posted:
    >> On 5/13/2011 1:05 PM, jeff wrote:
    >>> So, is there a list of reserved words in javascript,

    >> 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.


    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
    --
    Danny Goodman's books are out of date and teach practices that are
    positively harmful for cross-browser scripting.
    -- Richard Cornford, cljs, <cife6q$253$1$> (2004)
    Thomas 'PointedEars' Lahn, May 15, 2011
    #8
  9. jeff

    beegee Guest

    On May 14, 4:59 pm, Dr J R Stockton <>
    wrote:

    > 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
    beegee, May 15, 2011
    #9
  10. jeff wrote:
    > /*
    >
    >   I accidentally discovered that doing this:
    >
    >    var class="X";
    >
    > Crashes Safari javascript.
    >
    > So, is there a list of reserved words in javascript
    > */


    Take a look at:
    <URL: http://asenbozhilov.com/es-identifiers.html>
    Asen Bozhilov, May 16, 2011
    #10
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Miel Bronneberg

    reserved words

    Miel Bronneberg, Nov 26, 2004, in forum: XML
    Replies:
    1
    Views:
    523
    Martin Honnen
    Nov 26, 2004
  2. metaperl
    Replies:
    32
    Views:
    887
    NickC
    Sep 15, 2006
  3. Delaney, Timothy (Tim)
    Replies:
    10
    Views:
    656
    Jason
    Sep 14, 2006
  4. Steve Holden
    Replies:
    0
    Views:
    388
    Steve Holden
    Sep 13, 2006
  5. Replies:
    3
    Views:
    149
    osmium
    Nov 6, 2013
Loading...

Share This Page