fix(lanzou): optimize RemoveJSComment function to improve comment removal logic

This commit is contained in:
MadDogOwner 2025-04-16 06:01:00 +08:00
parent c088f64567
commit 8b6fb5ed11
No known key found for this signature in database
GPG Key ID: 0730AD911EB33562

View File

@ -92,11 +92,8 @@ func RemoveJSComment(data string) string {
result.WriteByte(v)
continue
}
if inComment {
if v == '*' && i+1 < len(data) && data[i+1] == '/' {
inComment = false
i++
}
if inComment && v == '*' && i+1 < len(data) && data[i+1] == '/' {
inComment = false
continue
}
if v == '/' && i+1 < len(data) {