Skip to content

Incorrect use of || operator #75

@shicks

Description

@shicks

var filename = '' || opt_params['filename'];

I added a lint check for suspicious code and turned up this issue. Probably the operands wanted to be in the opposite direction so that a missing filename option would default to the empty string rather than undefined. But as it's written, the '' is always falsy so it just evaluates to undefined if no filename is given.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions