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

Improve documentation of jumps in comments #5375

Merged
merged 3 commits into from
Sep 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Original file line number Diff line number Diff line change
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