First, the basic JavaScript development environment
JavaScript reference and JavaScript APIs:
The JavaScript reference is used to create a library or DLL that contains JavaScript runtime, and then compile into a small "shell" program that connects the library and generates an interactive JavaScript interpreter. can also be used to interpret. js files.
The program does not rely on navigator code.
The generated shell program, which compares browser support to JavaScript, uses the same library or DLL that contains JavaScript runtime, and we call this part of the library or dll the JavaScript API , we actually develop JavaScript applications and work on the JavaScript API, without too much consideration for internal implementations. For a JavaScript API, see the JavaScript API detailed.
Second, JavaScript Engine
JavaScript engine is used to initialize the JavaScript environment, providing an interface for JavaScript interpretation and execution.
Initialization mainly includes:
Memory allocation: Rt=js_init (10000L);
Initialize CX:CX = Js_newcontext (RT, stack_chunk_size);
Initialize globalobj:globalobj = Js_newobject (CX, &globalclass, 0, 0);
Define Standard classes: js_initstandardclasses (CX, globalobj);
Define system functions: Js_definefunctions (CX, Globalobj, g_functions);
Define the Error function: Js_seterrorreporter (cx,js_errorreporter);
Register Other classes:
Registerclasspoint (Cx,globalobj);
Registerclasssize (Cx,globalobj);
Registerclassrect (Cx,globalobj);
Registerclasspolygon (Cx,globalobj);
Registerclasscolorkey (Cx,globalobj);
Registerclasstdtimer (Cx,globalobj);
Initialization timer: Tdtimerlistinit ();