Compare commits

...

13 Commits

Author SHA1 Message Date
Sebastian McKenzie
1b45f64858 v5.4.1 2015-05-15 02:00:18 +01:00
Sebastian McKenzie
b89cf6768f fix shouldIgnore only matches switch 2015-05-15 01:57:10 +01:00
Sebastian McKenzie
36ad1108b4 fix loose mode loop being weirdly inserted 2015-05-15 01:56:34 +01:00
Sebastian McKenzie
4c04371ea4 remove loop label due to babel bug 2015-05-15 01:48:47 +01:00
Sebastian McKenzie
d3e385c554 one last try fixing the shouldIgnore only filter... 2015-05-15 01:46:36 +01:00
Sebastian McKenzie
6afcef9805 actually fix shouldIgnore algorithm this time, ugh 2015-05-15 01:44:57 +01:00
Sebastian McKenzie
ed861e230b fix shouldIgnore method for only 2015-05-15 01:41:49 +01:00
Sebastian McKenzie
e15ced2922 add 5.4.1 changelog 2015-05-15 01:37:48 +01:00
Sebastian McKenzie
93052e532f Merge branch 'master' of github.com:babel/babel 2015-05-15 01:35:43 +01:00
Sebastian McKenzie
198d51ddaa heavily improve shouldIgnore algorithm - fixes #1539 2015-05-15 01:34:58 +01:00
Sebastian McKenzie
8730b24def Merge pull request #1540 from browncolyn/master
Added slash as needed dependency
2015-05-15 01:30:50 +01:00
Colyn Brown
f09c0d5998 Added slash as needed dependency 2015-05-14 17:28:20 -07:00
Sebastian McKenzie
21e4481ab7 5.4.0 2015-05-15 00:32:36 +01:00
6 changed files with 45 additions and 12 deletions

View File

@@ -13,6 +13,13 @@ _Note: Gaps between patch versions are faulty/broken releases._
See [CHANGELOG - 6to5](CHANGELOG-6to5.md) for the pre-4.0.0 version changelog.
## 5.4.1
* **Bug Fix**
* Add missing `slash` dependency. Thanks [@browncolyn](https://github.com/browncolyn)!
* **Polish**
* Clean up `shouldIgnore` algorithm to work how you'd expect rather than being a hacky piece of shit.
## 5.4.0
* **New Feature**

View File

@@ -1,7 +1,7 @@
{
"name": "babel-core",
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
"version": "5.4.0",
"version": "5.4.1",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"homepage": "https://babeljs.io/",
"license": "MIT",

View File

@@ -1,14 +1,14 @@
{
"name": "babel",
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
"version": "5.3.3",
"version": "5.4.0",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"homepage": "https://babeljs.io/",
"license": "MIT",
"repository": "babel/babel",
"preferGlobal": true,
"dependencies": {
"babel-core": "^5.3.3",
"babel-core": "^5.4.0",
"chokidar": "^1.0.0",
"commander": "^2.6.0",
"convert-source-map": "^1.1.0",
@@ -17,11 +17,12 @@
"lodash": "^3.2.0",
"output-file-sync": "^1.1.0",
"path-is-absolute": "^1.0.0",
"source-map": "^0.4.0"
"source-map": "^0.4.0",
"slash": "^1.0.0"
},
"bin": {
"babel": "./bin/babel/index.js",
"babel-node": "./bin/babel-node",
"babel-external-helpers": "./bin/babel-external-helpers"
}
}
}

View File

@@ -1,7 +1,7 @@
{
"name": "babel-runtime",
"description": "babel selfContained runtime",
"version": "5.3.3",
"version": "5.4.0",
"license": "MIT",
"repository": "babel/babel",
"author": "Sebastian McKenzie <sebmck@gmail.com>",

View File

@@ -33,7 +33,7 @@ export function ForOfStatement(node, parent, scope, file) {
this.parentPath.replaceWithMultiple(build.node);
this.remove();
} else {
this.replaceWithMultiple(build.node);
return build.node;
}
}

View File

@@ -95,15 +95,40 @@ export function booleanify(val: any): boolean {
}
export function shouldIgnore(filename, ignore, only) {
if (!ignore.length && !only.length) return false;
filename = slash(filename);
var filenames = [];
// try and match each section of the path
var parts = filename.split("/");
for (var i = 0; i < parts.length; i++) {
var part = parts[i];
if (!part) continue;
filenames.push(part);
filenames.push(parts.slice(0, i + 1).join("/"));
}
if (only.length) {
for (var pattern of (only: Array)) {
if (pattern.test(filename)) return false;
var matches = false;
for (let filename of (filenames: Array)) {
for (var pattern of (only: Array)) {
if (pattern.test(filename)) {
matches = true;
break;
}
}
}
return true;
return !matches;
} else if (ignore.length) {
for (var pattern of (ignore: Array)) {
if (pattern.test(filename)) return true;
for (let filename of (filenames: Array)) {
for (var pattern of (ignore: Array)) {
if (pattern.test(filename)) return true;
}
}
}