Показать сообщение отдельно

  #2255  
Старый 19.03.2010, 23:07
astrologer
Постоянный
Регистрация: 30.08.2007
Сообщений: 773
Провел на форуме:
3069349

Репутация: 808


По умолчанию

new - ключевое слово и его нельзя использовать в качестве идентификатора.
Код:
ecma 262-3 # В 262-5 есть некоторые изменения

7.5.1 Reserved Words

  Reserved words cannot be used as identifiers.

  ReservedWord ::
    Keyword
    FutureReservedWord
    NullLiteral
    BooleanLiteral

7.5.2 Keywords

  The following tokens are ECMAScript keywords and may not be used as identifiers
  in ECMAScript programs.

  Keyword :: one of
    break     else        new     var
    case      finally     return  void
    catch     for         switch  while
    continue  function    this    with
    default   if          throw
    delete    in          try
    do        instanceof  typeof
    
7.5.3 Future Reserved Words

  The following words are used as keywords in proposed extensions and are therefore reserved
  to allow for the possibility of future adoption of those extensions.

  FutureReservedWord :: one of
    abstract  enum        int        short
    boolean   export      interface  static
    byte      extends     long       super
    char      final       native     synchronized
    class     float       package    throws
    const     goto        private    transient
    debugger  implements  protected  volatile
    double    import      public
    
7.8.1 Null Literals
    
  NullLiteral ::
    null
  
7.8.2 Boolean Literals

  BooleanLiteral ::
    true
    false
 
Ответить с цитированием