[Webkit-unassigned] [Bug 32458] /g regex Literals do not save state across function invocations

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Dec 12 07:53:17 PST 2009


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


Joseph Pecoraro <joepeck at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID
                 CC|                            |joepeck at webkit.org




--- Comment #2 from Joseph Pecoraro <joepeck at webkit.org>  2009-12-12 07:53:17 PST ---
(In reply to comment #1)
> Brendan isn't our behaviour consistent with that expected from ES5?

Oliver, you are correct. I talked to the person (on IRC) that originally found
this  and he mentioned that this may be ES5 behavior.

>From the ES5 spec's section on "Changes from ES3" there is:
7.8.5: Regular expression literals now return a unique object each time the
literal is evaluated. This change is detectable by any programs that test the
object identity of such literal values or that are sensitive to the shared side
effects.

Old ES3 Text:
A regular expression literal is an input element that is converted to a RegExp
object (section 15.10) when it is scanned. The object is created before
evaluation of the containing program or function begins. Evaluation of the
literal produces a reference to that object; it does not create a new object.

ES5 Text:
A regular expression literal is an input element that is converted to a RegExp
object (see 15.10) each time the literal is evaluated.

Thanks, I'm closing this as INVALID, because it works correctly.

-- 
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