* Fixed a bunch of test262 panics (#817)
This also implements a spec-compliant `parseInt()` function.
* Reverted a test
* Addressed long comments from review
* Add tests for cyclic conversions
* Add another test for a non-cyclic scenario
* Refactor the existing RecursionLimiter type
We can use the existing RecursionLimiter type
used by GcObject's Debug impl for this purpose.
We just need to refactor it to allow both liveness
and visitation tracking, using a HashMap of ptrs
to states instead of a HashSet of ptrs.
* Fix `Value::to_json` to not overflow.
Use the newly refactored RecursionLimiter to
check for recursion, and limit it. Throw a TypeError
as mandated by the spec.
* Fix ordinary_to_primitive to not overflow
Use the new RecursionLimiter type to prevent
overflows from conversions in ordinary_to_primitive.
The spec doesn't say what to do here, so we follow
v8 / SpiderMonkey in returning a default value for
the type hint -- either 0. or "". More details in
the method documentation.
* Move ordinary_to_primitive to GcObject
* Move object_to_json to GcObject
* Add test for console.log
- Refactor `String` => `Rc<str>`
- Refactor `Symbol` => `Rc<Symbol>`
- Refactor `BigInt` => `RcBigInt`
- Changed function signature, from `&mut Value` to `&Value`
- Removed `Interpreter::value_to_rust_number()
- Abstracted `Gc<GcCell<Object>>` to `GcObject`
- Removed unnecessary `Box`s in global environment
- Extracted `extensible` from internal slots
- Made `to_primitive` throw errors
- Removed `strict` parameter in `SameValue` function.
- The `SameValue` function is not dependent on strict mode.