Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9108422f99 | ||
|
|
9e8f4b25ca | ||
|
|
1cecd24823 | ||
|
|
97f6e1469b | ||
|
|
ec46eaf224 | ||
|
|
a102692103 | ||
|
|
0376ec8ff0 | ||
|
|
5932a07610 | ||
|
|
6110b0c0b3 | ||
|
|
365e221d95 | ||
|
|
acbc4859c0 | ||
|
|
55750e05e7 | ||
|
|
ba9c4db673 | ||
|
|
ba8a63a69e | ||
|
|
25581981b5 | ||
|
|
02a6feed73 | ||
|
|
f3acedbf08 | ||
|
|
35ab4ffaab |
13
CHANGELOG.md
13
CHANGELOG.md
@@ -13,6 +13,19 @@ _Note: Gaps between patch versions are faulty/broken releases._
|
||||
|
||||
See [CHANGELOG - 6to5](CHANGELOG-6to5.md) for the pre-4.0.0 version changelog.
|
||||
|
||||
## 5.5.2
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix `NodePath#isPure` on `Property` nodes.
|
||||
* Use cwd instead of entry file directory when working out relative directory for `babel/register`.
|
||||
* **Internal**
|
||||
* Add scary warning for those few who choose to use the WIP experimental transformers.
|
||||
|
||||
## 5.5.1
|
||||
|
||||
* **Bug Fix**
|
||||
* Remove `ClassProperty` nodes always in the `Flow` transformer. This is fine now since class properties aren't supported in any engine that supports classes but the `es7.classProperties` transformer will need to be updated in the future to desugar to ES6 classes instead of relying on the `es6.classes` transformer from being ran.
|
||||
|
||||
## 5.5.0
|
||||
|
||||
* **Bug Fix**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "babel-core",
|
||||
"description": "A compiler for writing next generation JavaScript",
|
||||
"version": "5.5.0",
|
||||
"version": "5.5.2",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
{
|
||||
"name": "babel",
|
||||
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
|
||||
"version": "5.4.7",
|
||||
"version": "5.5.1",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
"license": "MIT",
|
||||
"repository": "babel/babel",
|
||||
"preferGlobal": true,
|
||||
"dependencies": {
|
||||
"babel-core": "^5.4.7",
|
||||
"babel-core": "^5.5.1",
|
||||
"chokidar": "^1.0.0",
|
||||
"commander": "^2.6.0",
|
||||
"convert-source-map": "^1.1.0",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "babel-runtime",
|
||||
"description": "babel selfContained runtime",
|
||||
"version": "5.4.7",
|
||||
"version": "5.5.1",
|
||||
"license": "MIT",
|
||||
"repository": "babel/babel",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
|
||||
@@ -513,7 +513,7 @@ pp.parseNew = function() {
|
||||
pp.parseTemplateElement = function() {
|
||||
let elem = this.startNode()
|
||||
elem.value = {
|
||||
raw: this.input.slice(this.start, this.end),
|
||||
raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, '\n'),
|
||||
cooked: this.value
|
||||
}
|
||||
this.next()
|
||||
|
||||
@@ -577,11 +577,15 @@ pp.readTmplToken = function() {
|
||||
} else if (isNewLine(ch)) {
|
||||
out += this.input.slice(chunkStart, this.pos)
|
||||
++this.pos
|
||||
if (ch === 13 && this.input.charCodeAt(this.pos) === 10) {
|
||||
++this.pos
|
||||
out += "\n"
|
||||
} else {
|
||||
out += String.fromCharCode(ch)
|
||||
switch (ch) {
|
||||
case 13:
|
||||
if (this.input.charCodeAt(this.pos) === 10) ++this.pos;
|
||||
case 10:
|
||||
out += "\n";
|
||||
break;
|
||||
default:
|
||||
out += String.fromCharCode(ch);
|
||||
break;
|
||||
}
|
||||
if (this.options.locations) {
|
||||
++this.curLine
|
||||
|
||||
@@ -38,7 +38,7 @@ var only;
|
||||
var oldHandlers = {};
|
||||
var maps = {};
|
||||
|
||||
var cwd = require.main ? require.main.filename : process.cwd();
|
||||
var cwd = process.cwd();
|
||||
|
||||
var getRelativePath = function (filename){
|
||||
return path.relative(cwd, filename);
|
||||
|
||||
@@ -16,6 +16,10 @@ export default class Logger {
|
||||
return parts;
|
||||
}
|
||||
|
||||
warn(msg) {
|
||||
console.warn(this._buildMessage(msg));
|
||||
}
|
||||
|
||||
error(msg: string, Constructor = Error) {
|
||||
throw new Constructor(this._buildMessage(msg));
|
||||
}
|
||||
|
||||
@@ -47,7 +47,8 @@
|
||||
},
|
||||
|
||||
"experimental": {
|
||||
"deprecated": "use `--stage 0`/`{ stage: 0 }` instead"
|
||||
"description": "allow use of experimental transformers",
|
||||
"default": false
|
||||
},
|
||||
|
||||
"highlightCode": {
|
||||
|
||||
@@ -13,6 +13,12 @@ export default class TransformerPass {
|
||||
this.handlers = transformer.handlers;
|
||||
this.file = file;
|
||||
this.key = transformer.key;
|
||||
|
||||
if (this.canTransform() && transformer.metadata.experimental && !file.opts.experimental) {
|
||||
file.log.warn(`THE TRANSFORMER ${this.key} HAS BEEN MARKED AS EXPERIMENTAL AND IS WIP. USE AT YOUR OWN RISK. ` +
|
||||
"THIS WILL HIGHLY LIKELY BREAK YOUR CODE SO USE WITH **EXTREME** CAUTION. ENABLE THE " +
|
||||
"`experimental` OPTION TO IGNORE THIS WARNING.");
|
||||
}
|
||||
}
|
||||
|
||||
canTransform(): boolean {
|
||||
|
||||
@@ -2,7 +2,8 @@ import * as t from "../../../types";
|
||||
|
||||
export var metadata = {
|
||||
optional: true,
|
||||
group: "builtin-prepass"
|
||||
group: "builtin-prepass",
|
||||
experimental: true
|
||||
};
|
||||
|
||||
export function AssignmentExpression() {
|
||||
|
||||
@@ -19,7 +19,8 @@ function toStatements(node) {
|
||||
|
||||
export var metadata = {
|
||||
optional: true,
|
||||
group: "builtin-pre"
|
||||
group: "builtin-pre",
|
||||
experimental: true
|
||||
};
|
||||
|
||||
export function ReferencedIdentifier(node, parent, scope) {
|
||||
|
||||
@@ -8,6 +8,7 @@ export function Flow(node) {
|
||||
|
||||
export function ClassProperty(node) {
|
||||
node.typeAnnotation = null;
|
||||
if (!node.value) this.dangerouslyRemove();
|
||||
}
|
||||
|
||||
export function Class(node) {
|
||||
|
||||
@@ -20,7 +20,7 @@ export default class Binding {
|
||||
|
||||
deoptValue() {
|
||||
this.clearValue();
|
||||
this.deoptValue = true;
|
||||
this.hasDeoptedValue = true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -28,7 +28,7 @@ export default class Binding {
|
||||
*/
|
||||
|
||||
setValue(value) {
|
||||
if (this.deoptValue) return;
|
||||
if (this.hasDeoptedValue) return;
|
||||
this.hasValue = true;
|
||||
this.value = value;
|
||||
}
|
||||
@@ -38,9 +38,9 @@ export default class Binding {
|
||||
*/
|
||||
|
||||
clearValue() {
|
||||
this.deoptValue = false;
|
||||
this.hasValue = false;
|
||||
this.value = null;
|
||||
this.hasDeoptedValue = false;
|
||||
this.hasValue = false;
|
||||
this.value = null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -585,8 +585,8 @@ export default class Scope {
|
||||
}
|
||||
return true;
|
||||
} else if (t.isProperty(node)) {
|
||||
if (node.computed && !t.isPure(node.key, constantsOnly)) return false;
|
||||
return t.isPure(node.value, constantsOnly);
|
||||
if (node.computed && !this.isPure(node.key, constantsOnly)) return false;
|
||||
return this.isPure(node.value, constantsOnly);
|
||||
} else {
|
||||
return t.isPure(node);
|
||||
}
|
||||
|
||||
@@ -813,7 +813,7 @@ test("`\\n\\r\\b\\v\\t\\f\\\n\\\r\n`", {
|
||||
type: "TemplateLiteral",
|
||||
quasis: [{
|
||||
type: "TemplateElement",
|
||||
value: {raw: "\\n\\r\\b\\v\\t\\f\\\n\\\r\n", cooked: "\n\r\b\u000b\t\f"},
|
||||
value: {raw: "\\n\\r\\b\\v\\t\\f\\\n\\\n", cooked: "\n\r\b\u000b\t\f"},
|
||||
tail: true,
|
||||
loc: {
|
||||
start: {line: 1, column: 1},
|
||||
@@ -841,7 +841,7 @@ test("`\\n\\r\\b\\v\\t\\f\\\n\\\r\n`", {
|
||||
locations: true
|
||||
});
|
||||
|
||||
test("`\n\r\n`", {
|
||||
test("`\n\r\n\r`", {
|
||||
type: "Program",
|
||||
body: [{
|
||||
type: "ExpressionStatement",
|
||||
@@ -849,27 +849,27 @@ test("`\n\r\n`", {
|
||||
type: "TemplateLiteral",
|
||||
quasis: [{
|
||||
type: "TemplateElement",
|
||||
value: {raw: "\n\r\n", cooked: "\n\n"},
|
||||
value: {raw: "\n\n\n", cooked: "\n\n\n"},
|
||||
tail: true,
|
||||
loc: {
|
||||
start: {line: 1, column: 1},
|
||||
end: {line: 3, column: 0}
|
||||
end: {line: 4, column: 0}
|
||||
}
|
||||
}],
|
||||
expressions: [],
|
||||
loc: {
|
||||
start: {line: 1, column: 0},
|
||||
end: {line: 3, column: 1}
|
||||
end: {line: 4, column: 1}
|
||||
}
|
||||
},
|
||||
loc: {
|
||||
start: {line: 1, column: 0},
|
||||
end: {line: 3, column: 1}
|
||||
end: {line: 4, column: 1}
|
||||
}
|
||||
}],
|
||||
loc: {
|
||||
start: {line: 1, column: 0},
|
||||
end: {line: 3, column: 1}
|
||||
end: {line: 4, column: 1}
|
||||
}
|
||||
}, {
|
||||
ecmaVersion: 6,
|
||||
@@ -14134,8 +14134,6 @@ test('function normal(x, y = 10) {}', {
|
||||
}]
|
||||
}, {ecmaVersion: 6});
|
||||
|
||||
test("'use strict'; function f([x,,z]) {}", {}, {ecmaVersion: 6});
|
||||
|
||||
// test preserveParens option with arrow functions
|
||||
test("() => 42", {
|
||||
type: "Program",
|
||||
|
||||
@@ -64,14 +64,8 @@ class Foo8 {
|
||||
"bar"() {}
|
||||
}
|
||||
function foo(requiredParam, optParam) {}
|
||||
class Foo9 {
|
||||
prop1;
|
||||
prop2;
|
||||
}
|
||||
class Foo10 {
|
||||
static prop1;
|
||||
prop2;
|
||||
}
|
||||
class Foo9 {}
|
||||
class Foo10 {}
|
||||
var x = 4;
|
||||
class Array {
|
||||
concat(items) {}
|
||||
|
||||
Reference in New Issue
Block a user