Repository navigation
Moved value operations from Interpreter to Value - #625
Merged
Merged
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
|
HalidOdat
marked this pull request as ready for review
August 13, 2020 00:12
Benchmark for 155021bClick to view benchmark
|
Benchmark for c58b480Click to view benchmark
|
Razican
reviewed
Aug 15, 2020
Razican
left a comment
Member
There was a problem hiding this comment.
I like it, just check my comments to see if it can be improved :)
Benchmark for 73c9811Click to view benchmark
|
Member
Author
|
If everything is ok with this PR could we merge this, it's blocking me on some PRs |
Member
Author
|
Lets merge this merging this :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR moves the value operation function from
InterpretertoValue. 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::PreferredTypetovalue::PreferredTypeValue::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()