Re: do any host object implementations define [[DefaultValue]]??

2011-02-09 Thread Boris Zbarsky

On 2/9/11 4:20 PM, Allen Wirfs-Brock wrote:

If any browser host objects implementation do have unique  [[DefaultValue]] 
implementations do they do anything other than the equivalent of calling their 
toString or valueOf methods?


If I'm reading the code right (and I could well not be!), Gecko's JS 
reflections of NPAPI-provided stuff have a [[DefaultValue]] that 
purposefully does not call valueOf (see 
http://hg.mozilla.org/mozilla-central/file/280e978fc6fb/modules/plugin/base/src/nsJSNPRuntime.cpp#l1686).


There's also some weirdness with NPAPI stuff at 
.


Also, arbitrary XPConnect objects could define a custom [[DefaultValue]] 
via their classinfo in Gecko (though as far as I can tell none of the 
ones we ship in the browser by default do; who knows about extensions).


XPConnect objects without classinfo also use a custom [[DefaultValue]] 
defined at 
http://hg.mozilla.org/mozilla-central/file/280e978fc6fb/js/src/xpconnect/src/xpcwrappednativejsops.cpp#l540


I don't know what other host objects we might have around that use a 
non-default [[DefaultValue]]; it's a little hard to look through the 
code for this in Gecko, unfortunately.  :(


Of the above, I believe the NPAPI bits are web-exposed and the rest are 
not (again, modulo whatever extensions do).


-Boris
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


do any host object implementations define [[DefaultValue]]??

2011-02-09 Thread Allen Wirfs-Brock
The ES5 spec. defines [[DefaultValue]] as an internal method but all objects 
defined by the specification use the default implementation specified in 8.12.8.

Presumably the only reason this algorithm needs to be an "internal method" 
rather than an "abstract operation" is to allow the possibility that some host 
objects have different definitions of it.  Does this actually occur in browser 
implementations?

[[DefaultValue]] itself is only directly called from ToPrimitive (9.1).  
[[DefaultValue]]'s implementation essentially reduces to calls to either or 
both of the toString and valueOf methods of its this object.  If any browser 
host objects implementation do have unique  [[DefaultValue]] implementations do 
they do anything other than the equivalent of calling their toString or valueOf 
methods?

You can probably guess whats behind these questions?  Is [[DefaultValue]] 
really an essential part of the ECMAScript internal meta-object protocol?

Allen
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: do-while grammar

2011-02-09 Thread Oliver Hunt

On Feb 9, 2011, at 12:35 AM, Peter van der Zee wrote:

> Fwiw I don't recall any specific cases of input accepted by browsers which 
> shouldn't parse according to the spec, other than functions in statements. 
> Even "callable regular expressions" are fine as far as the grammar goes. I 
> don't have an extensive test suite for regular expressions or strict mode 
> though. Not yet, anyways.

WebKit nightlies don't allow callable RegExps anymore -- I haven't yet heard of 
any fallout from this change.

> 
> The do-while case should indeed not have ASI applied unless allowed by 7.9.1 
> (so the given test case should fail). I think this is assumed, but it wasn't 
> explicitly stated in the thread.
> 
> - peter
> ___
> es-discuss mailing list
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss

___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: do-while grammar

2011-02-09 Thread Peter van der Zee
Fwiw I don't recall any specific cases of input accepted by browsers which
shouldn't parse according to the spec, other than functions in statements.
Even "callable regular expressions" are fine as far as the grammar goes. I
don't have an extensive test suite for regular expressions or strict mode
though. Not yet, anyways.

The do-while case should indeed not have ASI applied unless allowed by 7.9.1
(so the given test case should fail). I think this is assumed, but it wasn't
explicitly stated in the thread.

- peter
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: do-while grammar

2011-02-09 Thread Gavin Barraclough
On Feb 8, 2011, at 3:35 PM, André Bargull wrote:

> new RegExp("(z)((a+)?(b+)?(c))*").exec("zaacbbbcac")
> => Wrong result in Safari/IE
> 
> new RegExp("(.*?)a(?!(a+)b\\2c)
> => Wrong result in Safari/IE

FYI these should be fixed in Safari with a WebKit nightly build.

cheers,
G.

___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss