From 2282d066a2717da468a764c3fd9ad6e3d36149d9 Mon Sep 17 00:00:00 2001
From: Jesse McCarthy
Date: Tue, 9 Jun 2015 14:54:24 -0400
Subject: [PATCH 1/6] Start `doc` dir for internals documentation.
---
doc/index.md | 4 ++++
doc/node-props.md | 11 +++++++++++
2 files changed, 15 insertions(+)
create mode 100644 doc/index.md
create mode 100644 doc/node-props.md
diff --git a/doc/index.md b/doc/index.md
new file mode 100644
index 0000000000..5a87389d00
--- /dev/null
+++ b/doc/index.md
@@ -0,0 +1,4 @@
+This is a collection of documentation about babel internals, for use in development of babel.
+
+# [Properties of nodes](/doc/node-props.md)
+These are properties babel stores in AST node objects for internal use, as opposed to properties that are part of the AST spec (ESTree at the time of this writing).
diff --git a/doc/node-props.md b/doc/node-props.md
new file mode 100644
index 0000000000..b44470d196
--- /dev/null
+++ b/doc/node-props.md
@@ -0,0 +1,11 @@
+# Properties of nodes
+These are properties babel stores in AST node objects for internal use, as opposed to properties that are part of the AST spec (ESTree at the time of this writing).
+
+## `_blockHoist`
+`node._blockHoist != null` triggers the [block-hoist transformer](/src/babel/transformation/transformers/internal/block-hoist.js). Value should be `true` or an integer in the range `0..3`. `true` is equivalent to `2`. The value indicates whether the node should be hoisted and to what degree. See the source code for more detailed information.
+
+## `_paths`
+Stores a representation of a node's position in the tree and relationship to other nodes.
+
+## `shadow`
+A truthy value on a function node triggers the [shadow-functions transformer](/src/babel/transformation/transformers/internal/shadow-functions.js), which transforms the node so that it references (or inherits) `arguments` and `this` from the parent scope. It is invoked for arrow functions, for example.
From 0650eedeb6a618f72a5af3bf48e12ad5e8386937 Mon Sep 17 00:00:00 2001
From: Jesse McCarthy
Date: Tue, 9 Jun 2015 14:55:38 -0400
Subject: [PATCH 2/6] Add reference to `doc` dir to CONTRIBUTING.
---
CONTRIBUTING.md | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index e4685c595c..9558d68dc2 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -12,6 +12,8 @@
Dependencies
|
Code Standards
+ |
+ Internals
----
@@ -173,3 +175,6 @@ your [`$PATH`](http://unix.stackexchange.com/questions/26047/how-to-correctly-ad
* **Declaration**
* No unused variables
* No pollution of global variables and prototypes
+
+#### Internals
+Please see [`/doc`](/doc) for internals documentation relevant to developing babel.
From 5eb1850a55af75ef042c098ae3ae9ca4b1dafbaa Mon Sep 17 00:00:00 2001
From: Arthur Verschaeve
Date: Wed, 10 Jun 2015 16:51:39 +0200
Subject: [PATCH 3/6] Update `util.booleanify()` return type
Ref https://github.com/babel/babel/commit/62f37c1e6212f14a2c23d7db34a985d2a321ee2b
---
src/babel/util.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/babel/util.js b/src/babel/util.js
index 0d2a5549a2..123209e239 100644
--- a/src/babel/util.js
+++ b/src/babel/util.js
@@ -102,7 +102,7 @@ export function arrayify(val: any, mapFn?: Function): Array {
return [val];
}
-export function booleanify(val: any): boolean {
+export function booleanify(val: any) {
if (val === "true") return true;
if (val === "false") return false;
return val;
From 2e20364793dc10702fb0f30bc891d80709d0270e Mon Sep 17 00:00:00 2001
From: Stephen Sugden
Date: Fri, 12 Jun 2015 20:58:41 +0200
Subject: [PATCH 4/6] Remove duplicate keys from alias-keys.json
Fixes #1734
---
src/babel/types/alias-keys.json | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/babel/types/alias-keys.json b/src/babel/types/alias-keys.json
index 89e2a9b52c..4e9d074735 100644
--- a/src/babel/types/alias-keys.json
+++ b/src/babel/types/alias-keys.json
@@ -76,8 +76,6 @@
"ThisExpression": ["Expression"],
"Super": ["Expression"],
"UpdateExpression": ["Expression"],
- "JSXEmptyExpression": ["Expression"],
- "JSXMemberExpression": ["Expression"],
"AnyTypeAnnotation": ["Flow", "FlowBaseAnnotation"],
"ArrayTypeAnnotation": ["Flow"],
From f21d935de52d1bad29181dede5dd8aeb2d28b054 Mon Sep 17 00:00:00 2001
From: Stephen Sugden
Date: Fri, 12 Jun 2015 12:24:24 -0700
Subject: [PATCH 5/6] Add aliases from JSX* tags to Expression
---
src/babel/types/alias-keys.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/babel/types/alias-keys.json b/src/babel/types/alias-keys.json
index 4e9d074735..d951b6f18e 100644
--- a/src/babel/types/alias-keys.json
+++ b/src/babel/types/alias-keys.json
@@ -114,10 +114,10 @@
"JSXAttribute": ["JSX", "Immutable"],
"JSXClosingElement": ["JSX", "Immutable"],
"JSXElement": ["JSX", "Immutable", "Expression"],
- "JSXEmptyExpression": ["JSX", "Immutable"],
+ "JSXEmptyExpression": ["JSX", "Immutable", "Expression"],
"JSXExpressionContainer": ["JSX", "Immutable"],
"JSXIdentifier": ["JSX"],
- "JSXMemberExpression": ["JSX"],
+ "JSXMemberExpression": ["JSX", "Expression"],
"JSXNamespacedName": ["JSX"],
"JSXOpeningElement": ["JSX", "Immutable"],
"JSXSpreadAttribute": ["JSX"]
From 7e9660efd35a83e286741ab7ef9055b7d8bf2dc8 Mon Sep 17 00:00:00 2001
From: Andres Suarez
Date: Wed, 10 Jun 2015 15:12:15 -0400
Subject: [PATCH 6/6] Fix "--help" distinguish optional transforms
---
packages/babel-cli/bin/babel/index.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/packages/babel-cli/bin/babel/index.js b/packages/babel-cli/bin/babel/index.js
index 4f27e33493..40d2ddd712 100755
--- a/packages/babel-cli/bin/babel/index.js
+++ b/packages/babel-cli/bin/babel/index.js
@@ -35,7 +35,7 @@ each(options, function (option, key) {
if (option.description) desc.push(option.description);
commander.option(arg, desc.join(" "));
-})
+});
commander.option("-x, --extensions [extensions]", "List of extensions to compile when a directory has been input [.es6,.js,.es,.jsx]");
commander.option("-w, --watch", "Recompile files on changes");
@@ -51,7 +51,7 @@ commander.on("--help", function () {
each(keys(obj).sort(), function (key) {
if (key[0] === "_") return;
- if (obj[key].optional) key = "[" + key + "]";
+ if (obj[key].metadata.optional) key = "[" + key + "]";
console.log(" - " + key);
});