Create execution context and execution stack
This is a bit of a refactor. https://tc39.es/ecma262/#sec-execution-contexts
First we need a context struct which holds information about the context. fields would be https://tc39.es/ecma262/#table-22
Then we need to create a stack structure, this holds execution contexts in a FIFO order, and the top most one is the currently running context
This stack structure would also have methods on it: 8.3.1GetActiveScriptOrModule 8.3.2ResolveBinding 8.3.3GetThisEnvironment 8.3.4ResolveThisBinding 8.3.5GetNewTarget 8.3.6GetGlobalObject
Then the exec.rs would accept a new executionContext and run it https://github.com/jasonwilliams/boa/blob/master/src/lib/exec.rs#L24-L29
Note Multiple contexts can point to the same realm, so realm needs to be wrapped in a GC
I will take a look at this.
👋 I would like to take a stab at this
@rumpl did you have the chance to look into this?
We decided that we don't need to follow the spec because our current implementation is more optimal.