We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bd0024a commit feb42e5Copy full SHA for feb42e5
1 file changed
test/location.coffee
@@ -450,6 +450,25 @@ test "#3621: Multiline regex and manual `Regex` call with interpolation should
450
eq tokenA.origin?[1], tokenB.origin?[1]
451
eq tokenA.stringEnd, tokenB.stringEnd
452
453
+test "Verify tokens have locations that are in order", ->
454
+ source = '''
455
+ a {
456
+ b: ->
457
+ return c d,
458
+ if e
459
+ f
460
+ }
461
+ g
462
+ '''
463
+ tokens = CoffeeScript.tokens source
464
+ lastToken = null
465
+ for token in tokens
466
+ if lastToken
467
+ ok token[2].first_line >= lastToken[2].last_line
468
+ if token[2].first_line == lastToken[2].last_line
469
+ ok token[2].first_column >= lastToken[2].last_column
470
+ lastToken = token
471
+
472
test "Verify all tokens get a location", ->
473
doesNotThrow ->
474
tokens = CoffeeScript.tokens testScript
0 commit comments