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

acorn-es7-plugin

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

acorn-es7-plugin - npm Package Compare versions

Comparing version 1.1.6 to 1.1.7

test/xxx.js

7

acorn-v3.js

@@ -121,3 +121,3 @@ var NotAsync = {} ;

parser.extend("parseExprAtom",function(base){
parser.extend("parseExprAtom",function(base){
return function(refShorthandDefaultPos){

@@ -158,2 +158,4 @@ var start = this.start ;

rhs = rhs.expressions[0] ;
if (rhs.type === 'CallExpression')
rhs = rhs.callee ;
if (rhs.type==='FunctionExpression' || rhs.type==='FunctionDeclaration' || rhs.type==='ArrowFunctionExpression') {

@@ -165,2 +167,5 @@ // Because we don't know if the top level parser supprts preserveParens, we have to re-parse

rhs = rhs.expressions[0] ;
if (rhs.type === 'CallExpression')
rhs = rhs.callee ;
rhs.async = true ;

@@ -167,0 +172,0 @@ rhs.start = start;

2

package.json

@@ -28,3 +28,3 @@ {

},
"version": "1.1.6"
"version": "1.1.7"
}

@@ -110,2 +110,6 @@ [![NPM](https://nodei.co/npm/acorn-es7-plugin.png?downloads=true&downloadRank=true)](https://nodei.co/npm/acorn-es7-plugin/)

30-Mar-17: v1.1.7
- Fix parsing of IIAFE `(async function (){ }())` with acorn v3.
07-Oct-16: v1.1.1

@@ -112,0 +116,0 @@

@@ -48,2 +48,20 @@ 'use strict';

},{
desc: "Simple async function expression",
code: "(async function (){ })",
pass: function (ast) {
return ast.body[0].expression.async === true;
}
},{
desc: "Async function expression call (1)",
code: "(async function (){ }())",
pass: function (ast) {
return ast.body[0].expression.callee.async === true;
}
},{
desc: "Async function expression call (2)",
code: "(async function (){ })()",
pass: function (ast) {
return ast.body[0].expression.callee.async === true;
}
},{
desc: "Await in async is AwaitExpression",

@@ -50,0 +68,0 @@ code: "async function x() { await(undefined); await undefined ; }",

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