JavaScript eval Execution Process

Source: Internet
Author: User

When Eval is performed, the following procedure is performed for eval (x):

1. If the type of x is not a string, it will return x;

2. Convert x to ECMAScript code. If the conversion fails, blame throws the SyntaxError exception.

3. Create a new execution context for the converted code and deposit the EVALCTX;

4. Execute the converted code and save the results to result;

5. Exit Evalctx execution context, and reply to the execution environment of the previous step.

6. If Result.type is normal, if his return value is non-null, then the eval will return v;

7 If Result.type is normal, if his return value is empty, then the undefined will be returned;

8. Otherwise, you must throw an exception for Result.type

JavaScript eval Execution Process

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.