Socket
Socket
Sign inDemoInstall

acorn

Package Overview
Dependencies
0
Maintainers
3
Versions
131
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.4.0 to 8.0.0

20

CHANGELOG.md

@@ -0,1 +1,21 @@

## 8.0.0 (2020-08-12)
### Bug fixes
Disallow expressions like `(a = b) = c`.
Make non-octal escape sequences a syntax error in strict mode.
### New features
The package can now be loaded directly as an ECMAScript module in node 13+.
Update to the set of Unicode properties from ES2021.
### Breaking changes
The `ecmaVersion` option is now required. For the moment, omitting it will still work with a warning, but that will change in a future release.
Some changes to method signatures that may be used by plugins.
## 7.4.0 (2020-08-03)

@@ -2,0 +22,0 @@

6

package.json

@@ -8,3 +8,7 @@ {

"module": "dist/acorn.mjs",
"version": "7.4.0",
"exports": {
"import": "./dist/acorn.mjs",
"require": "./dist/acorn.js"
},
"version": "8.0.0",
"engines": {"node": ">=0.4.0"},

@@ -11,0 +15,0 @@ "maintainers": [

27

README.md

@@ -35,5 +35,5 @@ # Acorn

**parse**`(input, options)` is the main interface to the library. The
`input` parameter is a string, `options` can be undefined or an object
setting some of the options listed below. The return value will be an
abstract syntax tree object as specified by the [ESTree
`input` parameter is a string, `options` must be an object setting
some of the options listed below. The return value will be an abstract
syntax tree object as specified by the [ESTree
spec](https://github.com/estree/estree).

@@ -43,3 +43,3 @@

let acorn = require("acorn");
console.log(acorn.parse("1 + 1"));
console.log(acorn.parse("1 + 1", {ecmaVersion: 2020}));
```

@@ -53,14 +53,15 @@

Options can be provided by passing a second argument, which should be
an object containing any of these fields:
Options are provided by in a second argument, which should be an
object containing any of these fields (only `ecmaVersion` is
required):
- **ecmaVersion**: Indicates the ECMAScript version to parse. Must be
either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018), 10 (2019) or 11
(2020, partial support). This influences support for strict mode,
the set of reserved words, and support for new syntax features.
Default is 10.
either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10 (2019),
11 (2020), or 12 (2021, partial support), or `"latest"` (the latest
the library supports). This influences support for strict mode, the
set of reserved words, and support for new syntax features.
**NOTE**: Only 'stage 4' (finalized) ECMAScript features are being
implemented by Acorn. Other proposed new features can be implemented
through plugins.
implemented by Acorn. Other proposed new features must be
implemented through plugins.

@@ -230,3 +231,3 @@ - **sourceType**: Indicate the mode the code should be parsed in. Can be

var JSXParser = acorn.Parser.extend(jsx());
JSXParser.parse("foo(<bar/>)");
JSXParser.parse("foo(<bar/>)", {ecmaVersion: 2020});
```

@@ -233,0 +234,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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