Skip to content

Commit

Permalink
Fix bug 710225 - Label nodes produce negative lengths
Browse files Browse the repository at this point in the history
  • Loading branch information
hns committed Dec 16, 2011
1 parent f7f63f1 commit a518c4e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/org/mozilla/javascript/Parser.java
Expand Up @@ -1828,7 +1828,11 @@ private AstNode nameOrLabel()
}
}

bundle.setLength(getNodeEnd(stmt) - pos);
// If stmt has parent assigned its position already is relative
// (See bug #710225)
bundle.setLength(stmt.getParent() == null
? getNodeEnd(stmt) - pos
: getNodeEnd(stmt));
bundle.setStatement(stmt);
return bundle;
}
Expand Down

0 comments on commit a518c4e

Please sign in to comment.