Skip to content
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

Support ES5 this handling in strict mode #940

Open
p-bakker opened this issue Jun 22, 2021 · 2 comments
Open

Support ES5 this handling in strict mode #940

p-bakker opened this issue Jun 22, 2021 · 2 comments
Labels
behavior Strict Mode Issues related to non-compliance with the ES5 Strict Mode spec
Projects
Milestone

Comments

@p-bakker
Copy link
Collaborator

While Rhino has some support for strict mode, a large chunk is missing, namely the handling of the this value in functions in strict mode.

Basic gist:

  • if there's no explicit this value, don't default to globalThis
  • if the this value is a primitive, don't box it as an Object

Implementing this one has its challenges, mainly the fact that the Callable interface that is used throughout the Rhino codebase and by 3rd party code that integrated/interacts with Rhino assumes this is an instance of ScriptableObject, a assumption that no longer holds true.

See #442 (comment) for some details

@p-bakker
Copy link
Collaborator Author

p-bakker commented Jun 22, 2021

Related issues: #442, #564, #639, #173

@p-bakker p-bakker added this to the ES5 milestone Jun 29, 2021
@p-bakker
Copy link
Collaborator Author

PR #39 attempted to fix this as well (resulting in breaking public API), see (amongst others) the following commits:

@p-bakker p-bakker added the Strict Mode Issues related to non-compliance with the ES5 Strict Mode spec label Jul 5, 2021
@p-bakker p-bakker added this to To do in v2.0.0 via automation Oct 14, 2021
@p-bakker p-bakker moved this from To do to features in v2.0.0 Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
behavior Strict Mode Issues related to non-compliance with the ES5 Strict Mode spec
Projects
v2.0.0
To do: features
Development

No branches or pull requests

1 participant