[Webkit-unassigned] [Bug 41614] RegExp constructor should throw a SyntaxError if invalid flags are specified

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Aug 9 01:09:20 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=41614





--- Comment #6 from Kent Hansen <kent.hansen at nokia.com>  2010-08-09 01:09:19 PST ---
(In reply to comment #4)
> (From update of attachment 62187 [details])
> provisional r- -- if you can convince me that the "error" constructor is necessary i'll r+ this, but currently it seems really hacky.
> 
> JavaScriptCore/runtime/RegExpCache.cpp:40
>  +          return RegExp::createWithInvalidFlags();
> Why return a new "magic" regexp rather than null?

So that existing code that calls lookupOrCreate() can remain the same. No need to check for a null-RegExp (without information about what went wrong); instead isValid() and errorMessage() is used, just as with other types of RegExp construction errors. This is what I was trying to highlight in the last paragraph of comment #2.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list