Bug 163431

Summary: test262: Failure with RegExp.prototype.compile when pattern is undefined
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: JavaScriptCoreAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, keith_miller, mark.lam, msaboff, saam
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
[PATCH] Proposed Fix none

Description Joseph Pecoraro 2016-10-14 00:33:08 PDT
test262: Failure with RegExp.prototype.compile when pattern is undefined

regexp.compile(undefined) should be the same as regexp.compile("")
Currently we treat it like regexp.compile("undefined")

> esid: sec-regexp.prototype.compile
> es6id: B.2.5.1
> description: Behavior when pattern is undefined
> info: |
>     [...]
>     3. If Type(pattern) is Object and pattern has a [[RegExpMatcher]] internal
>        slot, then
>        [...]
>     4. Else,
>        a. Let P be pattern.
>        b. Let F be flags.
>     5. Return ? RegExpInitialize(O, P, F).
> 
>     21.2.3.2.2 Runtime Semantics: RegExpInitialize
> 
>     1. If pattern is undefined, let P be the empty String.
>     [...]
Comment 1 Joseph Pecoraro 2016-10-14 00:36:48 PDT
Created attachment 291585 [details]
[PATCH] Proposed Fix
Comment 2 Yusuke Suzuki 2016-10-14 00:42:39 PDT
Comment on attachment 291585 [details]
[PATCH] Proposed Fix

r=me
Comment 3 WebKit Commit Bot 2016-10-14 03:07:20 PDT
Comment on attachment 291585 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 291585

Committed r207334: <http://trac.webkit.org/changeset/207334>
Comment 4 WebKit Commit Bot 2016-10-14 03:07:24 PDT
All reviewed patches have been landed.  Closing bug.