Fixes and improvements for proxy and reflect#19
Open
duonglaiquang wants to merge 4 commits intoHtmlUnit:masterfrom
Open
Fixes and improvements for proxy and reflect#19duonglaiquang wants to merge 4 commits intoHtmlUnit:masterfrom
duonglaiquang wants to merge 4 commits intoHtmlUnit:masterfrom
Conversation
26c8bb5 to
da44309
Compare
Member
|
Thanks a lot, but this requires some time, something for the weekend ;-) |
Member
|
first pr is on the way mozilla#2347 |
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 does the following
Fix multiple issues in
NativeProxyandNativeReflect.1. NativeProxy: fix set trap not passing receiver object
put(String, ...),put(int, ...),put(Symbol, ...)now passthis(the proxy) as the 4th argument to the set trap.2. NativeReflect: fix Reflect.construct() with LambdaConstructor
Reflect.constructusedctorBaseFunction.call()to invoke the target, butLambdaConstructortargets can be non-callable as they only support.construct()which would result in aTypeErrorwhen called.Now we check if it's callable or constructable to decide what to do.
3. NativeReflect: re-implement Reflect.get() and Reflect.set() following official spec
The old implementation of
Reflect.getandReflect.setignored the optional receiver parameter entirely.