-
-
Notifications
You must be signed in to change notification settings - Fork 406
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
Moved value operations from Interpreter
to Value
#625
Conversation
Codecov Report
@@ Coverage Diff @@
## master #625 +/- ##
==========================================
- Coverage 72.81% 72.56% -0.25%
==========================================
Files 179 179
Lines 13197 13259 +62
==========================================
+ Hits 9609 9621 +12
- Misses 3588 3638 +50
Continue to review full report at Codecov.
|
Benchmark for 76153ffClick to view benchmark
|
Benchmark for 8c7e9faClick to view benchmark
|
Benchmark for e0031beClick to view benchmark
|
Benchmark for 9e9f5c1Click to view benchmark
|
Benchmark for 9e587b1Click to view benchmark
|
Benchmark for 8141e96Click to view benchmark
|
Benchmark for 155021bClick to view benchmark
|
Benchmark for c58b480Click to view benchmark
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it, just check my comments to see if it can be improved :)
Benchmark for 73c9811Click to view benchmark
|
If everything is ok with this PR could we merge this, it's blocking me on some PRs |
Lets merge this merging this :) |
This PR moves the value operation function from
Interpreter
toValue
. There operations don't make sense to live in interpreter for example:When you read this line its "context to primitive with value and preferred type number" this makes it seem like we are converting the context to a primitive, which is wrong! instead it should be:
When you read this line its "value to primitive with context and preferred type number" this makes sense and allows us to remove the
#[allow(clippy::wrong_self_convention)]
Changes the following:
Intepreter::to_primitive()
=>Value::to_primitive()
exec::PreferredType
tovalue::PreferredType
Value::display()
which implementsDisplay
(this is done because it conflicts withValue::to_string(context)
)Interpreter::to_string()
toValue::to_string()
Interpreter::to_object()
toValue::to_object()
Interpreter::to_property_key()
toValue::to_property_key()
Interpreter::to_numeric()
toValue::to_numeric()
Interpreter::to_uint32()
toValue::to_uint32()
Interpreter::to_int32()
toValue::to_int32()
Interpreter::to_index()
toValue::to_index()
Interpreter::to_length()
toValue::to_length()
Interpreter::to_integer()
toValue::to_integer()
Interpreter::to_number()
toValue::to_number()
Interpreter::to_number()
toValue::to_number()