7179 Commits

Author SHA1 Message Date
Logan Smyth
af4575c43e Expand the regression tests for T2765. 2016-03-08 08:15:42 -08:00
Amjad Masad
2f654650bb Merge pull request #3407 from babel/async-tests
Async context tests
2016-03-08 02:00:40 -08:00
Amjad Masad
b35013abe5 Merge pull request #3406 from babel/fix-scope-info
Update scope info after block-scoping transform
2016-03-08 00:57:18 -08:00
Amjad Masad
69773a45f4 Add more async context tests 2016-03-08 00:55:42 -08:00
Amjad Masad
57c6c4ea81 Add test for T2765 2016-03-08 00:47:18 -08:00
Amjad Masad
0200542e82 don't use Array.includes 2016-03-08 00:33:37 -08:00
Logan Smyth
bbc3401c71 Merge pull request #3405 from loganfsmyth/shadowing-fixes
Fix shadow function processing for async functions
2016-03-07 21:22:54 -08:00
Logan Smyth
de21f2ef77 Resolve 'arguments' for rest args relative to direct parent. 2016-03-07 20:45:21 -08:00
Logan Smyth
42d3844f24 Revert special arrow wrapper and avoid shadowing arguments. 2016-03-07 20:45:20 -08:00
Logan Smyth
51ddeade8a Avoid renaming this bindings in simple arrow function cases. 2016-03-07 20:45:20 -08:00
Logan Smyth
db3a43869c Remap across arrow function boundaries - fixes T7108 2016-03-07 20:45:19 -08:00
Logan Smyth
2e210927d8 Move the necessary exec transforms to the exec test. 2016-03-07 20:45:19 -08:00
Logan Smyth
836f398619 Re-use central inShadow logic. 2016-03-07 20:45:19 -08:00
Logan Smyth
8b8e3ddbec Flatten inShadow logic for readability. 2016-03-07 20:45:18 -08:00
Amjad Masad
891becffc1 Merge pull request #3363 from danez/patch-1
fix(babel-template): Fix Error in IE <= 9
2016-03-07 18:35:27 -08:00
Amjad Masad
3bebc3a7ca lint 2016-03-07 18:26:51 -08:00
Amjad Masad
77c7cc5363 Rework scope info updating in block-scoping transform
I previously tried an approach to scope bindings from var to scope but
it didn't catch all cases. This is evident in this bug:

https://phabricator.babeljs.io/T2892

Where even after transforming a const to a var we still get an error
that it's read-only.

This approach will go through and delete every existing let and const
binding and creates a new one with the kind "var"
2016-03-07 18:19:10 -08:00
Henry Zhu
1f92e5a15c Failing test for nested async with const 2016-03-07 13:59:03 -08:00
Amjad Masad
60d773f370 Merge pull request #3393 from babel/cache
Move NodePath cache out of the AST
2016-03-07 13:57:47 -08:00
Amjad Masad
5d0645e308 Merge pull request #3381 from keijokapp/fix-named-functionexpression-scoping-issue
Fix named async FunctionExpression scoping issue.
2016-03-07 13:39:52 -08:00
Amjad Masad
ec18fa0059 Add clearCache test 2016-03-07 12:50:57 -08:00
Amjad Masad
d5e78384ef Only export methods and not the entire cache 2016-03-07 12:50:29 -08:00
Amjad Masad
fc19ac2af5 Remove merge artificats 2016-03-07 12:05:46 -08:00
Amjad Masad
403d6153fd correct cache path 2016-03-07 12:04:44 -08:00
Amjad Masad
b53755422c Move things around 2016-03-07 12:04:44 -08:00
Amjad Masad
bf91a68375 Move scope cache to the cache module 2016-03-07 12:04:44 -08:00
Amjad Masad
3c148148bc Semicolon 2016-03-07 12:04:44 -08:00
Amjad Masad
5367d5d151 Make sure we update the cache in all the right places 2016-03-07 12:04:44 -08:00
Amjad Masad
29ef158204 Semis 2016-03-07 12:03:48 -08:00
Amjad Masad
b9a893aab6 Move NodePath cache out of the AST
As mentioned on the task https://phabricator.babeljs.io/T7179 having
this cache on the AST leads to all sorts of portability and reuse
bugs.

This moves the cache into a clearable WeakMap which will fix the
following:

1. Moving the AST between different babel versions or tools will not
lead into sharing potentially outdated cached information

2. `.clear()` can be called on the cache by a plugin to clear
potentially outdated information. This is helpful when implementing two
seperate pipelines that should not share information.

I think the next step (which is harder, I tried) is to isolate cache and
make it live on a transform or pipeline level state (like the `hub`).

The reason it is hard is because the `babel-traverse` main API -- although
requires the state object to be passed -- not many callers do. To fix
this we should release a patch version that warns about this and fix all
the internal callers. Next couple of releases we can start throwing when
no state is passed (or we can create our own state).
2016-03-07 12:03:48 -08:00
Amjad Masad
b7465843dd Merge pull request #3375 from jmm/parameters-rest-optimization-errors
Fix errors in parameters rest transformation [T7138]
2016-03-07 11:58:15 -08:00
Amjad Masad
4b2a660ee0 Merge pull request #3323 from divmain/master
Source-map support for multiple input source files
2016-03-07 11:57:59 -08:00
Dale Bustad
3c6c09d00a Only detect indent if babel-generator is provided code string, vs multi-source object. 2016-03-07 02:47:28 -08:00
Dale Bustad
288b3ba559 Attach filename property to node.loc when provided. 2016-03-07 02:47:28 -08:00
Dale Bustad
f007b51554 Accept filename-to-file-content hash as code parameter of generate. 2016-03-07 02:47:28 -08:00
Dale Bustad
26dcd6400f When generating sourcemaps, use per-node source filename if present. 2016-03-07 02:47:27 -08:00
Henry Zhu
d7342542b7 Merge pull request #3385 from samwgoldman/def-site-variance
Add support for Flow def-site variance syntax
2016-03-06 18:00:38 -05:00
Sam Goldman
a38a58bad8 Add support for Flow def-site variance syntax
This syntax allows you to specify whether a type variable can appear in
a covariant or contravariant position, and is super useful for, say,
Promise.

Right now this is hacked in jankily, but in the next major release we
should stop using Identifier nodes for type parameters.
2016-03-06 14:44:09 -08:00
Henry Zhu
5eb13059e2 Merge pull request #3383 from babel/T7160
Regression with exporting an arrow function with a default param
2016-03-06 15:40:27 -05:00
Henry Zhu
57ef6a2b6a v6.6.5 2016-03-04 18:16:17 -05:00
Henry Zhu
d915508877 remove misc alias files 2016-03-04 17:58:49 -05:00
Henry Zhu
5cc2037b1b Merge pull request #3401 from babel/changelog-6.6.5
6.6.5 changelog [ci skip]
2016-03-04 17:55:55 -05:00
Henry Zhu
54cbefaa27 6.6.5 changelog [ci skip] 2016-03-04 17:47:26 -05:00
Henry Zhu
3689cae8e5 Merge pull request #3399 from babel/flow-comments
use flow instead of flow-comments
2016-03-04 16:24:28 -05:00
Henry Zhu
937b8a6767 use flow instead of flow-comments 2016-03-04 15:50:05 -05:00
Callum Locke
2870eaf669 Add breakConfig option to babel's own babel config 2016-03-04 12:56:57 +00:00
Amjad Masad
92ed05640c Merge pull request #3398 from babel/revert-rm-flow
Revert "Remove flow"
2016-03-03 16:07:24 -08:00
Amjad Masad
2d05996810 Merge pull request #3397 from babel/hzoo-patch-1
Make sure lib is clean before publishing
2016-03-03 15:22:54 -08:00
Amjad Masad
2f5a17fd90 fix eslint 2016-03-03 15:22:16 -08:00
Amjad Masad
2fbe28cc88 Remove remaining @flow annotations 2016-03-03 15:10:59 -08:00