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

buble

Package Overview
Dependencies
Maintainers
1
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

buble - npm Package Compare versions

Comparing version 0.12.4 to 0.12.5

6

CHANGELOG.md
# buble changelog
## 0.12.5
* Prevent reserved words being used as identifiers ([#86](https://gitlab.com/Rich-Harris/buble/issues/86))
* Use correct `this` when transpiling `super` inside arrow function ([#89](https://gitlab.com/Rich-Harris/buble/issues/89))
* Handle body-less `for-of` loops ([#80](https://gitlab.com/Rich-Harris/buble/issues/80))
## 0.12.4

@@ -4,0 +10,0 @@

2

package.json
{
"name": "buble",
"version": "0.12.4",
"version": "0.12.5",
"description": "The blazing fast, batteries-included ES2015 compiler",

@@ -5,0 +5,0 @@ "main": "dist/buble.umd.js",

import Node from '../Node.js';
import { findIndex } from '../../utils/array.js';
import reserved from '../../utils/reserved.js';

@@ -82,3 +83,3 @@ // TODO this code is pretty wild, tidy it up

let methodName = method.key.name;
if ( scope.contains( methodName ) ) methodName = scope.createIdentifier( methodName );
if ( scope.contains( methodName ) || reserved[ methodName ] ) methodName = scope.createIdentifier( methodName );

@@ -85,0 +86,0 @@ if ( isAccessor ) {

@@ -16,2 +16,15 @@ import LoopStatement from './shared/LoopStatement.js';

// edge case (#80)
if ( !this.body.body[0] ) {
if ( this.left.type === 'VariableDeclaration' && this.left.kind === 'var' ) {
code.remove( this.start, this.left.start );
code.insertLeft( this.left.end, ';' );
code.remove( this.left.end, this.end );
} else {
code.remove( this.start, this.end );
}
return;
}
const scope = this.findScope( true );

@@ -18,0 +31,0 @@ const i0 = this.getIndentation();

@@ -27,2 +27,16 @@ import Node from '../Node.js';

}
if ( transforms.arrow ) {
const lexicalBoundary = this.findLexicalBoundary();
const arrowFunction = this.findNearest( 'ArrowFunctionExpression' );
const loop = this.findNearest( /(?:For(?:In|Of)?|While)Statement/ );
if ( arrowFunction && arrowFunction.depth > lexicalBoundary.depth ) {
this.thisAlias = lexicalBoundary.getThisAlias();
}
if ( loop && loop.body.contains( this ) && loop.depth > lexicalBoundary.depth ) {
this.thisAlias = lexicalBoundary.getThisAlias();
}
}
}

@@ -45,6 +59,8 @@

const thisAlias = this.thisAlias || 'this';
if ( callExpression.arguments.length ) {
code.insertLeft( callExpression.arguments[0].start, `this, ` );
code.insertLeft( callExpression.arguments[0].start, `${thisAlias}, ` );
} else {
code.insertLeft( callExpression.end - 1, `this` );
code.insertLeft( callExpression.end - 1, `${thisAlias}` );
}

@@ -51,0 +67,0 @@ }

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

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc