Re: Proposal: strict built-in functions

2019-12-09 Thread Mark S. Miller
Thanks Claude, I agree. I have added it to the agenda as well.
https://github.com/tc39/agendas/blob/master/2020/02.md



On Mon, Dec 9, 2019 at 12:45 AM Claude Pache  wrote:

>
>
> Le 8 déc. 2019 à 15:39, Mark S. Miller  a écrit :
>
> Wow, Edge is definitely in violation of the intent of the spec, and the
> intent of the history of treatments of .caller in previous discussions and
> specs over the years. The Edge behavior is grossly unsafe.
>
> Hi Jack, thanks for catching this and raising it!! It does need to be
> fixed. I do think it can be a PR because the historical intent was clear.
> Since the FF behavior is correct, the correct behavior is web compat, so we
> should be able to handle this in a PR.
>
> Whether a PR or a full proposal, in either case I'm happy to take this to
> the committee. I invested years of my life killing non-sloppy
> function.caller. I can spend a little more ;)
>
>
> Hi Mark,
>
> I think it is time to revive https://github.com/tc39/ecma262/issues/562 and
> its associated repo
> https://github.com/claudepache/es-legacy-function-reflection.
>
> —Claude
>
>
>

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


Re: Proposal: strict built-in functions

2019-12-09 Thread Claude Pache


> Le 8 déc. 2019 à 15:39, Mark S. Miller  a écrit :
> 
> Wow, Edge is definitely in violation of the intent of the spec, and the 
> intent of the history of treatments of .caller in previous discussions and 
> specs over the years. The Edge behavior is grossly unsafe.
> 
> Hi Jack, thanks for catching this and raising it!! It does need to be fixed. 
> I do think it can be a PR because the historical intent was clear. Since the 
> FF behavior is correct, the correct behavior is web compat, so we should be 
> able to handle this in a PR.
> 
> Whether a PR or a full proposal, in either case I'm happy to take this to the 
> committee. I invested years of my life killing non-sloppy function.caller. I 
> can spend a little more ;)

Hi Mark,

I think it is time to revive https://github.com/tc39/ecma262/issues/562 
 and its associated repo 
https://github.com/claudepache/es-legacy-function-reflection 
.

—Claude


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


Re: Proposal: strict built-in functions

2019-12-09 Thread Claude Pache


> Le 8 déc. 2019 à 20:49, Jack Works  a écrit :
> 
> I thought the "caller" has been removed from the spec, so there isn't much to 
> do with the "caller" since it is not standard. It's implementation's own 
> extension.
> But maybe we can also extend The forbidden extensions section.

The `caller` property of functions (not to be confused with the `caller` 
property of the `arguments` object, which is indeed dead) has never been in the 
spec, except some restrictions in the [Forbidden Extensions] section introduced 
at the same time as strict-mode functions. And the problem is, precisely, that 
it is underspecified.

Now, it is indeed almost trivial to resolve spec-wise *the particular* issue 
you noted, by amending the [Forbidden Extensions] section: Just find the bullet 
that begins with “If an implementation extends any function object with an own 
property named "caller"...”, and replace therein all occurrences of “strict 
function” with “strict function or built-in function” (or maybe with “anything 
but a non-strict function”). That, however, is not the most 
implementation-friendly way, because that leaves up to them to guess what to do 
instead (return null, throw an error, etc.), that will not break the web for 
their users. 

Moreover, the `caller` property has most probably some other gotchas; one of 
them I recall to have noted some time ago, is that, in at least one 
implementation, it is publicised as a non-writable, non-configurable own data 
property, but it may change its value.

I think that it is better, at this point, to specify Function#caller and 
Function#arguments, as proposed in [gh-issue 562].

[Forbidden Extensions]: https://tc39.es/ecma262/#sec-forbidden-extensions 
<https://tc39.es/ecma262/#sec-forbidden-extensions>
[gh-issue 562]: https://github.com/tc39/ecma262/issues/562 
<https://github.com/tc39/ecma262/issues/562>

—Claude


> 
> On Mon, Dec 9, 2019, 1:12 AM Claude Pache  <mailto:claude.pa...@gmail.com>> wrote:
> 
> 
>> Le 8 déc. 2019 à 14:43, Jack Works > <mailto:zjwpe...@gmail.com>> a écrit :
>> 
>> 
>> In the current spec, strictness of the built-in functions are 
>> implementation-dependent behaviors. This proposal is going to fix this 
>> problem.
>> https://github.com/Jack-Works/proposal-strict-built-in-functions 
>> <https://github.com/Jack-Works/proposal-strict-built-in-functions>
>> 
> 
> Hi,
> 
> See https://github.com/tc39/ecma262/issues/562#issuecomment-218531285 
> <https://github.com/tc39/ecma262/issues/562#issuecomment-218531285> for 
> another  testcase. 
> 
> The real problem is that the semantics of `f.caller` is left to 
> implementations. There are in fact some restrictions in the spec, see 
> https://tc39.es/ecma262/#sec-forbidden-extensions 
> <https://tc39.es/ecma262/#sec-forbidden-extensions>, but they are 
> insufficient.
> 
> Note that it doesn’t really make sense to mandate that builtin functions be 
> “strict”: The notion of strictness is defined only for so-called ECMAScript 
> functions, which are functions whose implementation is written in ECMAScript 
> code. That excludes builtin functions (unless the implementation choose to  
> implement them in ECMAScript), but also bound functions, proxies, and 
> probably some other cases. 
> 
> —Claude

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


Re: Proposal: strict built-in functions

2019-12-08 Thread Jack Works
I thought the "caller" has been removed from the spec, so there isn't much
to do with the "caller" since it is not standard. It's implementation's own
extension.
But maybe we can also extend The forbidden extensions section.

On Mon, Dec 9, 2019, 1:12 AM Claude Pache  wrote:

>
>
> Le 8 déc. 2019 à 14:43, Jack Works  a écrit :
>
> 
> In the current spec, strictness of the built-in functions are
> implementation-dependent behaviors. This proposal is going to fix this
> problem.
> https://github.com/Jack-Works/proposal-strict-built-in-functions
>
>
> Hi,
>
> See https://github.com/tc39/ecma262/issues/562#issuecomment-218531285 for 
> another
>  testcase.
>
> The real problem is that the semantics of `f.caller` is left to
> implementations. There are in fact some restrictions in the spec, see
> https://tc39.es/ecma262/#sec-forbidden-extensions, but they are
> insufficient.
>
> Note that it doesn’t really make sense to mandate that builtin functions
> be “strict”: The notion of strictness is defined only for so-called
> ECMAScript functions, which are functions whose implementation is written
> in ECMAScript code. That excludes builtin functions (unless the
> implementation choose to  implement them in ECMAScript), but also bound
> functions, proxies, and probably some other cases.
>
> —Claude
>
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: Proposal: strict built-in functions

2019-12-08 Thread Claude Pache


>> Le 8 déc. 2019 à 14:43, Jack Works  a écrit :
> 
> In the current spec, strictness of the built-in functions are 
> implementation-dependent behaviors. This proposal is going to fix this 
> problem.
> https://github.com/Jack-Works/proposal-strict-built-in-functions
> 

Hi,

See https://github.com/tc39/ecma262/issues/562#issuecomment-218531285 for 
another  testcase. 

The real problem is that the semantics of `f.caller` is left to 
implementations. There are in fact some restrictions in the spec, see 
https://tc39.es/ecma262/#sec-forbidden-extensions, but they are insufficient.

Note that it doesn’t really make sense to mandate that builtin functions be 
“strict”: The notion of strictness is defined only for so-called ECMAScript 
functions, which are functions whose implementation is written in ECMAScript 
code. That excludes builtin functions (unless the implementation choose to  
implement them in ECMAScript), but also bound functions, proxies, and probably 
some other cases. 

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


Re: Proposal: strict built-in functions

2019-12-08 Thread Mark S. Miller
Wow, Edge is definitely in violation of the intent of the spec, and the
intent of the history of treatments of .caller in previous discussions and
specs over the years. The Edge behavior is grossly unsafe.

Hi Jack, thanks for catching this and raising it!! It does need to be
fixed. I do think it can be a PR because the historical intent was clear.
Since the FF behavior is correct, the correct behavior is web compat, so we
should be able to handle this in a PR.

Whether a PR or a full proposal, in either case I'm happy to take this to
the committee. I invested years of my life killing non-sloppy
function.caller. I can spend a little more ;)




On Sun, Dec 8, 2019 at 5:52 AM Jack Works  wrote:

> It is a runtime level change. I think it might break some code that
> depends on the strictness of the built-in function like code that using
> func.caller.
>
> On Sun, Dec 8, 2019, 9:48 PM Isiah Meadows 
> wrote:
>
>> You might do better to file a pull request directly against the spec for
>> this: https://github.com/tc39/ecma262. To me, it looks more like an
>> oversight, not something that would likely have to go through all 4 stages.
>> (If it does, at least you already have a repo for it.)
>>
>> On Sun, Dec 8, 2019 at 08:43 Jack Works  wrote:
>>
>>> In the current spec, strictness of the built-in functions are
>>> implementation-dependent behaviors. This proposal is going to fix this
>>> problem.
>>> https://github.com/Jack-Works/proposal-strict-built-in-functions
>>>
>>> ___
>>> es-discuss mailing list
>>> es-discuss@mozilla.org
>>> https://mail.mozilla.org/listinfo/es-discuss
>>>
>> --
>> -
>>
>> Isiah Meadows
>> cont...@isiahmeadows.com
>> www.isiahmeadows.com
>>
> ___
> es-discuss mailing list
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>


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


Re: Proposal: strict built-in functions

2019-12-08 Thread Jack Works
It is a runtime level change. I think it might break some code that depends
on the strictness of the built-in function like code that using func.caller.

On Sun, Dec 8, 2019, 9:48 PM Isiah Meadows  wrote:

> You might do better to file a pull request directly against the spec for
> this: https://github.com/tc39/ecma262. To me, it looks more like an
> oversight, not something that would likely have to go through all 4 stages.
> (If it does, at least you already have a repo for it.)
>
> On Sun, Dec 8, 2019 at 08:43 Jack Works  wrote:
>
>> In the current spec, strictness of the built-in functions are
>> implementation-dependent behaviors. This proposal is going to fix this
>> problem.
>> https://github.com/Jack-Works/proposal-strict-built-in-functions
>>
>> ___
>> es-discuss mailing list
>> es-discuss@mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss
>>
> --
> -
>
> Isiah Meadows
> cont...@isiahmeadows.com
> www.isiahmeadows.com
>
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: Proposal: strict built-in functions

2019-12-08 Thread Isiah Meadows
You might do better to file a pull request directly against the spec for
this: https://github.com/tc39/ecma262. To me, it looks more like an
oversight, not something that would likely have to go through all 4 stages.
(If it does, at least you already have a repo for it.)

On Sun, Dec 8, 2019 at 08:43 Jack Works  wrote:

> In the current spec, strictness of the built-in functions are
> implementation-dependent behaviors. This proposal is going to fix this
> problem.
> https://github.com/Jack-Works/proposal-strict-built-in-functions
>
> ___
> es-discuss mailing list
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-- 
-

Isiah Meadows
cont...@isiahmeadows.com
www.isiahmeadows.com
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Proposal: strict built-in functions

2019-12-08 Thread Jack Works
In the current spec, strictness of the built-in functions are
implementation-dependent behaviors. This proposal is going to fix this
problem.
https://github.com/Jack-Works/proposal-strict-built-in-functions
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss