Skip to content

||= not implemented #647

@pjebs

Description

@pjebs

This is some sample code I found on a npm package:

            while (comments[0] && comments[0].start < node.start) {
              comment = /** @type {CommentWithLocation} */
              comments.shift();
              (node.leadingComments ||= []).push(comment); <----------
            }

Goja produces this error:

Line 20130:39 Unexpected token = (and 715 more errors)

Reference:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_OR_assignment (Widely available is what mdn says)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions