Skip to content

Commit f5073fa

Browse files
Improve documentation of jumps in comments (#5375)
* Improve documentation of jumps * Review suggestion Co-authored-by: Geoffrey Booth <[email protected]> * Rebuild Co-authored-by: Geoffrey Booth <[email protected]>
1 parent f9c3316 commit f5073fa

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

lib/coffeescript/nodes.js

+6-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/nodes.coffee

+7-6
Original file line numberDiff line numberDiff line change
@@ -392,11 +392,12 @@ exports.Base = class Base
392392
# has special awareness of how to handle comments within its output.
393393
includeCommentFragments: NO
394394

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

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

49974998
isStatement: YES
49984999

4999-
jumps: (o) -> @recovery.jumps(o)
5000+
jumps: (o) -> @recovery.jumps o
50005001

50015002
makeReturn: (results, mark) ->
50025003
ret = @recovery.makeReturn results, mark

0 commit comments

Comments
 (0)