125 Commits

Author SHA1 Message Date
Henry Zhu
b8cdd6e28c Merge pull request #3365 from jridgewell/replace-implicit-arrow-with-block
Replace arrow expression body with block statement
2016-02-25 22:02:31 -05:00
Logan Smyth
01003b954a Re-queue nodes inserted with .replaceWith and centralize logic - fixes T2817 2016-02-22 22:44:03 -08:00
Justin Ridgewell
de1431e8c6 Replace arrow expression body with block statement
Original PR: https://github.com/babel/babel/pull/2469. Seems this got
lost in the v6 changes.

- - -

Without this, the only way to replace the arrow function is to either
manually override its `node.body`, or duplicate the arrow:

```js
// Old
ArrowFunctionExpression: function (node) {
  node.body = t.blockStatement(...);
  // Or
  return t.ArrowFunctionExpression(
    node.params,
    t.blockStatement(...),
    node.async
  );
}

// New
ArrowFunctionExpression: function() {
  this.get("body").replaceWith(t.blockStatement(...));
}
```
2016-02-20 04:36:40 -05:00
Logan Smyth
39c9066e40 Merge pull request #3359 from loganfsmyth/context-queueing-order
Queue regeneratorRuntime so it is transformed before Program#exit
2016-02-15 21:23:45 -08:00
Sebastian McKenzie
5b89849f43 Switch to klint, fix some lint rules 2016-02-14 23:25:14 +00:00
Logan Smyth
96a6d9f92e Queue regeneratorRuntime so it is transformed before Program#exit - fixes T7041 2016-02-13 22:56:03 -08:00
Henry Zhu
f9f8ad6eff v6.5.0 2016-02-06 19:06:41 -05:00
Henry Zhu
c2d7e95e1a add some more flow types 2016-02-04 11:07:03 -05:00
Jason
523a9d1d00 [traverse] nit 2016-02-03 17:46:34 +08:00
Jason
bbdd4aaf21 Ignore isolated paths when traversing 2016-01-23 18:39:14 +08:00
Henry Zhu
e152e7044e v6.4.5 2016-01-19 18:02:31 -05:00
Amjad Masad
1264709226 Merge pull request #3274 from babel/fix-function-decl
Method names should not be bound to body
2016-01-18 10:57:19 -08:00
Henry Zhu
51dfd2237e Internal: temporarily remove flow types
- Will need to investigate the issue regarding eslint/babel-eslint.
2016-01-17 17:14:57 -05:00
Amjad Masad
95c93dd22b Method names should not be bound to body
As an artificat of compiling methods to named function expressions the
function name is being considered a "local" binding in the function
body. This means that we will throw errors anytime someone would want to
create a new local binding with the same name.

This is solved by assigning a symbol to function Identifiers that
indicates that they should not be considered local bindings.
2016-01-17 13:19:37 -08:00
Jordan Klassen
0c1eddfd52 Add documentation comment for visitors.explode 2016-01-14 13:41:19 -08:00
Amjad Masad
ae8b7ea352 v6.3.26 2015-12-22 23:11:59 -08:00
Amjad Masad
6ce463399d Fix evaluation bug with || 2015-12-22 20:48:50 -08:00
Amjad Masad
76eae9bcd8 add failing test 2015-12-22 20:47:08 -08:00
Amjad Masad
705b0959e7 v6.3.25 2015-12-21 13:59:11 -08:00
Amjad Masad
a5b9afbebe Make sure we always return when not confident 2015-12-21 02:04:16 -08:00
Amjad Masad
902d04b8f1 Failing test 2015-12-21 02:04:16 -08:00
Amjad Masad
2b69dec01a v6.3.24 2015-12-18 15:53:49 -08:00
Amjad Masad
57b2ccdb66 Test and workaround inference bugs 2015-12-18 03:15:27 -08:00
Amjad Masad
31032ee7ad v6.3.21 2015-12-18 00:23:03 -08:00
Sebastian McKenzie
a8a58aaa07 Fix infinite recursion bug 2015-12-17 14:44:18 +00:00
Amjad Masad
9303517bab v6.3.19 2015-12-14 14:11:36 -08:00
Logan Smyth
afcfba2075 Only rename outer function bindings on conflict - fixes T6781 2015-12-13 15:35:28 -08:00
Amjad Masad
1fbbdd61e3 v6.3.17 2015-12-10 17:20:27 -08:00
Amjad Masad
2a2cb4f160 Support ObjectProperty in purity check 2015-12-09 16:49:16 -08:00
Henry Zhu
94edd6e461 v6.3.16 2015-12-08 23:10:41 -05:00
Henry Zhu
14bad622f2 add second param 2015-12-07 15:20:30 -05:00
Amjad Masad
6601a6f737 Support unary expression in isPure check 2015-12-07 11:55:21 -08:00
Logan Smyth
05fc7ee05b Merge pull request #3137 from loganfsmyth/export-all-fail-T2763
Set the proper parents for new node paths - fixes T2763
2015-12-06 22:15:46 -08:00
Henry Zhu
3f7019f964 v6.3.15 2015-12-06 11:31:46 -05:00
Henry Zhu
d06cfe63c2 eslint: add space-after-keywords 2015-12-06 11:30:07 -05:00
Amjad Masad
350ee82a83 add comment 2015-12-06 08:00:15 -08:00
Amjad Masad
036e90e9cc Fix bug with evaluating an expression in it's own binding 2015-12-06 07:56:17 -08:00
Logan Smyth
f37acd293c Set the proper parents for new node paths - fixes T2763 2015-12-05 16:16:02 -08:00
Logan Smyth
a12a116b9f Ensure that default exports have a name before splitting them - fixes T6750 2015-12-05 15:28:48 -08:00
Henry Zhu
0587a5d12c v6.3.14 2015-12-04 13:52:36 -05:00
Logan Smyth
8efd1d71ad Properly resolve scope from switch statement - fixes T6761 2015-12-04 09:04:25 -08:00
Sebastian McKenzie
7b36967416 v6.3.13 2015-12-04 22:56:51 +11:00
Sebastian McKenzie
ae831c2270 v6.3.12 2015-12-04 22:56:13 +11:00
Henry Zhu
b515fa8db8 v6.3.2 2015-12-03 22:48:04 -05:00
Logan Smyth
d71b59d0cc Ensure we always push into a BlockStatement - fixes T3051 2015-12-02 19:41:22 -08:00
phantom10111
36ebe0c939 Fix static class properties in class expressions and anonymous default exported classes - fixes T2983 2015-12-01 17:59:53 +01:00
Sebastian McKenzie
ac90ea20ea v6.2.0 2015-11-18 20:33:47 -08:00
Sebastian McKenzie
89d9db8648 bump invariant dependency version 2015-11-17 23:02:29 -08:00
Daniel Lo Nigro
0076204f80 Fix Flow.
Removed `@flow` annotation from files that don't actually pass Flow check at the moment. These will be added back file by file once the files are properly converted to use Flow.

Closes #3064
2015-11-15 21:30:22 -08:00
Sebastian McKenzie
5b6a39f227 v6.1.20 2015-11-13 03:38:54 -08:00