Skip to content

Commit

Permalink
Merge pull request #48 from Pyton/master
Browse files Browse the repository at this point in the history
UTF Char detection
  • Loading branch information
tedivm committed Jul 4, 2015
2 parents b962064 + 978bd44 commit 688527a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/JShrink/Minifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ protected function saveRegex()
*/
protected static function isAlphaNumeric($char)
{
return preg_match('/^[\w\$]$/', $char) === 1 || $char == '/';
return preg_match('/^[\w\$\pL]$/', $char) === 1 || $char == '/';
}

/**
Expand Down
11 changes: 11 additions & 0 deletions tests/Resources/jshrink/input/utf_chars.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
var π = Math.PI,
ε = 1e-6,
radians = π / 180,
degrees = 180 / π;

function sgn(x) {


var π = Math.PI;
return x > 0 ? 1 : x < 0 ? -1 : 0;
}
1 change: 1 addition & 0 deletions tests/Resources/jshrink/output/utf_chars.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var π=Math.PI,ε=1e-6,radians=π/ 180,degrees=180 / π;function sgn(x){var π=Math.PI;return x>0?1:x<0?-1:0;}

0 comments on commit 688527a

Please sign in to comment.