Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge the runtime features we've made up to this point #2

Merged
merged 181 commits into from
Apr 2, 2024

Conversation

PrestonLTaylor
Copy link
Owner

This PR got out of hand and got outside of the scope of just being the JS "ast" as it includes a lot of runtime components.
I'm merging this to be able to start to refactor a lot of the code in a separate pr and start to make pull request for small features instead.

We've implemented the Script, Agent, Realm and Completion record and
refactored existing code so that we can start writing code to execute
the AST we generate from parsing.

We also have a VM which will be used when executing nodes to perform
required tasks.
This prevents ambigiouties between the namespace Value and type Value.
This commit implements the ApplyStringOrNumericBinaryOperator Abstract
Operation and the binary ops needed to execute the operation.
There is no unit tests for this commit as the next commit will change
ASTTests to use the parser. So for testing literals we need execution of
expression statements.
Before we would throw on normal completions when calling update empty.
This helps our code be cleaner and not having to worry about null
Values.
If a parameter of a function is excluded it is defaulted to undefined.
The indexer for list now supports this behaviour
Callable doesn't need to inherit from Object and would make more sense
for Callable to be an interface.
This allows for the Object constructor to be used in code.

This commits also implements the spec code for adding global properties
Currently, if you had a new expression with arguments, it would be
parsed as a new expression with a CallExpression rhs.

This behaviour prevents new expressions with arguments from being
evaluted correctly
The Object constructor in javascript is a global object. So we imitate
that behaviour as a singleton.
BuiltinFunction objects support functions that are run in C# but will be
calling in javascript.

For example, functions created on prototypes are BuiltinFunction objects
@PrestonLTaylor PrestonLTaylor merged commit 8242014 into master Apr 2, 2024
2 checks passed
@PrestonLTaylor PrestonLTaylor deleted the js-ast-feature branch April 2, 2024 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant