summaryrefslogtreecommitdiff
path: root/src/textanalysis.js
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2014-12-03 16:52:38 +0200
committerAlon Levy <alon@pobox.com>2014-12-03 16:52:40 +0200
commit9b15176381c6e2e6b7761c9b803b314e9f1b0fd7 (patch)
treee4935731243e9ea7b6b17e1ec4ceda38ecfaf7bf /src/textanalysis.js
parentf2947d5157250c72009bd8b1ad8adbfdf629329f (diff)
textanalysis: ret.state was not always defined
Found by investigating a ReferenceError warning: ReferenceError: reference to undefined property
Diffstat (limited to 'src/textanalysis.js')
-rw-r--r--src/textanalysis.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/textanalysis.js b/src/textanalysis.js
index 1f3d2cd6..269b5785 100644
--- a/src/textanalysis.js
+++ b/src/textanalysis.js
@@ -12,6 +12,7 @@ var lastnode;
var sugg = {}; // suggestions for autocompletion of node names
var ANALYSIS_NODE_START = 'ANALYSIS_NODE_START';
+var ANALYSIS_NODE = 'ANALYSIS_NODE'
var ANALYSIS_LINK = 'ANALYSIS_LINK';
function selectedType()
@@ -179,9 +180,8 @@ var textAnalyser = function (newtext, finalize) {
yell_bug = false, // TODO: fix both issues
NODE = "NODE",
LINK = "LINK",
- START = "START";
-
- var ret = model_diff.new_topo_diff();
+ START = "START",
+ ret = model_diff.new_topo_diff();
function addNode(name, type, state) {
if (type === undefined) {
@@ -352,6 +352,7 @@ var textAnalyser = function (newtext, finalize) {
addLink(token_set_new_node_names[nodeindex - 1], token_set_new_node_names[nodeindex], token_set_new_link_names[linkindex], typesetter);
and_connect(token_set_new_node_names[nodeindex]);
}
+ ret.state = ANALYSIS_NODE_START;
break;
case LINK:
linkindex++;
@@ -493,6 +494,7 @@ return {
textAnalyser:textAnalyser,
autoSuggestAddName:autoSuggestAddName,
ANALYSIS_NODE_START:ANALYSIS_NODE_START,
+ ANALYSIS_NODE: ANALYSIS_NODE,
ANALYSIS_LINK:ANALYSIS_LINK,
//for the external arrow-type changer