//println("<i>"+token.data+"</i>");
- switch (token.data.toUpperCase()) {
-
- case ';':
- case ',':
- if (this.braceNesting == expressionBraceNesting &&
- bracketNesting == 0 &&
- parensNesting == 0) {
-
- return;
- }
- break;
+ switch (token.type) {
+ case 'PUNC':
+ switch(token.data) {
+
+ case ';':
+ case ',':
+ if (this.braceNesting == expressionBraceNesting &&
+ bracketNesting == 0 &&
+ parensNesting == 0) {
+
+ return;
+ }
+ break;
- case 'FUNCTION':
- this.parseFunctionDeclaration();
- break;
+
- case '{': //Token.LC:
- isObjectLitAr.push(false);
-
- this.braceNesting++;
- break;
+ case '{': //Token.LC:
+ isObjectLitAr.push(false);
+
+ this.braceNesting++;
+ break;
- case '}': //Token.RC:
- this.braceNesting--;
- isObjectLitAr.pop();
-
- // assert braceNesting >= expressionBraceNesting;
- break;
+ case '}': //Token.RC:
+ this.braceNesting--;
+ isObjectLitAr.pop();
+
+ // assert braceNesting >= expressionBraceNesting;
+ break;
- case '[': //Token.LB:
- bracketNesting++;
- break;
+ case '[': //Token.LB:
+ bracketNesting++;
+ break;
- case ']': //Token.RB:
- bracketNesting--;
- break;
+ case ']': //Token.RB:
+ bracketNesting--;
+ break;
- case '(': //Token.LP:
- parensNesting++;
- break;
+ case '(': //Token.LP:
+ parensNesting++;
+ break;
- case ')': //Token.RP:
- parensNesting--;
+ case ')': //Token.RP:
+ parensNesting--;
+ break;
+ }
break;
- }
- switch(token.type) {
-
+
case 'STRN': // used for object lit detection..
if (this.ts.lookTok(-1).data == "{" && this.ts.lookTok(1).data == ":" ) {
// then we are in an object lit.. -> we need to flag the brace as such...
break;
-
-
- /*
- case Token.SPECIALCOMMENT:
- if (mode == BUILDING_SYMBOL_TREE) {
- protectScopeFromObfuscation(currentScope);
- this.warn("Using JScript conditional comments is not recommended." + (munge ? " Moreover, using JScript conditional comments reduces the level of compression!" : ""), true);
- }
- break;
- */
+
+
case 'NAME':
symbol = token.data;
//println("<B>EID</B>");
- case 'KEYW':
+ case 'KEYW':
+
+ if (token.name == "FUNCTION") {
+
+ this.parseFunctionDeclaration();
+ break;
+ }
+
+
+
symbol = token.data;
if (this.mode == 'BUILDING_SYMBOL_TREE') {