[Webkit-unassigned] [Bug 28117] Native JSON.stringify does not omit functions

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Aug 13 04:40:10 PDT 2009


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


kangax <kangax at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kangax at gmail.com




--- Comment #19 from kangax <kangax at gmail.com>  2009-08-13 04:40:09 PDT ---
(In reply to comment #18)
> (In reply to comment #17)
[...]
> > Firefox is not conforming in this regard.  Arguing will not accopmlish anything
> > as it is pointless to add a slow check which will break behaviour relative to
> > json2, just to handle the specific case of RegExps, when there are numerous
> > other disagreements between different runtimes as to which objects are callable
> > (NodeLists anyone?), especially given the serialisation of RegExps is unhelpful
> > in either case.
> > 
> > If you feel really strongly about this, i suggest you go to
> > http://bugs.mozilla.org and file a bug on the spidermonkey RegExp object
> > incorrectly reporting typeof as "object" and claiming not to be callable.
> 
> Well, as I said above, as far as I can tell, the spec says that RegExp is not
> callable, in the sense that the internal [[Call]] property is not defined,
> IsCallable will return false and thus at the language level, typeof should
> return 'object', and stringify should not ignore it.

Yes, at the "language level" `RegExp` objects don't have [[Call]], but don't
forget that ES3 allows implementations to extend language and still be
considered conforming. Quoting section 2:

| A conforming implementation of ECMAScript is permitted to provide 
| additional types, values, objects, properties, and functions beyond those
| described in this specification. In particular, a conforming implementation
| of ECMAScript is permitted to provide properties not described in this
| specification, and values for those properties, for objects that are
| described in this specification.

So here we are with a conforming implementation that adds [[Call]] to RegExp
objects. Note that nowhere does ES3 explicitly disallow for `RegExp` objects to
have [[Call]] as it does for, say, `Math` or "Global object".

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