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.
Projecttikitu/jsmin
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
| 90 | 90 | ||
| 91 | 91 | space_strings = "abcdefghijklmnopqrstuvwxyz"\ | |
| 92 | 92 | "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$\\" | |
| 93 | - | starters, enders = '{[(+-', '}])+-"\'' | |
| 93 | + | quotes = "'\"`" | |
| 94 | + | starters, enders = '{[(+-', '}])+-' + quotes | |
| 94 | 95 | newlinestart_strings = starters + space_strings | |
| 95 | 96 | newlineend_strings = enders + space_strings | |
| 96 | 97 | do_newline = False | |
| ⋯ | |||
| 120 | 121 | elif not previous: | |
| 121 | 122 | return | |
| 122 | 123 | elif previous >= '!': | |
| 123 | - | if previous in "'\"": | |
| 124 | + | if previous in quotes: | |
| 124 | 125 | in_quote = previous | |
| 125 | 126 | write(previous) | |
| 126 | 127 | previous_non_space = previous | |
| ⋯ | |||
| 219 | 220 | if do_newline: | |
| 220 | 221 | write('\n') | |
| 221 | 222 | do_newline = False | |
| 222 | - | ||
| 223 | + | ||
| 223 | 224 | write(next1) | |
| 224 | - | if not in_re and next1 in "'\"": | |
| 225 | + | if not in_re and next1 in quotes: | |
| 225 | 226 | in_quote = next1 | |
| 226 | 227 | quote_buf = [] | |
| 227 | 228 | ||
The check that tells the two apart
fail→pass·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
- 2013-10-18JavascriptMinify
- 2013-05-13JavascriptMinify
- 2013-05-10JavascriptMinify