Commit Graph
18 Commits
Author SHA1 Message Date
Tor Andersson 24f48308ce Support 'typeof' operator. 2014-01-18 17:38:40 +01:00
Tor Andersson f8ff865248 Move object creation functions into jsobject.c 2014-01-18 01:22:11 +01:00
Tor Andersson 702fb1eb4a Rename functions that push new objects on the stack. 2014-01-18 01:15:10 +01:00
Tor Andersson 96ca91ec7c Garbage collector lists. 2014-01-17 23:02:14 +01:00
Tor Andersson 81b2bb9ca4 Add constructors called with 'new' keyword.
Support built-in constructors that create their own objects. They get
called without a this object, which they should create and push on the
stack.
2014-01-17 22:03:35 +01:00
Tor Andersson e431170dae Improve stackidx function to return "undefined" for out-of-bounds accesses. 2014-01-17 21:10:54 +01:00
Tor Andersson 0d595bd6cf Define some global functions and values. 2014-01-17 21:09:53 +01:00
Tor Andersson f487a7db10 Set prototype internal property when creating objects. 2014-01-17 19:41:41 +01:00
Tor Andersson 10ffd559de Compile global/eval code as script objects rather than regular functions.
Handle scoping rules ath the js_call level instead of having to use
separate functions to call on the objects.
2014-01-17 15:58:51 +01:00
Tor Andersson f6c5c56b44 Keep the current environment scope chain in the js_State struct.
Create script (global/eval code) functions without a scope (they're
not closures) and run them with js_eval so they can execute with the
current scope chain.

Normal functions still have a scope and are run with js_call.
2014-01-17 14:58:03 +01:00
Tor Andersson b595422da9 Add object property accessor functions to public API. 2014-01-17 03:03:10 +01:00
Tor Andersson 56042de82b Fix the shape of the outer API a bit. Implement eval. 2014-01-16 21:36:54 +01:00
Tor Andersson 288eef80e1 Clean up. Rearrange files. Rename functions. 2014-01-16 20:48:43 +01:00
Tor Andersson ede0f888ce Prepare for objects with internal properties, and closures as objects. 2014-01-15 23:41:41 +01:00
Tor Andersson f77a6e7e8e Implement value stack and use it in the interpreter.
We can now run simple programs that don't use function calls.
2014-01-14 18:17:06 +01:00
Tor Andersson a4cc139e1c Add js_Object with js_Property binary search tree.
Use object to represent a variable record and implement variable
loading and storing in the interpreter.
2014-01-13 21:32:33 +01:00
Tor Andersson 52f78c5687 Compile sub-functions. 2014-01-12 15:31:43 +01:00
Tor Andersson 5756da56d1 Begin generating byte code. 2014-01-12 13:39:42 +01:00