Skip to content
This repository was archived by the owner on Feb 8, 2020. It is now read-only.
This repository was archived by the owner on Feb 8, 2020. It is now read-only.

Bug with arguments default value consisting of a list of expressions #110

@ericmorand

Description

@ericmorand

Consider the following perfectly valid function:

function foo(a = (false, false, true)) {
    return a;
}

When called with no parameter, this function returns true.

Parsing it with parse-function...

const pf = require('parse-function');

let p = pf().parse(foo);

console.warn(p.defaults);

...return the following defaults:

{ a: 'false, false, true' }

The defaults should be:

{ a: 'true' }

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions