Tor Andersson
40a12fba0d
Split header into js.h public and jsi.h private. Start cleaning up
...
private function prefixes.
2014-01-20 16:13:09 +01:00
Tor Andersson
8aa0627557
Add Error builtin objects and exception stack.
2014-01-20 00:13:47 +01:00
Tor Andersson
32c0c6c410
Rename jsR_numbertostring to jsR_stringfromnumber.
...
Add js_tointeger, js_toint32, js_touint32.
2014-01-19 14:55:19 +01:00
Tor Andersson
1237388b8e
More builtins. Fix prototype chains for builtin classes and prototypes.
2014-01-19 01:50:41 +01:00
Tor Andersson
a592f61f36
Implement Number and Object classes.
...
Split built-in functions into one file per class.
2014-01-18 22:04:37 +01:00
Tor Andersson
07610bd0ac
Refactor ToString and ToNumber functions. Add ToPrimitive.
2014-01-18 20:16:28 +01:00
Tor Andersson
05275e2e5d
Implement relational and equality operators.
2014-01-18 18:20:33 +01:00
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