Merge branch 'master' into development

This commit is contained in:
Sebastian McKenzie
2015-08-11 01:05:04 +01:00
10 changed files with 156 additions and 6 deletions

View File

@@ -13,6 +13,13 @@ _Note: Gaps between patch versions are faulty, broken or test releases._
See [CHANGELOG - 6to5](CHANGELOG-6to5.md) for the pre-4.0.0 version changelog.
## 5.8.22
* **Bug Fix**
* Fix bug causing regexes to cause a syntax error after a block.
* **Internal**
* Expose `File`.
## 5.8.21
* **New Feature**

View File

@@ -1 +1 @@
5.8.21
5.8.22

View File

@@ -1,6 +1,6 @@
{
"name": "babel-core",
"version": "5.8.21",
"version": "5.8.22",
"description": "A compiler for writing next generation JavaScript",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"homepage": "https://babeljs.io/",
@@ -42,7 +42,7 @@
"babel-plugin-runtime": "^1.0.7",
"babel-plugin-undeclared-variables-check": "^1.0.2",
"babel-plugin-undefined-to-void": "^1.1.6",
"babylon": "^5.8.21",
"babylon": "^5.8.22",
"bluebird": "^2.9.33",
"chalk": "^1.0.0",
"convert-source-map": "^1.1.0",

View File

@@ -8,6 +8,7 @@ export { util, babylon as acorn, transform };
export { pipeline } from "../transformation";
export { canCompile } from "../util";
export { default as File } from "../transformation/file";
export { default as options } from "../transformation/file/options/config";
export { default as Plugin } from "../transformation/plugin";
export { default as Transformer } from "../transformation/transformer";

View File

@@ -92,7 +92,8 @@ export default class CommonJSFormatter extends DefaultFormatter {
]));
} else {
// import { foo } from "foo";
this.remaps.add(scope, variableName.name, t.memberExpression(ref, specifier.imported));
this.remaps.add(scope, variableName.name,
t.memberExpression(ref, t.identifier(specifier.imported.name)));
}
}
}

View File

@@ -0,0 +1,19 @@
[{
"original": {
"line": 6,
"column": 0
},
"generated": {
"line": 5,
"column": 6
}
}, {
"original": {
"line": 9,
"column": 0
},
"generated": {
"line": 8,
"column": 6
}
}]

View File

@@ -1,6 +1,6 @@
{
"name": "babylon",
"version": "5.8.21",
"version": "5.8.22",
"description": "",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"homepage": "https://babeljs.io/",

View File

@@ -786,7 +786,7 @@ export default class Tokenizer {
return lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start));
}
if (prevType === tt._else || prevType === tt.semi || prevType === tt.eof) {
if (prevType === tt._else || prevType === tt.semi || prevType === tt.eof || prevType === tt.parenR) {
return true;
}

View File

@@ -0,0 +1,4 @@
if (true) {
}
/foo/

View File

@@ -0,0 +1,118 @@
{
"type": "File",
"start": 0,
"end": 20,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 4,
"column": 5
}
},
"program": {
"type": "Program",
"start": 0,
"end": 20,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 4,
"column": 5
}
},
"sourceType": "script",
"body": [
{
"type": "IfStatement",
"start": 0,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 1
}
},
"test": {
"type": "Literal",
"start": 4,
"end": 8,
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 8
}
},
"value": true,
"rawValue": true,
"raw": "true"
},
"consequent": {
"type": "BlockStatement",
"start": 10,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 10
},
"end": {
"line": 2,
"column": 1
}
},
"body": []
},
"alternate": null
},
{
"type": "ExpressionStatement",
"start": 15,
"end": 20,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 5
}
},
"expression": {
"type": "Literal",
"start": 15,
"end": 20,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 5
}
},
"raw": "/foo/",
"regex": {
"pattern": "foo",
"flags": ""
}
}
}
]
}
}