mirror of
https://github.com/robertkrimen/otto
synced 2025-10-26 20:28:49 +08:00
Fix broken (panicking) RegExp transformations
Transformations would panic on some edge (error) cases:
\u0z
\x_
This commit is contained in:
@@ -58,6 +58,7 @@ func TestTransformRegExp(t *testing.T) {
|
||||
|
||||
Is(transformRegExp(`\\|'|\r|\n|\t|\u2028|\u2029`), `\\|'|\r|\n|\t|\x{2028}|\x{2029}`)
|
||||
Is(transformRegExp(`\x`), `x`)
|
||||
Is(transformRegExp(`\u0z01\x\undefined`), `u0z01xundefined`)
|
||||
}
|
||||
|
||||
func TestIsValidRegExp(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user