Skip to content

Distinguish between function expressions and function declarations #489

Description

@saelo

Currently we only support function declarations in FuzzIL, i.e. something like

function foo() {
    ...
}

But not

let foo = function() {
    ...
}

For the most part, it doesn't really matter whether we emit function statements or expressions, but in certain situations the difference is observable, for example here:

let x = function foo(n) {
  if (n == 0) return;
  foo(n-1);
}
x(10);

I'm not sure how best to support this. Probably the easiest way would be to simply add a boolean flag to BeginAnyFunctionDefinition that states whether the function should become an expression or a statement.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions