From: Timo Tijhof Date: Fri, 10 Aug 2018 18:05:42 +0000 (+0100) Subject: JavaScriptMinifier: Disambiguate token constants from state constants X-Git-Tag: 1.34.0-rc.0~4497^2 X-Git-Url: https://git.cyclocoop.org/admin/?a=commitdiff_plain;h=d45f9434271e5de2f12c3bbcfc8f5816528f739d;p=lhc%2Fweb%2Fwiklou.git JavaScriptMinifier: Disambiguate token constants from state constants Makes debugging a bit easier. Bug: T201606 Change-Id: Icc660bc2dfa6af823722dd6567fb185308ac74e7 --- diff --git a/includes/libs/JavaScriptMinifier.php b/includes/libs/JavaScriptMinifier.php index 2e8b5919f4..c1391bf40b 100644 --- a/includes/libs/JavaScriptMinifier.php +++ b/includes/libs/JavaScriptMinifier.php @@ -44,23 +44,23 @@ class JavaScriptMinifier { const PROPERTY_EXPRESSION_FUNC = 15; /* Token types */ - const TYPE_UN_OP = 1; // unary operators - const TYPE_INCR_OP = 2; // ++ and -- - const TYPE_BIN_OP = 3; // binary operators - const TYPE_ADD_OP = 4; // + and - which can be either unary or binary ops - const TYPE_HOOK = 5; // ? - const TYPE_COLON = 6; // : - const TYPE_COMMA = 7; // , - const TYPE_SEMICOLON = 8; // ; - const TYPE_BRACE_OPEN = 9; // { - const TYPE_BRACE_CLOSE = 10; // } - const TYPE_PAREN_OPEN = 11; // ( and [ - const TYPE_PAREN_CLOSE = 12; // ) and ] - const TYPE_RETURN = 13; // keywords: break, continue, return, throw - const TYPE_IF = 14; // keywords: catch, for, with, switch, while, if - const TYPE_DO = 15; // keywords: case, var, finally, else, do, try - const TYPE_FUNC = 16; // keywords: function - const TYPE_LITERAL = 17; // all literals, identifiers and unrecognised tokens + const TYPE_UN_OP = 101; // unary operators + const TYPE_INCR_OP = 102; // ++ and -- + const TYPE_BIN_OP = 103; // binary operators + const TYPE_ADD_OP = 104; // + and - which can be either unary or binary ops + const TYPE_HOOK = 105; // ? + const TYPE_COLON = 106; // : + const TYPE_COMMA = 107; // , + const TYPE_SEMICOLON = 108; // ; + const TYPE_BRACE_OPEN = 109; // { + const TYPE_BRACE_CLOSE = 110; // } + const TYPE_PAREN_OPEN = 111; // ( and [ + const TYPE_PAREN_CLOSE = 112; // ) and ] + const TYPE_RETURN = 113; // keywords: break, continue, return, throw + const TYPE_IF = 114; // keywords: catch, for, with, switch, while, if + const TYPE_DO = 115; // keywords: case, var, finally, else, do, try + const TYPE_FUNC = 116; // keywords: function + const TYPE_LITERAL = 117; // all literals, identifiers and unrecognised tokens // Sanity limit to avoid excessive memory usage const STACK_LIMIT = 1000;