2fe5ce607a
fix: multiply acting as subtract
2024-09-21 19:01:05 +03:00
d821a3a89b
refactor: utilize inheritence in index.js
2024-09-21 18:46:22 +03:00
0064c74ac8
fix: don't allow execution of CALL_SUPER twice or in non-construct call
2024-09-21 18:46:02 +03:00
bd548c813a
fix: null out thisArg only when constructing
2024-09-21 18:45:38 +03:00
78af69ec80
fix: parseStatementEnd behaving incorrectly when EOF
2024-09-21 18:44:08 +03:00
98e5299f9c
fix: derived classes use the scope API incorrectly
2024-09-21 18:43:32 +03:00
797452c28f
fix: tmp variables captured incorrectly
2024-09-21 18:43:15 +03:00
fee74dcba4
fix: infinite loop in class parser
2024-09-21 18:42:51 +03:00
9845a39e84
fix: operations polluting stack
2024-09-21 18:42:34 +03:00
ee78bdc1cb
feat: implement derived classes
2024-09-21 18:06:03 +03:00
7fcb9ed19f
fix: member field initializers should be iterable
2024-09-20 11:39:48 +03:00
8dee4353d4
feat: implement non-enumerable members in classes
2024-09-20 11:39:46 +03:00
59e6f34a01
refactor: clean up REPL stringification code
2024-09-20 11:39:40 +03:00
fdac93bf4d
fix: scope offsets calculated incorrectly
2024-09-20 11:39:34 +03:00
d7b50fa45b
refactor: use classes in index.js
2024-09-19 18:11:42 +03:00
077e8afff7
fix: some behavioral issues
2024-09-19 18:11:35 +03:00
631ef9db4a
fix: differenciate between non-functions and non-invokables in messages
2024-09-19 18:10:50 +03:00
0258cc0a90
feat: implement classes (without inheritence)
2024-09-19 18:09:28 +03:00
0b3dca8b13
refactor: extract members into own classes
2024-09-19 18:08:11 +03:00
6d56660136
fix: stupid mistake with variable capturing
2024-09-19 14:22:21 +03:00
8a21873631
fix: retrofit patterns for bindings and check if var is init in runtime
2024-09-19 11:02:02 +03:00
fbbd26bf7d
fix: remove unneeded comments
2024-09-14 22:08:33 +03:00
e2a8a382cc
refactoring
2024-09-14 21:33:33 +03:00
0670ffcdd1
fix: int value not correctly recognized
2024-09-14 19:54:42 +03:00
9b957335bf
optimization: keep StringValue instances tied to one String instance
2024-09-14 19:45:05 +03:00
e9f889576c
feat: implement hidden integers
2024-09-14 19:38:30 +03:00
e11d182631
refactor: remove dead code
2024-09-14 18:52:07 +03:00
30674ee463
refactor: get rid of InterruptException
2024-09-14 18:46:47 +03:00
fab3e59910
feat: implement a byte array
2024-09-14 18:46:28 +03:00
d7e4e7a024
refactor: oops
2024-09-14 18:45:55 +03:00
e4166fe450
refactor: rewrite some code for java 8 compatibility
2024-09-14 18:45:20 +03:00
f13bf584a5
feat: add some missing features in the polyfills
2024-09-14 15:25:34 +03:00
4e8b110fc4
feat: add assign shorthands
2024-09-14 14:33:09 +03:00
cb82f4cf32
feat: implement patterns
2024-09-14 14:23:46 +03:00
23ae2b2e46
todo
2024-09-14 14:23:35 +03:00
55613ef2c9
feat: extend the instruction set
2024-09-14 14:23:28 +03:00
0b34c68139
fix: unnecessary new line in toReadable
2024-09-14 14:22:51 +03:00
d87e53264d
refactor: split array logic
2024-09-14 14:22:31 +03:00
1f42263051
clean up member logic
2024-09-14 13:53:58 +03:00
3e6816cb2c
fix: properly hande variable collisions
2024-09-12 20:25:11 +03:00
2a01b3d86e
some work losl
2024-09-07 21:06:08 +03:00
8e64d13c87
refactor: clean up assigning
2024-09-06 15:48:22 +03:00
5f88061ee7
refactor: rename callNew -> construct and call -> invoke
2024-09-06 15:48:07 +03:00
b9268518f6
fix: array statements broken when empty elements
2024-09-06 15:46:10 +03:00
63ccd5757e
feat: implement spread_obj intrinsic
2024-09-06 10:03:55 +03:00
515011b3ef
refactor: improve meber listing system
2024-09-06 10:03:37 +03:00
6f548ce5ff
feat: reflect scope optimizations in runtime
2024-09-05 22:30:28 +03:00
7c74df4d36
refactor: use new system to reorder variables that overlaps neighboring scopes
2024-09-05 21:25:39 +03:00
0004839f6f
fix: realloc for declarations after each iteration
2024-09-05 17:15:26 +03:00
07411f62c8
feat: implement capturable locals realloc
2024-09-05 17:14:59 +03:00
4bfc062aaf
fix: correctly flatten locals in control flow statements
2024-09-05 17:13:34 +03:00
9ec99def3f
fix: variable declarations shouldn't collide with defined name of named function exp
2024-09-05 13:29:42 +03:00
8f13ff3e0b
fix: scope gets polluted by arguments with named function expressions
2024-09-05 13:29:20 +03:00
d7353e19ed
fix: treat "arguments" as a keyword (as per strict soecifications)
2024-09-05 13:18:53 +03:00
e509edc459
fix: wrong arguments when compilling function bodies
2024-09-05 13:03:49 +03:00
b6a90b108b
fix: wrong check for var decl collisions
2024-09-05 13:03:36 +03:00
55caf1e206
refactor: remove unneeded old comments
2024-09-05 13:03:04 +03:00
eac4a3af23
fix: throw access before decl for const and let in runtime
2024-09-05 00:31:03 +03:00
5b4adf5286
a clusterfuck of fixes with let and const
2024-09-05 00:28:13 +03:00
9265a7d813
Merge branch 'master' into ES6
2024-09-04 15:52:03 +03:00
1589ef51b0
refactor: move src and resources to standard places
2024-09-04 15:32:54 +03:00
marregui
313b20a3b3
Add first test ( #23 )
...
* Add the first test and upgrade build.gradle to modern standards
1. gradle wrapper
2. ./gradlew run
3. manifest will look like
Manifest-Version: 1.0
Main-Class: me.topchetoeu.jscript.runtime.SimpleRepl
Build-Timestamp: 2024-09-04T10:44:35.990+0200
Build-Branch: ma/add-first-tests
Build-Revision: 412edc0ebc
Build-Jdk: 21.0.3 (Oracle Corporation 21.0.3+7-LTS-152)
Build-Author: TopchetoEU
4. build/distributions contains a zip and a jar which contain jscript-0.9.41-beta.jar
5. unnecessary libs have been removed
6. gradle has been updated to 8.10
7. first test has been added
* fix: revert removal of Jabel (for support of Java 11)
---------
Co-authored-by: TopchetoEU <36534413+TopchetoEU@users.noreply.github.com>
2024-09-04 15:29:17 +03:00
ce9b419757
reafactor: make globals initializer use ES6 features
2024-09-04 10:45:34 +03:00
6f8efe74c4
fix: print was returning java null, not JS undefined
2024-09-04 10:45:14 +03:00
bd503ed943
feat: impl new instructions
2024-09-04 10:44:58 +03:00
5359c54694
fix: rethrow SyntaxException from compilation as EngineException
2024-09-04 10:44:44 +03:00
93c246ad97
refactor: remove arg loading from frame
2024-09-04 10:44:24 +03:00
7c8efaf066
fix: incorrect printing of object-like values
2024-09-04 10:43:40 +03:00
546d663466
feat: add this arg capture
2024-09-04 10:42:21 +03:00
f929015f55
ammend to prev commit
2024-09-04 10:41:52 +03:00
2a5f6aa9aa
fix: use _STR and _INT variants of member instructions
2024-09-04 10:41:17 +03:00
78d233a6bd
refactor: remove ArgumentsNode
2024-09-04 10:39:11 +03:00
3f25868f19
fix: some scope bug fixes
2024-09-04 10:38:16 +03:00
e3f1bc0949
fix: incorrect compilation of if-else
2024-09-04 10:36:48 +03:00
506726fd76
feat: implement ES6 variables and rest args
2024-09-04 10:36:25 +03:00
4cbc108686
feat: implement optional arguments
2024-09-04 10:00:48 +03:00
c39c06b792
refactor: move away intrinsic logic to final methods for performance
2024-09-04 10:00:45 +03:00
7ab78b9cea
fix: control flow nodes were making scopes instead of compound nodes
2024-09-04 10:00:43 +03:00
87e077d70d
oops
2024-09-04 10:00:40 +03:00
52f7c15ac8
refactor: change how function scope keeps track of arguments
2024-09-04 10:00:38 +03:00
6932bea677
refactor: remove unused class
2024-09-04 10:00:36 +03:00
82d6f52a26
refactor: make some classes final for performance
2024-09-04 10:00:33 +03:00
1b87c2f5a6
fix: add for-of to statement list
2024-09-04 10:00:30 +03:00
163dfe7b6e
feat: implement access to intrinsics
2024-09-04 10:00:25 +03:00
2b6d4a87ca
fix: for in and for of not reading open paren
2024-09-04 10:00:22 +03:00
349d392269
major rewrite: clean up a lot of code and lay ground for ES6 support
2024-09-04 10:00:15 +03:00
6481e992fa
feat: implement "has" function for scopes
2024-09-04 10:00:11 +03:00
4a5e5a71af
feat: Create new scope system for ES6+ support
2024-09-04 10:00:02 +03:00
89ba921b4a
refactor: rename statements to nodes
2024-09-04 10:00:00 +03:00
a45f4109d8
feat: add environment in Source
2024-09-04 09:59:57 +03:00
62aba62a41
refactor: make Environment more reusable
2024-09-04 09:59:54 +03:00
4048d6ef1c
refactor: rename ES5 to JavaScript
2024-09-04 09:59:42 +03:00
d0ccf00f14
everything all at once
2024-09-04 09:59:35 +03:00
f09feae08f
refactor: clean up parsing
2024-09-04 09:59:32 +03:00
ef0fc5a61d
refactor: distribute parse functions in node classes
2024-09-04 09:59:28 +03:00
bab59d454f
refactor: Transition to a Value class
2024-09-04 09:59:26 +03:00
3475e3a130
refactor: Remove environment-related bloat
2024-09-04 09:59:15 +03:00
49b52d90a7
fix: wrappers cache compare objects with .equals and not ==
2024-04-21 11:03:00 +03:00
8a8de518a6
feat: make Function constructor
2024-04-20 23:44:02 +03:00
099201e4ad
refactor: remove testing junk in REPL
2024-04-20 22:23:45 +03:00