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

Confusing property/get/set API #63

Open
steverep opened this issue Aug 16, 2023 · 0 comments
Open

Confusing property/get/set API #63

steverep opened this issue Aug 16, 2023 · 0 comments
Labels

Comments

@steverep
Copy link

steverep commented Aug 16, 2023

Expected Behavior

For the StackFrame object, I would expect a very simple way to get and set properties:

  • Just access stackframe.filename to read the property
  • Set the property via stackframe.filename = "myfile.js"

That should be the API regardless of whether or not it is implemented as a getter/setter pair. If there is extra work to do for either, then a getter/setter pair should be used with a hidden property like stackframe._filename, which the user should not be instructed to access directly.

Current Behavior

The current API is confusing and does not make use of actual JS getters and setters. For example:

  • What happens if I set the property directly? Is that the same as the set method?
  • What's different about accessing the property vs. the get method? Both are used in the documentation with no explanation.

Furthermore, the typings for the set methods have zero parameters defined.

@steverep steverep added the a:bug label Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant