You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make environment methods take &mut Context - #1131
The reason will be displayed to describe this comment to others. Learn more.
I'm OK with these changes, but since it's adding 14 new panics and makes 6 extra tests fail, I would need a bit more of rationale to understand why this change is needed / useful for us.
I'm OK with these changes, but since it's adding 14 new panics and makes 6 extra tests fail, I would need a bit more of rationale to understand why this change is needed / useful for us.
Sorry, I should have explained this before 😅
The environment methods needs to take &mut Context because:
They call methods which take a context
Throws directly
We went around this problem by using ErrorKind which could be a reference or type error this solved the second problem of environments throwing directly (albeit in a bit of a messy way since we needed to call .map(|e| ...) to converted it into an actual error object).
But the first issue was still not solved and we were not able to use methods which take context (mostly internal object methods like [[get]], [[set]], [[hasProperty]] etc). And because of this we still have a dependency on the methods which are not spec compliant, and should be removed like Value::has_property() , Value::get_property() (this is related to #577)
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
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.
It changes the following:
ErrorKindLexicalEnvironmentmethods toContext&mut ContextResult<T>pub(crate)