Bug 220610 - REGRESSION(r271119) Check for nullness of preamble.caller
Summary: REGRESSION(r271119) Check for nullness of preamble.caller
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Lauro Moura
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-01-13 16:50 PST by Lauro Moura
Modified: 2021-01-28 12:37 PST (History)
7 users (show)

See Also:


Attachments
Patch (2.88 KB, patch)
2021-01-13 17:18 PST, Lauro Moura
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lauro Moura 2021-01-13 16:50:43 PST
REGRESSION(r271119) Check for nullness of preamble.caller
Comment 1 Lauro Moura 2021-01-13 17:18:11 PST
Created attachment 417586 [details]
Patch
Comment 2 Alexey Shvayka 2021-01-13 22:49:00 PST
Comment on attachment 417586 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=417586&action=review

Thank you for tracking this down!

> LayoutTests/ChangeLog:8
> +        r271119 changed some kinds of functions to return null when trying to

What if partly revert r271119 by removing

    if (!function->jsExecutable()->hasCallerAndArgumentsProperties())
        return JSValue::encode(jsNull());

from `caller` getter to completely align us with the other runtimes?
Comment 3 Lauro Moura 2021-01-14 22:01:36 PST
(In reply to Alexey Shvayka from comment #2)
> 
> What if partly revert r271119 by removing
> 
>     if (!function->jsExecutable()->hasCallerAndArgumentsProperties())
>         return JSValue::encode(jsNull());
> 
> from `caller` getter to completely align us with the other runtimes?

I tried it and most tests work, except function-hidden-as-caller.js, caller-property.js, and tail-call-recognize.js, as they would need to be updated to reflect the previous behavior.

But wouldn't it go against the spec linked in the original revision[1]? Or, as there is still an open issue[2] about in TC39 github, should we try to mimic other runtimes while it's discussed there? (although no updates in the github issue since early last year)

[1] https://tc39.es/ecma262/#sec-forbidden-extensions
[2] https://github.com/tc39/ecma262/issues/562
Comment 4 Radar WebKit Bug Importer 2021-01-20 16:51:12 PST
<rdar://problem/73427042>
Comment 5 Yusuke Suzuki 2021-01-28 12:22:12 PST
Comment on attachment 417586 [details]
Patch

I think this is OK.
Comment 6 Yusuke Suzuki 2021-01-28 12:28:52 PST
Comment on attachment 417586 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=417586&action=review

>> LayoutTests/ChangeLog:8
>> +        r271119 changed some kinds of functions to return null when trying to
> 
> What if partly revert r271119 by removing
> 
>     if (!function->jsExecutable()->hasCallerAndArgumentsProperties())
>         return JSValue::encode(jsNull());
> 
> from `caller` getter to completely align us with the other runtimes?

Removing that part breaks the intent of https://trac.webkit.org/changeset/271119/webkit
Comment 7 Yusuke Suzuki 2021-01-28 12:29:13 PST
Comment on attachment 417586 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=417586&action=review

>>> LayoutTests/ChangeLog:8
>>> +        r271119 changed some kinds of functions to return null when trying to
>> 
>> What if partly revert r271119 by removing
>> 
>>     if (!function->jsExecutable()->hasCallerAndArgumentsProperties())
>>         return JSValue::encode(jsNull());
>> 
>> from `caller` getter to completely align us with the other runtimes?
> 
> Removing that part breaks the intent of https://trac.webkit.org/changeset/271119/webkit

Ah, no https://trac.webkit.org/changeset/230662/webkit
Comment 8 EWS 2021-01-28 12:37:49 PST
Committed r272030: <https://trac.webkit.org/changeset/272030>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 417586 [details].