Bug 154516 - [JSC shell] Don't put empty arguments array to VM.
Summary: [JSC shell] Don't put empty arguments array to VM.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 154517
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-21 11:35 PST by Konstantin Tokarev
Modified: 2016-02-22 11:41 PST (History)
7 users (show)

See Also:


Attachments
Patch (3.41 KB, patch)
2016-02-21 11:40 PST, Konstantin Tokarev
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin Tokarev 2016-02-21 11:35:56 PST
This allows arrowfunction-lexical-bind-arguments-top-level test to pass in jsc as well as in browser.
Comment 1 Konstantin Tokarev 2016-02-21 11:40:24 PST
Created attachment 271884 [details]
Patch
Comment 2 Yusuke Suzuki 2016-02-22 03:15:21 PST
Comment on attachment 271884 [details]
Patch

I don't think the current approach is good because we would like to assume that there is an empty `arguments` if the CLI does not pass any arguments.

How about the following idea?
1. adding an Option (see runtime/Options.h), that controls exposing the `arguments`. Now, we can control this behavior with the environment variable JSC_XXX (If you add an option XXX, we can switch it with the environment variable JSC_XXX)
3. adding a ruby function notExposeArguments() in run-jsc-stress-tests, which defines JSC_XXX environment variable before executing the command. (Let's define addEnvVar(X, Y). And calling it as def notExposeArguments addEnvVar("JSC_XXX", "true"))
4. defining the annotation "//@ notExposeArguments" instead of "//@ skip"
Comment 3 Konstantin Tokarev 2016-02-22 04:47:11 PST
(In reply to comment #2)
> Comment on attachment 271884 [details]
> Patch
> 
> I don't think the current approach is good because we would like to assume
> that there is an empty `arguments` if the CLI does not pass any arguments.
> 
> How about the following idea?
> 1. adding an Option (see runtime/Options.h), that controls exposing the
> `arguments`. Now, we can control this behavior with the environment variable
> JSC_XXX (If you add an option XXX, we can switch it with the environment
> variable JSC_XXX)
> 3. adding a ruby function notExposeArguments() in run-jsc-stress-tests,
> which defines JSC_XXX environment variable before executing the command.
> (Let's define addEnvVar(X, Y). And calling it as def notExposeArguments
> addEnvVar("JSC_XXX", "true"))
> 4. defining the annotation "//@ notExposeArguments" instead of "//@ skip"

Problem is that I use run-layout-jsc, which does not support annotations, and my initial motivation for this change was to allow this test to pass without @ skip annotation.

Though run-layout-jsc may unconditionally use this mode.
Comment 4 Geoffrey Garen 2016-02-22 11:37:02 PST
Comment on attachment 271884 [details]
Patch

r=me
Comment 5 WebKit Commit Bot 2016-02-22 11:40:57 PST
Comment on attachment 271884 [details]
Patch

Clearing flags on attachment: 271884

Committed r196948: <http://trac.webkit.org/changeset/196948>
Comment 6 WebKit Commit Bot 2016-02-22 11:41:02 PST
All reviewed patches have been landed.  Closing bug.