catapult-project / catapult

Deprecated Catapult GitHub. Please instead use http://crbug.com "Speed>Benchmarks" component for bugs and https://chromium.googlesource.com/catapult for downloading and editing source code..
https://chromium.googlesource.com/catapult
BSD 3-Clause "New" or "Revised" License
1.91k stars 562 forks source link

All strings starting with '//' are removed not only the C-style comments #4617

Open jnejati opened 5 years ago

jnejati commented 5 years ago

In transformers.go--> NewScriptInjector: // Remove C-style comments. script = jsMultilineCommentRE.ReplaceAllLiteral(script, []byte("")) script = jsSinglelineCommentRE.ReplaceAllLiteral(script, []byte("")) for oldstr, newstr := range replacements { script = bytes.Replace(script, []byte(oldstr), []byte(newstr), -1) } Removes all '//' whether they are comments or not. e.g. endpoint = "http://example.com/index.php" is transformed to endpoint = "http:"