Commit graph

6 commits

Author SHA1 Message Date
Alexandre Emsenhuber
63176b99b7 Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: I1deb70318d01a257b51948ba806d80cd1a239f4f
2012-05-04 08:47:07 +02:00
Brion Vibber
72ba305da4 * (bug 31187) Fix for user JavaScript validation to allow identifiers with valid Unicode letter characters
Followup r91591, r93020: patch to jsminplus to support Unicode chars and char escapes in identifiers

Fast-path check keeps runtime about the same on most scripts (eg jquery.js parsing was abround 4100ms both before and after on my test machine)
Slow-path code kicks in if plain ASCII word chars don't extend all the way to the next whitespace or punctuation char.
Using PCRE's Unicode properties magic to ensure that we're catching everything, following ECMA-262 edition 5.1 spec.

Note that identifiers using escapes don't get normalized to their UTF-8 form; this might be a nice thing to do as it saves a couple bytes, but currently there's no change made to output.


Added QUnit tests to verify that unicode letter & escapes work in identifiers in all supported browsers (ok back to IE 6, yay)
2011-09-27 22:51:36 +00:00
Platonides
1a6fed0dd7 Update JSMin+ to the newly released 1.4
This upstream release incorporates r92560 and r92563
2011-07-24 21:46:51 +00:00
Platonides
078057888a Expand the defines from JSTokenizer::__construct() placing them at the top of the file.
This fixes the Notices that would be produced if several JSTokenizer were instantiated.
jsminplus was added in r91591.

Defines code was generated with:
$js = new JSTokenizer();
foreach ($js->opTypeNames as $operand => $name) echo "define('OP_$name', '$operand');\n";
foreach ($js->keywords as $keyword) echo "define('KEYWORD_" . strtoupper($keyword) . "', '$keyword');\n";
2011-07-19 20:03:41 +00:00
Platonides
6bb98564f5 Remove double ; and final ?> from jsminplus (imported in r91591).
This should be uncontroversial.
2011-07-19 19:53:00 +00:00
Brion Vibber
12ccca0349 Followup r83885: add JSMin+ 1.3 to use its parser to verify output of JavaScriptMinifierTest unit test cases. Had to change some of the test cases because they were not valid JavaScript programs -- one of the quoting tests was incorrectly quoted in the PHP sources, and several tests around return, continue, and break keywords failed due to not using them in the contexts that they require.
http://crisp.tweakblogs.net/blog/1856/jsmin+-version-13.html
JSMin+ under MPL 1.1/ GPL 2.0 / LGPL 2.1 license.
2011-07-06 20:02:10 +00:00