Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

espree

Package Overview
Dependencies
Maintainers
3
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

espree - npm Package Compare versions

Comparing version 9.0.0 to 9.1.0

13

lib/espree.js

@@ -59,2 +59,4 @@ /* eslint-disable no-param-reassign*/

// save original source type in case of commonjs
const originalSourceType = opts.sourceType;
const options = normalizeOptions(opts);

@@ -78,3 +80,3 @@ const ecmaFeatures = options.ecmaFeatures || {};

// Truthy value is true for backward compatibility.
allowReturnOutsideFunction: Boolean(ecmaFeatures.globalReturn),
allowReturnOutsideFunction: options.allowReturnOutsideFunction,

@@ -103,4 +105,9 @@ // Collect tokens

// Initialize internal state.
/*
* Data that is unique to Espree and is not represented internally in
* Acorn. We put all of this data into a symbol property as a way to
* avoid potential naming conflicts with future versions of Acorn.
*/
this[STATE] = {
originalSourceType: originalSourceType || options.sourceType,
tokens: tokenTranslator ? [] : null,

@@ -150,3 +157,3 @@ comments: options.comment === true ? [] : null,

program.sourceType = this.options.sourceType;
program.sourceType = extra.originalSourceType;

@@ -153,0 +160,0 @@ if (extra.comments) {

@@ -76,2 +76,7 @@ /**

}
if (sourceType === "commonjs") {
return "script";
}
throw new Error("Invalid sourceType.");

@@ -92,2 +97,5 @@ }

const allowReserved = ecmaVersion === 3 ? "never" : false;
const ecmaFeatures = options.ecmaFeatures || {};
const allowReturnOutsideFunction = options.sourceType === "commonjs" ||
Boolean(ecmaFeatures.globalReturn);

@@ -97,2 +105,3 @@ if (sourceType === "module" && ecmaVersion < 6) {

}
return Object.assign({}, options, {

@@ -103,4 +112,5 @@ ecmaVersion,

locations,
allowReserved
allowReserved,
allowReturnOutsideFunction
});
}

@@ -1,3 +0,3 @@

const version = "9.0.0";
const version = "9.1.0";
export default version;

@@ -19,3 +19,3 @@ {

},
"version": "9.0.0",
"version": "9.1.0",
"files": [

@@ -35,5 +35,5 @@ "lib",

"dependencies": {
"acorn": "^8.5.0",
"acorn": "^8.6.0",
"acorn-jsx": "^5.3.1",
"eslint-visitor-keys": "^3.0.0"
"eslint-visitor-keys": "^3.1.0"
},

@@ -49,3 +49,3 @@ "devDependencies": {

"eslint-plugin-node": "^11.1.0",
"eslint-release": "^3.1.2",
"eslint-release": "^3.2.0",
"esprima": "latest",

@@ -52,0 +52,0 @@ "esprima-fb": "^8001.2001.0-dev-harmony-fb",

@@ -148,3 +148,3 @@ [![npm version](https://img.shields.io/npm/v/espree.svg)](https://www.npmjs.com/package/espree)

// specify which type of script you're parsing ("script" or "module")
// specify which type of script you're parsing ("script", "module", or "commonjs")
sourceType: "script",

@@ -158,3 +158,3 @@

// enable return in global scope
// enable return in global scope (set to true automatically when sourceType is "commonjs")
globalReturn: false,

@@ -243,2 +243,3 @@

* [Top-level await](https://github.com/tc39/proposal-top-level-await)
* [Class static initialization blocks](https://github.com/tc39/proposal-class-static-block)

@@ -245,0 +246,0 @@ See [finished-proposals.md](https://github.com/tc39/proposals/blob/master/finished-proposals.md) to know what features are finalized.

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc