Skip to content

Commit

Permalink
Improve documentation of jumps in comments (#5375)
Browse files Browse the repository at this point in the history
* Improve documentation of jumps

* Review suggestion

Co-authored-by: Geoffrey Booth <456802+GeoffreyBooth@users.noreply.github.com>

* Rebuild

Co-authored-by: Geoffrey Booth <456802+GeoffreyBooth@users.noreply.github.com>
  • Loading branch information
edemaine and GeoffreyBooth committed Sep 20, 2021
1 parent f9c3316 commit f5073fa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
11 changes: 6 additions & 5 deletions lib/coffeescript/nodes.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions src/nodes.coffee
Expand Up @@ -392,11 +392,12 @@ exports.Base = class Base
# has special awareness of how to handle comments within its output.
includeCommentFragments: NO

# `jumps` tells you if an expression, or an internal part of an expression
# has a flow control construct (like `break`, or `continue`, or `return`,
# or `throw`) that jumps out of the normal flow of control and can’t be
# used as a value. This is important because things like this make no sense;
# we have to disallow them.
# `jumps` tells you if an expression, or an internal part of an expression,
# has a flow control construct (like `break`, `continue`, or `return`)
# that jumps out of the normal flow of control and can’t be used as a value.
# (Note that `throw` is not considered a flow control construct.)
# This is important because flow control in the middle of an expression
# makes no sense; we have to disallow it.
jumps: NO

# If `node.shouldCache() is false`, it is safe to use `node` more than once.
Expand Down Expand Up @@ -4996,7 +4997,7 @@ exports.Catch = class Catch extends Base

isStatement: YES

jumps: (o) -> @recovery.jumps(o)
jumps: (o) -> @recovery.jumps o

makeReturn: (results, mark) ->
ret = @recovery.makeReturn results, mark
Expand Down

0 comments on commit f5073fa

Please sign in to comment.