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

Remove a?.b = c and delete a?.b #18

Closed
claudepache opened this issue Jun 8, 2017 · 1 comment
Closed

Remove a?.b = c and delete a?.b #18

claudepache opened this issue Jun 8, 2017 · 1 comment

Comments

@claudepache
Copy link
Owner

claudepache commented Jun 8, 2017

Those are merely by-products of the spec mechanics (Nil reference), rather the intended semantics of optional chaining.

The proposed semantics may also be somewhat confusing for users, and it makes more difficult to have simple understanding of what short-circuiting does.

Those could be re-added later in case clear semantics and compelling use cases are found.

Strategy for fixing the issue:

  • use proper grammar and/or use static semantics in order to have SyntaxError where possible;
  • PutValue on a Nil Reference should throw a TypeError. Ditto for the delete operator.
@claudepache
Copy link
Owner Author

I have kept delete a?.b because:

claudepache added a commit that referenced this issue Jul 21, 2017
* Update to the most recent spec version.
* Statically forbid use in contexts like `a?.b = c` (but not `delete
a?.b`). Closes #4, closes #18.
* Remove short-circuiting piercing parentheses. Closes #19.
* Minor bugfixes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant