Socket
Socket
Sign inDemoInstall

acorn-class-fields

Package Overview
Dependencies
2
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    acorn-class-fields

Support for class fields in acorn


Version published
Maintainers
1
Install size
46.0 kB
Created

Changelog

Source

0.3.2 (2020-04-24)

  • Make compatible with acorn@7
  • Use injected acorn instance if available
  • Evaluate class heritage with outer private environment
  • Don't allow private element access on super
  • Uses Object.getPrototypeOf if available instead of __proto__
  • Fix usage of super in field initializers

Readme

Source

Class fields support for Acorn

NPM version

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

It implements support for class fields as defined in the stage 3 proposal Class field declarations for JavaScript. The emitted AST follows an ESTree proposal.

Usage

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

const {Parser} = require('acorn');
const classFields = require('acorn-class-fields');
Parser.extend(classFields).parse('class X { x = 0 }');

License

This plugin is released under an MIT License.

FAQs

Last updated on 23 Apr 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc