Starlight-JS / starlight

JS engine in Rust
https://teletype.in/@starlight-js
Mozilla Public License 2.0
509 stars 9 forks source link

Implement Context #93

Closed jameslahm closed 3 years ago

jameslahm commented 3 years ago

Now the realm api is very simple

let rt = Runtime::new(...)
let ctx1 = Context::new(rt)
let ctx2 = Context::new(rt)
// ctx1 and ctx2 are standalone realm, not influence each other
ctx1.eval()
ctx2.eval()

TODO

playXE commented 3 years ago

Wow! That's quite a lot of work! But I do not like that Context resides on the stack, I guess it should be always allocated on the GC heap instead so we can copy it and also store it in JsGlobal in safe way without using *mut Context.

jameslahm commented 3 years ago

There are still some problems with tests. I'll look into it.

github-actions[bot] commented 3 years ago

Test262 conformance changes:

Test result Dev count PR count Difference
Total 79,437 79,437 0
Passed 13,739 13,738 -1
Ignored 24,388 24,388 0
Failed 39,972 39,468 -504
Panics 1,338 1,843 +505
Conformance 17.30 17.29 -0.00%
Base Failed But New Passed ``` 1. [non-strict] test262/test/built-ins/String/prototype/padStart/exception-fill-string-symbol.js 2. [strict] test262/test/built-ins/Object/keys/15.2.3.14-4-1.js 3. [strict] test262/test/built-ins/String/prototype/padStart/exception-fill-string-symbol.js 4. [strict] test262/test/built-ins/Symbol/prototype/valueOf/this-val-symbol.js 5. [strict] test262/test/built-ins/Symbol/prototype/constructor.js 6. [strict] test262/test/built-ins/String/prototype/padStart/exception-symbol.js 7. [non-strict] test262/test/built-ins/Promise/prototype/S25.4.5_A3.1_T1.js 8. [non-strict] test262/test/built-ins/Symbol/prototype/constructor.js 9. [non-strict] test262/test/built-ins/String/prototype/padStart/exception-symbol.js 10. [non-strict] test262/test/built-ins/Symbol/prototype/valueOf/this-val-symbol.js 11. [strict] test262/test/built-ins/Promise/prototype/S25.4.5_A3.1_T1.js ```
New Failed But Base Passed ``` 1. [strict] test262/test/built-ins/String/prototype/padStart/fill-string-omitted.js 2. [non-strict] test262/test/built-ins/String/prototype/padStart/fill-string-omitted.js 3. [strict] test262/test/built-ins/String/prototype/padStart/observable-operations.js 4. [non-strict] test262/test/built-ins/String/prototype/padStart/observable-operations.js 5. [strict] test262/test/built-ins/String/prototype/padStart/max-length-not-greater-than-string.js 6. [strict] test262/test/built-ins/String/prototype/trimStart/this-value-boolean.js 7. [non-strict] test262/test/built-ins/String/prototype/trimStart/this-value-boolean.js 8. [strict] test262/test/built-ins/String/prototype/padStart/fill-string-empty.js 9. [non-strict] test262/test/built-ins/String/prototype/trimStart/this-value-line-terminator.js 10. [non-strict] test262/test/built-ins/String/prototype/padStart/max-length-not-greater-than-string.js 11. [non-strict] test262/test/built-ins/String/prototype/padStart/fill-string-empty.js 12. [strict] test262/test/built-ins/String/prototype/trimStart/this-value-line-terminator.js ```