Files
2024-12-13 08:53:01 +01:00

945 B

Logical assignment support for Acorn

NPM version

This is a plugin for Acorn - a tiny, fast JavaScript parser, written completely in JavaScript.

It implements support for logical assignments as defined in the stage 3 proposal Logical Assignments. The AST follows ESTree.

Usage

This module provides a plugin that can be used to extend the Acorn Parser class to parse logical assignments:

var acorn = require('acorn');
var logicalAssignments = require('acorn-logical-assignments');
acorn.Parser.extend(logicalAssignments).parse('x ||= y');

License

This plugin is released under an MIT License.