# HG changeset patch # User Matthew Wild # Date 1274969098 -3600 # Node ID f42b3815ce775e05c000b8f48179df715cf8f5ea # Parent 15c48274ee1f21fbe1f5764d94f387e7e5818676 uglify: Fix logic that determines whether we can uglify a file diff -r 15c48274ee1f -r f42b3815ce77 uglify/squish.uglify.lua --- a/uglify/squish.uglify.lua Thu May 27 15:01:52 2010 +0100 +++ b/uglify/squish.uglify.lua Thu May 27 15:04:58 2010 +0100 @@ -29,10 +29,10 @@ end - while base_char + #keywords < 255 and code:find("["..string.char(base_char).."-"..string.char(base_char+#keywords-1).."]") do + while base_char + #keywords <= 255 and code:find("["..string.char(base_char).."-"..string.char(base_char+#keywords-1).."]") do base_char = base_char + 1; end - if base_char == 255 then + if base_char + #keywords > 255 then -- Sorry, can't uglify this file :( -- We /could/ use a multi-byte marker, but that would complicate -- things and lower the compression ratio (there are quite a few @@ -57,7 +57,7 @@ llex.llex() local seminfo = llex.seminfo; - if opts.uglify_level == "full" then + if opts.uglify_level == "full" and base_char+#keywords < 255 then -- Find longest TK_NAME and TK_STRING tokens local scores = {}; for k,v in ipairs(llex.tok) do