     input.length
 
   cjsxText: ->
-    return 0 unless @activeBranchNode().type is $.CJSX_EL
+    return 0 unless @currentState() is $.CJSX_EL
 
     unless @newestNode().type is $.CJSX_TEXT
       @addLeafNodeToActiveBranch parseTreeLeafNode $.CJSX_TEXT, '' # init value as string

  # parseTree helpers

  activeBranchNode: -> last(@activeStates)

  newestNode: -> last(@activeBranchNode().children) or @activeBranchNode()


      i += consumed

    if @activeBranchNode()? and @activeBranchNode() isnt @parseTree
      message = "Unexpected end of input: unclosed #{@currentState()}"
      throwSyntaxError message, first_line: @chunkLine, first_column: @chunkColumn

    @remainder = code[i..]
