-
-
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
Modify environment binding behaviour of function #1010
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1010 +/- ##
==========================================
+ Coverage 58.61% 58.62% +0.01%
==========================================
Files 172 172
Lines 11763 11766 +3
==========================================
+ Hits 6895 6898 +3
Misses 4868 4868
Continue to review full report at Codecov.
|
Test262 conformance changes:
The numbers look good. I think adding some tests would be nice to make the desired behaviour clearer. |
Thanks for looking at this @54k1 One place to handle that would be here (however this only accounts for when bindings are created as a list. This could need a new issue, but im open to hear what the others think
Could you go into more detail here? What documentation are you referring to? The specification?
Yep adding some tests here would be good enough as a fix for the "environment side" |
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.
This fix looks good to me. We still need to fix #858, but I believe that is a different issue. We need to implement a pre-parsing strategy I think.
@jasonwilliams Yes, I meant the specification, sorry about the confusion |
I've found The "call-trace" seems to be |
Seems like |
@RageKnify that's interesting, the way functions are bound right now is we just use the containing scope. I don't know if we're supposed to be using @54k1 you're right in that in theory we would catch this during parsing (as an early error), but we don't have functionality to check duplicates as parsing time just yet, but I see you've created an issue for that anyway. Looks good to me |
Does this help with #989? |
This Pull Request fixes/closes #669.
If a binding for the function name already exists, we should simply override it (
set_mutable_binding
), otherwise we need to create a new binding. For this to be accurate, we need to also fix #858, since now we are simply overriding the binding (potentiallylet
orconst
).This seems to fix it, however, I haven't found this in the documentation. The implementation of
var
also seems to follow this. Could anybody provide a link to the part where this is described in the documentation?