Re: Bug: Reflect.ownKeys(function() {}) differs in V8 strict mode than other cases

2016-09-06 Thread Alex Vincent
Based on your feedback, I've filed https://bugzilla.mozilla.org/show_bug.cgi?id=1300793 . Thanks for your help. On Mon, Sep 5, 2016 at 6:21 PM, Mark S. Miller wrote: > Besides those two, the only other reference to > AddRestrictedFunctionProperties is

Re: Bug: Reflect.ownKeys(function() {}) differs in V8 strict mode than other cases

2016-09-05 Thread Oriol Bugzilla
> So if all my code is in strict mode, and I get a non-strict code function to > shadow as Tom and I were talking about in another thread... how do I even > test for that if my code is either consistently strict or consistently > non-strict? Don't check that. The target could have other

Re: Bug: Reflect.ownKeys(function() {}) differs in V8 strict mode than other cases

2016-09-05 Thread Alex Vincent
Ugh!! It's a trap! (In the Star Wars sense, not the proxy sense.) So if all my code is in strict mode, and I get a non-strict code function to shadow as Tom and I were talking about in another thread... how do I even test for that if my code is either consistently strict or consistently

Re: Bug: Reflect.ownKeys(function() {}) differs in V8 strict mode than other cases

2016-09-05 Thread Caitlin Potter
Ah, my bad, you’re right — they only expose the accessors on the prototype, so they’re in the clear. But yeah, there’s no requirement one way or the other (other than re: web compat) for the properties being there in sloppy mode. > On Sep 5, 2016, at 9:20 PM, Oriol Bugzilla

Re: Re: Bug: Reflect.ownKeys(function() {}) differs in V8 strict mode than other cases

2016-09-05 Thread Caitlin Potter
Web compat enforces adding them in sloppy mode. My understanding of what he’s saying is that V8 “incorrectly” omits these own properties from strict functions, which is correct per spec. signature.asc Description: Message signed with OpenPGP using GPGMail

Re: Bug: Reflect.ownKeys(function() {}) differs in V8 strict mode than other cases

2016-09-05 Thread Mark S. Miller
Besides those two, the only other reference to AddRestrictedFunctionProperties is < http://www.ecma-international.org/ecma-262/7.0/#sec-createintrinsics> step 12: 12. Perform AddRestrictedFunctionProperties

Re: Bug: Reflect.ownKeys(function() {}) differs in V8 strict mode than other cases

2016-09-05 Thread Oriol Bugzilla
> Mozilla's approach violates ECMAScript's forbidden extensions and can't be > considered "correct" Why? The spec forbids adding "caller" or "arguments" in strict mode. I think it does not enforce adding them in sloppy mode. Chrome seems to add them only in sloppy mode, and Firefox to never

Re: Bug: Reflect.ownKeys(function() {}) differs in V8 strict mode than other cases

2016-09-05 Thread Caitlin Potter
The part that matters here is in annex B: http://www.ecma-international.org/ecma-262/7.0/#sec-forbidden-extensions This forbids functions in strict code from having own properties "caller" or "arguments". Newer function kinds have these restrictions in sloppy mode. AddRestricted... adds the

Bug: Reflect.ownKeys(function() {}) differs in V8 strict mode than other cases

2016-09-05 Thread Alex Vincent
"use strict" function A() {} function B() {} window.onload = function() { let a = Reflect.ownKeys(A); let b = Reflect.ownKeys(B); document.getElementById("output").value = (a.includes("arguments") === b.includes("arguments")); } Mozilla Firefox reports