344 Commits

Author SHA1 Message Date
Logan Smyth
76bb1dffaa Track sourcemap location on a stack - fixes T7255 2016-04-11 01:54:40 -07:00
Logan Smyth
c3ccddaaaf Revert "Merge pull request #3433 from loganfsmyth/bail-out-rename"
This reverts commit 2d0a007d14e519fe60a849dd17068a0f3df79a28, reversing
changes made to e4d6d420415a0c290a321fb6c18ba5f19675b5c1.
2016-04-08 09:09:48 -07:00
Logan Smyth
3af8ec16e9 Handle input source mappings with no source location - fixes T7151 2016-04-07 09:34:45 -07:00
Logan Smyth
078f6c0ed3 Only attempt to rename export declarations, not expressions - fixes T7215 2016-03-16 23:26:52 -07:00
Amjad Masad
f6ff14624f localize side-effectful test 2016-03-16 18:13:40 -07:00
Amjad Masad
fd7b1c3386 don't rely on scope to get the type alias 2016-03-10 12:13:05 -08:00
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
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
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
Henry Zhu
937b8a6767 use flow instead of flow-comments 2016-03-04 15:50:05 -05:00
Henry Zhu
0916e2d189 Give specific error messages for babel 5 options that were removed in babel 6 2016-02-29 14:34:46 -05:00
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
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
Henry Zhu
6425c47537 Show a better error when trying to use a babel 5 plugin 2016-02-17 20:31:49 -05:00
Henry Zhu
9182fcd71b make a test for #3303 2016-02-04 10:54:14 -05:00
Sebastian McKenzie
35e8250b57 add a top level analyze method for path marking sugar 2016-02-03 21:29:47 +00:00
Amjad Masad
12b7a44796 Merge pull request #3281 from DmitrySoshnikov/pass_per_preset
[RFC] Pass per preset
2016-01-22 14:29:07 -08:00
Dmitry Soshnikov
845a4fa557 Pass per preset: Use full function systax in test for old Node versions 2016-01-21 15:14:42 -08:00
Dmitry Soshnikov
e2486b5f71 Pass per preset: added unit test 2016-01-21 14:54:40 -08:00
Sebastian McKenzie
65a4c8f4a4 Merge branch 'source-map-reenter' of https://github.com/kpdecker/babel into kpdecker-source-map-reenter
Conflicts:
	packages/babel-generator/src/printer.js
2016-01-18 18:36:57 +00:00
Henry Zhu
10105bb077 Add test for 2892 2016-01-14 17:23:20 -05:00
Amjad Masad
0d8e5a9e86 Fix over-parenthesizing of function expressions 2015-12-24 14:55:51 -08:00
Sebastian McKenzie
1fa24b1efd rename babel-plugin-external-helpers-2 to babel-plugin-external-helpers 2015-12-24 03:54:40 +00:00
Jesse McCarthy
77f5d30fb1 Add test for file-relative addon resolution
Plugins & presets.
2015-12-22 14:25:23 -05:00
kpdecker
94e7e4da8e Update source map handling to be reentrant
Rather than repeating the original location when we exit a node, we need to restore the previous parent’s original line location, since the source map format denotes the start location.
2015-12-18 01:11:32 -06:00
kpdecker
9b79fbcdf5 Avoid emitting duplicate source map entries 2015-12-18 00:57:48 -06:00
Amjad Masad
12fac9cadf Inference recursion bug 2015-12-15 19:56:27 -08:00
Amjad Masad
036e90e9cc Fix bug with evaluating an expression in it's own binding 2015-12-06 07:56:17 -08:00
Amjad Masad
35e575cf93 Print a block when encountering consequents that are if statements 2015-11-17 19:07:20 -08:00
Amjad Masad
507557c48e Add failing test 2015-11-17 18:45:35 -08:00
Amjad Masad
352a604fe2 Make sure the test fails 2015-11-11 12:07:23 -08:00
Sebastian McKenzie
884252b90f increase test coverage 2015-11-10 14:26:40 -08:00
Sebastian McKenzie
a55f210c7f fix buildExternalHelpers whitelist not including underscored helpers - fixes #2940 2015-11-10 03:40:35 -08:00
Sebastian McKenzie
15969a0904 move all plugin tests out of babel-core and into their appropriate folders 2015-11-08 23:04:10 -08:00
Sebastian McKenzie
5f40b53dee abstract out test runner into a module, move traceur and esnext tests to babel-preset-es2015, clean up and make existing tests more consistent 2015-11-08 21:58:01 -08:00
Sebastian McKenzie
da20aa90c1 omit defaultProps helper when there are no props 2015-11-08 17:10:33 -08:00
Sebastian McKenzie
b07f8c8eab fix react inline elements tests 2015-11-08 06:38:45 -08:00
Sebastian McKenzie
2a1a038031 move children prop pushing to after props to ensure correct order - fixes #2395 2015-11-08 06:24:10 -08:00
Sebastian McKenzie
8f00700b9f fix order of babel-register in test transformation helper script 2015-11-08 06:23:51 -08:00
Sebastian McKenzie
5f8aa92ea3 add Symbol/GetOwnPropertySymbols to traceur ignore tests 2015-11-08 05:42:05 -08:00
Sebastian McKenzie
9616e4b06c remove use of template literals in plugin regression exec test for unsupported environments 2015-11-08 05:33:13 -08:00
Sebastian McKenzie
9d8ee901d1 abstract out run exec test logic and add mutiline function 2015-11-08 05:32:59 -08:00
Sebastian McKenzie
9a1cf40296 Merge pull request #2861 from hzoo/i-2838
helper-remap-async-to-generator: account for ObjectMethod - fixes #2838
2015-11-06 19:40:30 -05:00
Sebastian McKenzie
a2202802e4 Merge pull request #2866 from hzoo/i-2865
transform-es2015-typeof-symbol: check for undefined - fixes #2865
2015-11-06 19:40:21 -05:00
Amjad Masad
8e2aae7e05 Introduce new tests for plugins 2015-11-06 15:14:20 -08:00
Henry Zhu
bb5a7804bc transform-es2015-typeof-symbol: check for undefined - fixes #2865 2015-11-06 06:54:51 -05:00
Henry Zhu
042af348bc helper-remap-async-to-generator: account for ObjectMethod - fixes #2838 2015-11-05 23:57:53 -05:00