Check typeof parent and swap vars around

Checking state.curState.context can cause issues is state.curState
doesn't exist so just check state.curState instead
Swapped a couple of vars round to match order of usage in func
This commit is contained in:
Matt Pass
2012-09-29 17:15:09 +01:00
parent 4be0067852
commit e14a8df6a0

View File

@@ -117,7 +117,7 @@ var ICEcoder = {
// Set up array to store nest data
state = cM.getTokenAt(cM.getCursor()).state;
if ("undefined" != typeof state.curState.context) {
if ("undefined" != typeof state.curState) {
ICEcoder.htmlTagArray = [];
for (cx = state.curState.context; cx; cx = cx.prev) {
ICEcoder.htmlTagArray.unshift(cx.tagName);
@@ -444,7 +444,7 @@ var ICEcoder = {
// Indicate if the nesting structure of the code is OK
updateNestingIndicator: function () {
var cM, fileName, nestOK, endDoc;
var cM, nestOK, fileName, endDoc;
cM = ICEcoder.getcMInstance();
nestOK = true;