tag:blogger.com,1999:blog-34454975.post7048121653885248382..comments2023-06-28T16:58:41.189+02:00Comments on Web Reflection: A "little bastard" BUG using JSmin parsersAndrea Giammarchihttp://www.blogger.com/profile/16277820774810688474noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-34454975.post-48836213934515236622008-10-16T01:35:00.000+02:002008-10-16T01:35:00.000+02:00so your suggestion is to add 2 more characters to ...so your suggestion is to add 2 more characters to pass a bug into a minifier ... sounds illogical in my mind, I would not change a perfectly parser error free code for a minifier, adding more bytes, just a personal opinion :PAndrea Giammarchihttps://www.blogger.com/profile/16277820774810688474noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-87447433101981393812008-10-16T00:18:00.000+02:002008-10-16T00:18:00.000+02:00Fix costs 2 bytes: wrap the expression in ():retur...Fix costs 2 bytes: wrap the expression in ():<BR/><BR/>return (/'/);<BR/><BR/>Works fine. :)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-34454975.post-10807715606545981082007-10-04T21:34:00.000+02:002007-10-04T21:34:00.000+02:00increase means change output.if You have a regexp ...increase means change output.<BR/><BR/>if You have a regexp inside a string, a saved information, for example, it will be modified by regexp.<BR/><BR/>regexp is not the solution, at least not the one to solve this JSmin problem that is a char by char parserAndrea Giammarchihttps://www.blogger.com/profile/16277820774810688474noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-16465941131491453532007-10-04T21:32:00.000+02:002007-10-04T21:32:00.000+02:00not my fault :P in the meantime you could write an...not my fault :P <BR/>in the meantime you could write another better parser ...<BR/>:pheasant:kentaromiurahttps://www.blogger.com/profile/01628828429767241919noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-6626826267331739282007-10-04T21:04:00.000+02:002007-10-04T21:04:00.000+02:00that increases output size :/that increases output size :/Andrea Giammarchihttps://www.blogger.com/profile/16277820774810688474noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-42176525883992929782007-10-04T20:46:00.000+02:002007-10-04T20:46:00.000+02:00quick fix :instead of jsmin ("",ImVeryBastard,3)us...quick fix :<BR/>instead of jsmin ("",ImVeryBastard,3)<BR/><BR/>use <BR/>ImVeryBastard.replace(/(\s|=|\()\/[^\/\n]*?('|")[^\/]*?\/(g|i|m|gi|gm|gim|gmi|im|ig|img|igm|mi|mg|mgi|mig)?/,<BR/>"($&)")kentaromiurahttps://www.blogger.com/profile/01628828429767241919noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-46952520853778713822007-10-04T19:00:00.000+02:002007-10-04T19:00:00.000+02:00It seems You missed word simply.I've never said it...It seems You missed word <B>simply</B>.<BR/><BR/>I've never said it's not possibile, I just said this problem seems to be present on every JSmin parser and with JSmin code logic it's not simple to solve (and I've just started to write another personal parser for MyMin project :D)Andrea Giammarchihttps://www.blogger.com/profile/16277820774810688474noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-66888529794563736602007-10-04T18:55:00.000+02:002007-10-04T18:55:00.000+02:00is not true, a parser could parse a thing if it's ...is not true, a parser could parse a thing if it's respect his BNF(backus naur form) .<BR/>if is legacy javascript then is parsable :D i wrote a compiler once and i remember that is not simple but is feasible ;Dkentaromiurahttps://www.blogger.com/profile/01628828429767241919noreply@blogger.com