Whole file

tikitu/jsmin

The author described this change as Fix for issue #14: handle ECMAScript/Harmony backticks.. It counts as a record because the check below fails on the code as it stood at 11e8c3b5a and passes on 81babc49e, with nothing else changed between the two runs.

Fix saved2014-10-27
Sharing licenceMIT · LICENSE.txt
Change size+5 4

What the code was meant to do, written into the code itself as a save note

Fix for issue #14: handle ECMAScript/Harmony backticks.

The change

9090
9191 space_strings = "abcdefghijklmnopqrstuvwxyz"\
9292 "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$\\"
93- starters, enders = '{[(+-', '}])+-"\''
93+ quotes = "'\"`"
94+ starters, enders = '{[(+-', '}])+-' + quotes
9495 newlinestart_strings = starters + space_strings
9596 newlineend_strings = enders + space_strings
9697 do_newline = False
120121 elif not previous:
121122 return
122123 elif previous >= '!':
123- if previous in "'\"":
124+ if previous in quotes:
124125 in_quote = previous
125126 write(previous)
126127 previous_non_space = previous
219220 if do_newline:
220221 write('\n')
221222 do_newline = False
222-
223+
223224 write(next1)
224- if not in_re and next1 in "'\"":
225+ if not in_re and next1 in quotes:
225226 in_quote = next1
226227 quote_buf = []
227228

The check that tells the two apart

failpass·jsmin/test.py::JsTests::testBackticks

Check file jsmin/test.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before it11e8c3b5ae376e159436b5c475b2be81dc51a211
Broken version dated2014-06-22
Modulejsmin.__init__
Units changedJavascriptMinify
Fingerprint9d404d1b52cc3b78
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in tikitu/jsmin