<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>177813</bug_id>
          
          <creation_ts>2017-10-03 07:22:19 -0700</creation_ts>
          <short_desc>RegExp non-standard properties are inconsistent with other browsers</short_desc>
          <delta_ts>2022-02-06 13:34:39 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>220233</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Rick Byers">rbyers</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ashvayka</cc>
    
    <cc>benjamin</cc>
    
    <cc>cdumez</cc>
    
    <cc>msaboff</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1355805</commentid>
    <comment_count>0</comment_count>
    <who name="Rick Byers">rbyers</who>
    <bug_when>2017-10-03 07:22:19 -0700</bug_when>
    <thetext>The non-standard properties on RegExp (eg. lastMatch, lastParen, leftContext, rightContext) are data properties in Safari, but accessor properties in current versions of Chrome, Firefox and Edge.  Here&apos;s a simple repro: http://output.jsbin.com/yubojom

On Chrome, Edge and Firefox it prints:
RegExp.lastMatch: get,set,enumerable,configurable
RegExp.lastParen: get,set,enumerable,configurable
RegExp.leftContext: get,set,enumerable,configurable
RegExp.rightContext: get,set,enumerable,configurable

On Safari it prints:
RegExp.lastMatch: value,writable,enumerable,configurable
RegExp.lastParen: value,writable,enumerable,configurable
RegExp.leftContext: value,writable,enumerable,configurable
RegExp.rightContext: value,writable,enumerable,configurable

Unfortunately, despite being widely supported, these APIs do not appear to be standardized (https://tc39.github.io/ecma262/#sec-regexp-constructor).  The difference is unlikely to matter much in practice, but in theory it could cause interop issue.  One specific (though rather special) example is here: https://github.com/GoogleChrome/confluence/issues/202.  If it&apos;s trivial for JSC to change to match the other JS engines, perhaps it&apos;s worth doing?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1355806</commentid>
    <comment_count>1</comment_count>
    <who name="Rick Byers">rbyers</who>
    <bug_when>2017-10-03 07:27:50 -0700</bug_when>
    <thetext>Sorry, correction.  They&apos;re data accessors on Edge 15 as well, they&apos;re just writable=true where safari is writable=false.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1357965</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2017-10-07 16:07:34 -0700</bug_when>
    <thetext>&lt;rdar://problem/34873681&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1837942</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Shvayka">ashvayka</who>
    <bug_when>2022-02-06 13:34:39 -0800</bug_when>
    <thetext>(In reply to Rick Byers from comment #0)
&gt; Unfortunately, despite being widely supported, these APIs do not appear to
&gt; be standardized (https://tc39.github.io/ecma262/#sec-regexp-constructor). 
&gt; The difference is unlikely to matter much in practice, but in theory it
&gt; could cause interop issue.  One specific (though rather special) example is
&gt; here: https://github.com/GoogleChrome/confluence/issues/202.  If it&apos;s
&gt; trivial for JSC to change to match the other JS engines, perhaps it&apos;s worth
&gt; doing?

Thanks for the report. These APIs are now being standardized (https://github.com/tc39/proposal-regexp-legacy-features) as an accessors, and were implemented as such in r280460.

*** This bug has been marked as a duplicate of bug 220233 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>