Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #20338

Re: Identifying a regex

From Stefan Weiss <krewecherl@gmail.com>
Newsgroups comp.lang.javascript
Subject Re: Identifying a regex
Date 2013-06-18 23:58 +0200
Organization albasani.net
Message-ID <kpql60$kma$1@news.albasani.net> (permalink)
References (2 earlier) <kpmu20$5q5$1@news.albasani.net> <f623b8ea-0bf3-429d-b04b-903627edfa1e@a8g2000yqp.googlegroups.com> <2138020.VnviE1jULI@PointedEars.de> <kpq833$o40$1@news.albasani.net> <4497153.IWULeidUyA@PointedEars.de>

Show all headers | View raw


On 2013-06-18 21:39, Thomas 'PointedEars' Lahn wrote:
> Stefan Weiss wrote:
>> The old comparison method in your regexp.js (rev 361) is not the same as
>> option (B), however: comparing the constructor property directly with
>> RegExp does not work across frames, but comparing constructor.name with
>> "RegExp" does (as long as nobody messed with the constructor directly).
> 
> I am not convinced that constructor.name is interoperable in the first 
> place.  The ECMAScript Support Matrix, Version 2, contains a testcase for 
> Function.prototype.name that has been recently run (by someone else – thank 
> you) to fail in JavaScript 1.8.6 and JScript 10.0.16578.  But that might be 
> due to “name” being a property of Function instances only in those 
> implementations.  I shall modify that testcase accordingly.
> 
> <http://PointedEars.de/es-matrix/?filter=Function.prototype.name#features-table>
> 
> That said, neither Function.prototype.name nor functionInstance.name are 
> specified in the ECMAScript Language Specification, 5.1 Edition, §15.3, so 
> they are very likely not interoperable.

Good point (also made by Andreas Bergmaier earlier in the thread).
That's enough to disqualify this option.

Unfortunately, the test using Object.prototype.toString is not
completely interoperable, either. In IE8, it works as expected across
iframes (and regular old-fashioned frames). Across windows, it returns
"[object Object]" instead of "[object RegExp]". The same applies to
other types (function, array, date).

A simple test page:

  http://foo.at/paste/2013/test_re.html

I currently have no way of testing this with more recent versions of IE,
but would be interested in the results.


- stefan

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Identifying a regex Stefan Weiss <krewecherl@gmail.com> - 2013-06-17 01:47 +0200
  Re: Identifying a regex "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2013-06-16 19:30 -0700
    Re: Identifying a regex Stefan Weiss <krewecherl@gmail.com> - 2013-06-17 14:05 +0200
      Re: Identifying a regex "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2013-06-17 16:16 -0700
        Re: Identifying a regex Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-18 02:13 +0200
          Re: Identifying a regex Stefan Weiss <krewecherl@gmail.com> - 2013-06-18 20:14 +0200
            Re: Identifying a regex Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-18 21:39 +0200
              Re: Identifying a regex Stefan Weiss <krewecherl@gmail.com> - 2013-06-18 23:58 +0200
                Re: Identifying a regex Stefan Weiss <krewecherl@gmail.com> - 2013-06-25 22:05 +0200
                Re: Identifying a regex "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2013-06-25 16:59 -0700
                Re: Identifying a regex Stefan Weiss <krewecherl@gmail.com> - 2013-06-26 23:47 +0200
              Re: Identifying a regex Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-23 20:01 +0200
        Re: Identifying a regex "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2013-06-18 00:40 -0700
          Re: Identifying a regex Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-18 10:39 +0200
            Re: Identifying a regex "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2013-06-18 19:32 -0700
              Re: Identifying a regex Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-19 14:05 +0200
                Re: Identifying a regex "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2013-06-19 20:24 -0700
                Re: Identifying a regex Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-20 12:27 +0200
                Re: Identifying a regex "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2013-06-20 18:08 -0700
  Re: Identifying a regex JJ <duh@nah.meh> - 2013-06-17 13:58 +0700
    Re: Identifying a regex Stefan Weiss <krewecherl@gmail.com> - 2013-06-17 14:11 +0200
      Re: Identifying a regex JJ <duh@nah.meh> - 2013-06-18 12:46 +0700
        Re: Identifying a regex Stefan Weiss <krewecherl@gmail.com> - 2013-06-18 20:17 +0200
  Re: Identifying a regex Andreas Bergmaier <andber93@web.de> - 2013-06-18 21:14 +0200

csiph-web