Compare commits
24 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a1a46882fd | ||
|
|
12b4e6db40 | ||
|
|
7f06bb79c0 | ||
|
|
34218afdae | ||
|
|
b94118db5e | ||
|
|
54819b94e9 | ||
|
|
50ca6b1018 | ||
|
|
2d195c4843 | ||
|
|
2f0d0c94ef | ||
|
|
5e3ea5b6e7 | ||
|
|
95128f98bc | ||
|
|
c4d1d58167 | ||
|
|
7da1d9fadd | ||
|
|
6ab57fd367 | ||
|
|
d4edce6559 | ||
|
|
9c8cb33a09 | ||
|
|
a2fb70bae3 | ||
|
|
273a81fe1f | ||
|
|
72a0ac5e02 | ||
|
|
c5ace10536 | ||
|
|
b833614b87 | ||
|
|
ae067a08b7 | ||
|
|
f56337541f | ||
|
|
1fe8447a1a |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -15,3 +15,4 @@ test/core/tmp
|
||||
/packages/babel-runtime/helpers/*.js
|
||||
/packages/babel-runtime/regenerator/*.js
|
||||
/lib
|
||||
_babel.github.io
|
||||
|
||||
@@ -13,3 +13,4 @@
|
||||
/vendor
|
||||
/packages
|
||||
/src
|
||||
_babel.github.io
|
||||
|
||||
27
.travis.yml
27
.travis.yml
@@ -1,30 +1,33 @@
|
||||
#sudo: false
|
||||
language: node_js
|
||||
cache:
|
||||
directories:
|
||||
- node_modules
|
||||
- node_modules
|
||||
node_js:
|
||||
- "0.12"
|
||||
- "iojs"
|
||||
- "0.12"
|
||||
- iojs
|
||||
|
||||
before_script: "npm install -g codeclimate-test-reporter"
|
||||
script: "make test-travis"
|
||||
before_script: ./tools/setup-git.sh
|
||||
script: make test-travis
|
||||
after_success: ./tools/merge-development-with-master.sh
|
||||
|
||||
notifications:
|
||||
slack: babeljs:5Wy4QX13KVkGy9CnU0rmvgeK
|
||||
|
||||
before_deploy:
|
||||
- make prepublish
|
||||
|
||||
after_deploy:
|
||||
- make publish-cli
|
||||
- make publish-runtime
|
||||
- make prepublish
|
||||
|
||||
deploy:
|
||||
provider: npm
|
||||
email: sebmck@gmail.com
|
||||
skip_cleanup: true
|
||||
api_key:
|
||||
secure: BCS0BJ3gjs/fyAj5GrMIj4ZAs/S3Odr/FaCAGo8+mT1+Ayinq5uQb8n07k+TqLRQC+Bm1nkjUGg97UZwBmE6NkkNA9rJkC4HCzuXkwOUmE1MxActB2Jeo1tbl3VbbcMNVBo8oTckh1oBaXN2ZbvvPaQIXMAC+0oZwaeXT5dTzQc=
|
||||
secure: Q/pZStwherdYPCqCa0aUuiEktLcx6ccBxieyH8j9IXdDgty0ydmnajZfUnlZuCjN13XI9esM44nSJFTWZvntTryDQAQm37c63VXhAEnw/qrAINI06yt0gLBTT69/fKvIAkH8l48nmW32ZS2dse3rHRPZF1CwyQLC/pdMip8I4sM=
|
||||
on:
|
||||
branch: master
|
||||
tags: true
|
||||
repo: babel/babel
|
||||
|
||||
after_deploy:
|
||||
- make publish-cli
|
||||
- make publish-runtime
|
||||
- make rebuild-website
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
> - [Internal]
|
||||
> - [Polish]
|
||||
|
||||
_Note: Gaps between patch versions are faulty/broken releases._
|
||||
_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.
|
||||
|
||||
|
||||
10
Makefile
10
Makefile
@@ -9,7 +9,7 @@ BROWSERIFY_IGNORE = -i esprima-fb
|
||||
|
||||
export NODE_ENV = test
|
||||
|
||||
.PHONY: clean test test-cov test-clean test-travis test-simple test-all test-browser test-parser publish build bootstrap publish-core publish-runtime build-core watch-core build-core-test clean-core prepublish
|
||||
.PHONY: clean test test-cov test-clean test-travis test-simple test-all test-browser test-parser publish build bootstrap publish-core publish-runtime build-website build-core watch-core build-core-test clean-core prepublish
|
||||
|
||||
build-core: clean-core
|
||||
node $(BABEL_CMD) src --out-dir lib --copy-files
|
||||
@@ -103,10 +103,10 @@ publish-runtime:
|
||||
npm publish
|
||||
|
||||
publish-cli:
|
||||
cd packages; \
|
||||
node build-cli.js; \
|
||||
cd babel-cli; \
|
||||
npm publish
|
||||
@./tools/publish-cli.sh
|
||||
|
||||
build-website:
|
||||
@./tools/build-website.sh
|
||||
|
||||
bootstrap:
|
||||
npm list --global --depth 1 babel >/dev/null 2>&1 && npm uninstall -g babel || true
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<strong>Babel</strong> is a compiler for writing next generation JavaScript.
|
||||
The compiler for writing next generation JavaScript.
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
|
||||
16
package.json
16
package.json
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "babel-core",
|
||||
"description": "A compiler for writing next generation JavaScript",
|
||||
"version": "5.6.13",
|
||||
"version": "5.6.15",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
"license": "MIT",
|
||||
@@ -10,17 +10,17 @@
|
||||
"./lib/babel/api/register/node.js": "./lib/babel/api/register/browser.js"
|
||||
},
|
||||
"keywords": [
|
||||
"harmony",
|
||||
"6to5",
|
||||
"babel",
|
||||
"classes",
|
||||
"modules",
|
||||
"let",
|
||||
"const",
|
||||
"var",
|
||||
"es6",
|
||||
"harmony",
|
||||
"let",
|
||||
"modules",
|
||||
"transpile",
|
||||
"transpiler",
|
||||
"6to5",
|
||||
"babel"
|
||||
"var"
|
||||
],
|
||||
"scripts": {
|
||||
"bench": "make bench",
|
||||
@@ -77,10 +77,10 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel": "5.6.10",
|
||||
"babel-eslint": "^3.1.19",
|
||||
"browserify": "^9.0.8",
|
||||
"chai": "^2.2.0",
|
||||
"eslint": "^0.21.2",
|
||||
"babel-eslint": "^3.1.9",
|
||||
"esvalid": "^1.1.0",
|
||||
"istanbul": "^0.3.5",
|
||||
"matcha": "^0.6.0",
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
"repository": "babel/babel",
|
||||
"preferGlobal": true,
|
||||
"dependencies": {
|
||||
"babel-core": "^5.6.12",
|
||||
"chokidar": "^1.0.0",
|
||||
"commander": "^2.6.0",
|
||||
"convert-source-map": "^1.1.0",
|
||||
|
||||
@@ -16,6 +16,15 @@ pp.expectRelational = function (op) {
|
||||
}
|
||||
}
|
||||
|
||||
pp.flow_parseTypeInitialiser = function (tok) {
|
||||
var oldInType = this.inType
|
||||
this.inType = true
|
||||
this.expect(tok || tt.colon)
|
||||
var type = this.flow_parseType()
|
||||
this.inType = oldInType
|
||||
return type;
|
||||
}
|
||||
|
||||
pp.flow_parseDeclareClass = function (node) {
|
||||
this.next()
|
||||
this.flow_parseInterfaceish(node, true)
|
||||
@@ -41,12 +50,7 @@ pp.flow_parseDeclareFunction = function (node) {
|
||||
typeNode.params = tmp.params
|
||||
typeNode.rest = tmp.rest
|
||||
this.expect(tt.parenR)
|
||||
|
||||
var oldInType = this.inType
|
||||
this.inType = true
|
||||
this.expect(tt.colon)
|
||||
typeNode.returnType = this.flow_parseType()
|
||||
this.inType = oldInType
|
||||
typeNode.returnType = this.flow_parseTypeInitialiser()
|
||||
|
||||
typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation")
|
||||
id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation")
|
||||
@@ -157,15 +161,7 @@ pp.flow_parseTypeAlias = function (node) {
|
||||
node.typeParameters = null
|
||||
}
|
||||
|
||||
var oldInType = this.inType;
|
||||
this.inType = true;
|
||||
|
||||
this.expect(tt.eq)
|
||||
|
||||
node.right = this.flow_parseType()
|
||||
|
||||
this.inType = oldInType;
|
||||
|
||||
node.right = this.flow_parseTypeInitialiser(tt.eq)
|
||||
this.semicolon()
|
||||
|
||||
return this.finishNode(node, "TypeAlias")
|
||||
@@ -218,11 +214,9 @@ pp.flow_parseObjectTypeIndexer = function (node, isStatic) {
|
||||
|
||||
this.expect(tt.bracketL)
|
||||
node.id = this.flow_parseObjectPropertyKey()
|
||||
this.expect(tt.colon)
|
||||
node.key = this.flow_parseType()
|
||||
node.key = this.flow_parseTypeInitialiser()
|
||||
this.expect(tt.bracketR)
|
||||
this.expect(tt.colon)
|
||||
node.value = this.flow_parseType()
|
||||
node.value = this.flow_parseTypeInitialiser()
|
||||
|
||||
this.flow_objectTypeSemicolon()
|
||||
return this.finishNode(node, "ObjectTypeIndexer")
|
||||
@@ -249,8 +243,7 @@ pp.flow_parseObjectTypeMethodish = function (node) {
|
||||
node.rest = this.flow_parseFunctionTypeParam()
|
||||
}
|
||||
this.expect(tt.parenR)
|
||||
this.expect(tt.colon)
|
||||
node.returnType = this.flow_parseType()
|
||||
node.returnType = this.flow_parseTypeInitialiser()
|
||||
|
||||
return this.finishNode(node, "FunctionTypeAnnotation")
|
||||
}
|
||||
@@ -269,7 +262,7 @@ pp.flow_parseObjectTypeCallProperty = function (node, isStatic) {
|
||||
var valueNode = this.startNode()
|
||||
node.static = isStatic
|
||||
node.value = this.flow_parseObjectTypeMethodish(valueNode)
|
||||
this.flow_objectTypeSemicolon()
|
||||
this.flow_objectTypeSemicolon()
|
||||
return this.finishNode(node, "ObjectTypeCallProperty")
|
||||
}
|
||||
|
||||
@@ -314,9 +307,8 @@ pp.flow_parseObjectType = function (allowStatic) {
|
||||
if (this.eat(tt.question)) {
|
||||
optional = true
|
||||
}
|
||||
this.expect(tt.colon)
|
||||
node.key = propertyKey
|
||||
node.value = this.flow_parseType()
|
||||
node.value = this.flow_parseTypeInitialiser()
|
||||
node.optional = optional
|
||||
node.static = isStatic
|
||||
this.flow_objectTypeSemicolon()
|
||||
@@ -384,9 +376,8 @@ pp.flow_parseFunctionTypeParam = function () {
|
||||
if (this.eat(tt.question)) {
|
||||
optional = true
|
||||
}
|
||||
this.expect(tt.colon)
|
||||
node.optional = optional
|
||||
node.typeAnnotation = this.flow_parseType()
|
||||
node.typeAnnotation = this.flow_parseTypeInitialiser()
|
||||
return this.finishNode(node, "FunctionTypeParam")
|
||||
}
|
||||
|
||||
@@ -583,13 +574,7 @@ pp.flow_parseType = function () {
|
||||
|
||||
pp.flow_parseTypeAnnotation = function () {
|
||||
var node = this.startNode()
|
||||
|
||||
var oldInType = this.inType
|
||||
this.inType = true
|
||||
this.expect(tt.colon)
|
||||
node.typeAnnotation = this.flow_parseType()
|
||||
this.inType = oldInType
|
||||
|
||||
node.typeAnnotation = this.flow_parseTypeInitialiser()
|
||||
return this.finishNode(node, "TypeAnnotation")
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,11 @@ var memberExpressionOptimisationVisitor = {
|
||||
}
|
||||
},
|
||||
|
||||
Flow() {
|
||||
// don't touch reference in type annotations
|
||||
this.skip();
|
||||
},
|
||||
|
||||
Function(node, parent, scope, state) {
|
||||
// skip over functions as whatever `arguments` we reference inside will refer
|
||||
// to the wrong function
|
||||
|
||||
@@ -9965,6 +9965,95 @@ var fbTestFixture = {
|
||||
end: { line: 1, column: 49 }
|
||||
}
|
||||
},
|
||||
'declare class IViewFactory { didAnimate(view:Object, prop:string) :void; }': {
|
||||
start: 0,
|
||||
id: {
|
||||
start: 14,
|
||||
name: "IViewFactory",
|
||||
type: "Identifier",
|
||||
end: 26
|
||||
},
|
||||
typeParameters: null,
|
||||
extends: [],
|
||||
body: {
|
||||
start: 27,
|
||||
callProperties: [],
|
||||
properties: [
|
||||
{
|
||||
start: 29,
|
||||
value: {
|
||||
start: 29,
|
||||
params: [
|
||||
{
|
||||
start: 40,
|
||||
name: {
|
||||
start: 40,
|
||||
name: "view",
|
||||
type: "Identifier",
|
||||
end: 44
|
||||
},
|
||||
optional: false,
|
||||
typeAnnotation: {
|
||||
start: 45,
|
||||
typeParameters: null,
|
||||
id: {
|
||||
start: 45,
|
||||
name: "Object",
|
||||
type: "Identifier",
|
||||
end: 51
|
||||
},
|
||||
type: "GenericTypeAnnotation",
|
||||
end: 51
|
||||
},
|
||||
type: "FunctionTypeParam",
|
||||
end: 51
|
||||
},
|
||||
{
|
||||
start: 53,
|
||||
name: {
|
||||
start: 53,
|
||||
name: "prop",
|
||||
type: "Identifier",
|
||||
end: 57
|
||||
},
|
||||
optional: false,
|
||||
typeAnnotation: {
|
||||
start: 58,
|
||||
type: "StringTypeAnnotation",
|
||||
end: 64
|
||||
},
|
||||
type: "FunctionTypeParam",
|
||||
end: 64
|
||||
}
|
||||
],
|
||||
rest: null,
|
||||
typeParameters: null,
|
||||
returnType: {
|
||||
start: 67,
|
||||
type: "VoidTypeAnnotation",
|
||||
end: 71
|
||||
},
|
||||
type: "FunctionTypeAnnotation",
|
||||
end: 71
|
||||
},
|
||||
key: {
|
||||
start: 29,
|
||||
name: "didAnimate",
|
||||
type: "Identifier",
|
||||
end: 39
|
||||
},
|
||||
optional: false,
|
||||
type: "ObjectTypeProperty",
|
||||
end: 72
|
||||
}
|
||||
],
|
||||
indexers: [],
|
||||
type: "ObjectTypeAnnotation",
|
||||
end: 74
|
||||
},
|
||||
type: "DeclareClass",
|
||||
end: 74
|
||||
},
|
||||
'declare class A {}': {
|
||||
type: 'DeclareClass',
|
||||
id: {
|
||||
|
||||
@@ -70,7 +70,7 @@ suite("api", function () {
|
||||
|
||||
assert.deepEqual(transform('import localName from "./array";', {
|
||||
resolveModuleSource: function() {
|
||||
return 'override-source';
|
||||
return "override-source";
|
||||
}
|
||||
}).metadata.modules.imports, [
|
||||
{
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
function foo(
|
||||
x: Object,
|
||||
...types
|
||||
): { types: Array<number>, x: Object } {
|
||||
return {
|
||||
types: types,
|
||||
x: x,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
|
||||
function foo(x) {
|
||||
for (var _len = arguments.length, types = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||||
types[_key - 1] = arguments[_key];
|
||||
}
|
||||
|
||||
return {
|
||||
types: types,
|
||||
x: x
|
||||
};
|
||||
}
|
||||
@@ -12,7 +12,7 @@ suite("traversal path", function () {
|
||||
plugins: [new Plugin("foobar", {
|
||||
visitor: {
|
||||
FunctionDeclaration: function () {
|
||||
return "console.whatever()";
|
||||
this.replaceWithSourceString("console.whatever()");
|
||||
}
|
||||
}
|
||||
})]
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
--reporter spec
|
||||
--reporter dot
|
||||
--ui tdd
|
||||
|
||||
16
tools/build-website.sh
Executable file
16
tools/build-website.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if [ ! -d ./_babel.github.io ]; then
|
||||
git clone git@github.com:babel/babel.github.io.git _babel.github.io
|
||||
fi
|
||||
|
||||
cd _babel.github.io
|
||||
|
||||
if [ ! -d ./_babel ]; then
|
||||
ln -s .. _babel
|
||||
fi
|
||||
|
||||
make build
|
||||
git commit -am "${TRAVIS_TAG}"
|
||||
git push "https://${GH_TOKEN}@github.com/babel/babel.github.io"
|
||||
14
tools/merge-development-with-master.sh
Executable file
14
tools/merge-development-with-master.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
echo "Branch: $TRAVIS_BRANCH"
|
||||
echo "Commit: $TRAVIS_COMMIT"
|
||||
|
||||
if [ "$TRAVIS_BRANCH" != "development" ]; then
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
git fetch origin master:master
|
||||
git checkout master
|
||||
git merge "$TRAVIS_COMMIT"
|
||||
git push "https://${GH_TOKEN}@github.com/babel/babel"
|
||||
17
tools/publish-cli.sh
Executable file
17
tools/publish-cli.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
LAST_TAG=$(git describe $(git rev-list --tags --max-count=1))
|
||||
TAG_DIFF=$(git diff $LAST_TAG -- packages/babel-cli/)
|
||||
|
||||
if [ -n "$TAG_DIFF" ]; then
|
||||
echo "Changes detected to babel-cli since last tag, publishing new version."
|
||||
|
||||
cd ../packages
|
||||
node build-cli.js
|
||||
|
||||
cd babel-cli
|
||||
npm publish
|
||||
else
|
||||
echo "No changes detected to babel-cli since last tag"
|
||||
fi
|
||||
5
tools/setup-git.sh
Executable file
5
tools/setup-git.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
git config user.name "sebmckbot"
|
||||
git config user.email "sebmckbbot@gmail.com"
|
||||
Reference in New Issue
Block a user