Saturday 15 March 2014

javascript - What is extended mode? -


I am doing the code in node v0.10.12 with two . Using - Good faith generates syntax errors with the following code:

 For  (me i = 0; i & lt; 2; i + = 1 ) {Console .log ('I', I); }   

SyntaxError: declared declaration outside the extended mode

However, if I use - usage-strict Flag, the code runs as expected.

Why was a syntax error thrown when using the only - good faith flag? What is the Extended Mode? What is the connection with the strict mode?

It seems that "extended mode" was deleted on February 27, 2012 , But in some older people it was believed that this (since January 16, 2012):

10.1.2 extended code

extended code in the ECMAscript program syntax unit Any code contained in which lexical or syntactic defined after the fifth edition of the ECMAScript specification Includes incidents of presentations. The code is defined as the extended code in the following situations:

  • Global code global code is enhanced if it is in an ECMAScript program syntax unit, which is an extended program unit Has been designated as an implementation defined way or if ???

  • The eval code eval code is extended if the eval call calls to eval a direct call (see 15.1.2.1.1) function which is contained in the Extended Mode code or if it Starts at ???

  • Function code which is part of function declaration , function express , or accessor property related Is function declaration , function express , or propertyAssignment is the extended function code in the extended mode code or if the function starts with code ?? ?.

  • The function code that is provided as a built-in function constructor in the form of a final argument, is a strict function code if the last argument is a string, which is FunctionBody starts with ???

    The word "strict code" ??? The term is used to specify the actual hard mode code and extended code, whereas the word "extended code" only specifies the actual extended code. The term "base code" is used to specify the word code that is not extended to the code.

    To relate to strict mode, which is specific to the V8 (experimental) implementation, which introduced the - Harmony flag, it says :

    This cl is non-strict (from now on 'Classic mode') and 'Strict mode' which is called 'extended mode' in the form of current ES. Specific Specification Draft is based on extended mode 'strict mode' and adds new functionality to it. This means that most of the words in both of these methods are matched.

    When using 'strict mode', 'expanded mode' is entered instead of 'strict mode' during parsing 'strict mode' instruction "strict use" and when the harmony-scoping flag is activated. After fully specifying it, it should be changed how 'Extended Mode' is entered.

No comments:

Post a Comment