Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

acorn-es7-plugin

Package Overview
Dependencies
0
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.5 to 1.0.6

18

acorn-es7-plugin.js

@@ -5,6 +5,7 @@ var NotAsync = {} ;

var atomOrPropertyOrLabel = /^\s*[:;]/ ;
var asyncAtEndOfLine = /^async[\t ]*\n/ ;
/* Create a new parser derived from the specified parser, so that in the
* event of an error we can back out and try again */
function subParse(parser, how, pos, extensions) {
function subParse(parser, pos, extensions) {
var p = new parser.constructor(parser.options, parser.input, pos);

@@ -20,3 +21,3 @@ if (extensions)

p.nextToken();
return p[how]();
return p;
}

@@ -72,3 +73,3 @@

if (r.type==='Identifier') {
if (r.name==='async' && !/^async[\t ]*\n/.test(this.input.slice(start))) {
if (r.name==='async' && !asyncAtEndOfLine.test(this.input.slice(start))) {
// Is this really an async function?

@@ -80,3 +81,4 @@ var isAsync = this.inAsyncFunction ;

var inBody = false ;
rhs = subParse(this,'parseExpression',this.start,{
var parseHooks = {
parseFunctionBody:function(){

@@ -98,3 +100,5 @@ try {

}
}) ;
} ;
rhs = subParse(this,this.start,parseHooks).parseExpression() ;
if (rhs.type==='SequenceExpression')

@@ -137,5 +141,5 @@ rhs = rhs.expressions[0] ;

var start = this.start ;
rhs = subParse(this,'parseExprSubscripts',this.start-4) ;
rhs = subParse(this,this.start-4).parseExprSubscripts() ;
if (rhs.end<=start) {
rhs = subParse(this,'parseExprSubscripts',this.start) ;
rhs = subParse(this,this.start).parseExprSubscripts() ;
n.operator = 'await' ;

@@ -142,0 +146,0 @@ n.argument = rhs ;

{
"name": "acorn-es7-plugin",
"version": "1.0.5",
"version": "1.0.6",
"description": "A plugin for the Acorn parser that understands the ES7 keywords async and await",

@@ -5,0 +5,0 @@ "main": "acorn-es7-plugin.js",

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