Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Commit

Permalink
Make clear that it is not a suppression error mechanism
Browse files Browse the repository at this point in the history
Resolves #60
  • Loading branch information
claudepache authored Jun 7, 2019
1 parent 295ab49 commit 87e408d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,21 @@ Deeply nested tree-like structures is not the sole use case of Optional Chaining
See also [Usage statistics on optional chaining in CoffeeScript](https://github.com/tc39/proposal-optional-chaining/issues/17) and compare “Total soak operations” with “Total soak operations chained on top of another soak”.
<dt>The feature looks like an error suppression operator, right?
<dd>
No. Optional Chaining just checks whether some value is undefined or null. It does not catch or suppress errors that are thrown by evaluating the surrounding code. For example:
```js
(function () {
"use strict"
undeclared_var?.b // ReferenceError: undeclared_var is not defined
arguments?.callee // TypeError: 'callee' may not be accessed in strict mode
arguments.callee?.() // TypeError: 'callee' may not be accessed in strict mode
})()
```
</dl>
## Specification
Expand Down

4 comments on commit 87e408d

@littledan
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, was there a PR for this change? From here, given that this repository is pretty widely watched, if we could make changes via PRs rather than just landing patches, to allow broader participation.

@ljharb
Copy link
Member

@ljharb ljharb commented on 87e408d Jun 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#60 was closed with it, so anyone watching the repo definitely got the notification.

@claudepache
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry. I’ll open PRs for the next modifications.

@littledan
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ljharb Yeah, that's how I arrived here. A nice thing about PRs is that we can also make review comments. I'm not suggesting a requirement for all cases, but here, we have a bunch of people working together on this particular proposal.

Please sign in to comment.