Skip to content

Fix for Reflect's properties having an incorrect scope - #594

Merged
rbri merged 1 commit into
HtmlUnit:masterfrom
duonglaiquang:duong_reflect
May 23, 2023
Merged

rbri merged 1 commit into
HtmlUnit:masterfrom
duonglaiquang:duong_reflect

Conversation

@duonglaiquang

Copy link
Copy Markdown
Contributor

This PR does the following:

  • Fix an issue where properties of Reflect have their scope incorrectly set to the parent scope of Reflect rather than the Reflect instance itself
  • The issue can be seen in this test case:
    var foo = {
      bar: 0
    };
    (Reflect ? Reflect.has : console.log)(foo, 'bar')
    • HtmlUnit 3.0.0 will throw org.htmlunit.ScriptException: TypeError: Method "has" called on incompatible object. since it's trying to execute has() on window object instead of Reflect

@rbri

rbri commented May 23, 2023

Copy link
Copy Markdown
Member

Thanks.
Will have a look soon.

@rbri
rbri merged commit ecc1102 into HtmlUnit:master May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants