fn check_js_regex_syntax(cx: JSContext, pattern: &str) -> bool
Check if the pattern by itself is valid first, and not that it only becomes valid once we add ^(?: and )$.