11611 Commits

Author SHA1 Message Date
Henry Zhu
e6d198eef5 v7.0.0-beta.48 v7.0.0-beta.48 2018-05-24 15:20:31 -04:00
Logan Smyth
86aacad2bc Disallow coverage on bundles. 2018-05-24 09:15:44 -07:00
Nicolò Ribaudo
6eab6f5863 [Babylon] Take the first set of options for plugins (#7994)
* [Babylon] Take the first set of options for plugins

* Fix test

* Docs
2018-05-24 08:54:32 -07:00
Brian Ng
555ee80f43
Fix some ts test fixtures 2018-05-24 10:03:03 -05:00
Brian Ng
a94cbf760a
Set exprAllowed to false when parsing TSNonNullExpression (#7968) 2018-05-24 09:31:08 -05:00
Jimmy Jia
7489f8da7b Fix include/exclude syntax in preset-env README [ci skip] (#8020) 2018-05-23 22:09:54 -04:00
Nicolò Ribaudo
dccaec7691 Update types (BigInt) 2018-05-24 00:30:57 +02:00
Nicolò Ribaudo
c992f5b61e Remove duplicated test (in the old babylon folder) 2018-05-24 00:30:57 +02:00
Logan Smyth
5cd1276a27
Expose the Flow 'all' option on the preset too. (#8016)
| Q                        | A <!--(Can use an emoji 👍) -->
| ------------------------ | ---
| Fixed Issues?            | 
| Patch: Bug Fix?          | 
| Major: Breaking Change?  |
| Minor: New Feature?      |
| Tests Added + Pass?      | Yes
| Documentation PR         | <!-- If so, add `[skip ci]` to your commit message to skip CI -->
| Any Dependency Changes?  |
| License                  | MIT

The `all` option landed in https://github.com/babel/babel/pull/7934/files#diff-3a8233bcd2766d2c7d87f23f944f7726R3 but it is only exposed from the plugin, not the preset, so this exposes it there too since the flow preset is what we want people to use.
2018-05-23 13:40:22 -07:00
Justin Ridgewell
2af7a33c4e Fix class inheritance in IE10 (#7969)
* Revert "Move subclass inheritance to end (#7772)"

This reverts commit f8ab9466d331871a90f458af40b14e8d831e0c29.

* Only use getPrototypeOf if setPrototypeOf is implemented

* Update fixtures

* Helpers updates

* Update fixtures

* Fall back to getPrototypeOf

* Update fixtures
2018-05-23 16:21:21 -04:00
Nicolò Ribaudo
ffe04d9195 [babylon] Refactor mixin plugins handling & validation (#7999) 2018-05-23 15:28:05 -04:00
Nicolò Ribaudo
b33823e7f8 Better error message for invalid decorators syntax (#7986) 2018-05-23 15:26:35 -04:00
Logan Smyth
007bfb6565
Merge pull request #8010 from loganfsmyth/babel-node-options
Add more of babel-cli's options to babel-node too for consistency.
2018-05-23 09:47:58 -07:00
Logan Smyth
c8faa34848 Only set '.babelrc' option if user explicitly set it. 2018-05-23 09:25:43 -07:00
Logan Smyth
5bcca0123a Add --env-name option to babel-node, like babel-cli's option. 2018-05-23 09:25:05 -07:00
Logan Smyth
1d987fb655 Add --config-file option to babel-node, like babel-cli's option. 2018-05-23 09:23:50 -07:00
Logan Smyth
06e5c46c8d Fix typo in option validation. 2018-05-23 09:23:14 -07:00
Sven SAULEAU
52b800decb Add no-babelrc option in babel-node (#5621)
<!-- 
Before making a PR please make sure to read our contributing guidelines 
https://github.com/babel/babel/blob/master/CONTRIBUTING.md

For any issue references: Add a comma-separated list of a [closing word](https://help.github.com/articles/closing-issues-via-commit-messages/) followed by the ticket number fixed by the PR
-->

| Q                        | A <!--(yes/no) -->
| ------------------------ | ---
| Patch: Bug Fix?          | 
| Major: Breaking Change?  | 
| Minor: New Feature?      | y
| Deprecations?            | 
| Spec Compliancy?         | 
| Tests Added/Pass?        | y/y
| Fixed Tickets            | #5616
| License                  | MIT
| Doc PR                   | <!-- if yes, add `[skip ci]` to your commit message to skip CI builds -->
| Dependency Changes       | 

<!-- Describe your changes below in as much detail as possible -->

Once merged I will make the corresponding documentation changes on the website (in a 7 branch)
2018-05-23 09:19:39 -07:00
Sven SAULEAU
01d969a182
Merge pull request #8009 from babel/xtuc-patch-2
update AST spec - interpreter
2018-05-23 12:57:10 +02:00
Sven SAULEAU
7d99a96f9f
docs: [skip ci] add InterpreterDirective 2018-05-23 09:50:23 +02:00
Sven SAULEAU
ad1de09b5f
docs: [skip ci] update AST spec 2018-05-23 09:42:33 +02:00
Logan Smyth
6b91d6434d Add a try/catch on inline data-uri sourcemaps too, and add debug logging. 2018-05-22 23:38:16 -07:00
Michael Lavina
18796173ab feat(sourcemap): parse external source maps when normalizing (#7980) 2018-05-22 23:29:10 -07:00
Logan Smyth
eb3334a14e
Merge pull request #7955 from loganfsmyth/typescript-filename-required
Verify that files are .ts/.tsx before treating as Typescript files.
2018-05-22 22:41:39 -07:00
Logan Smyth
5e00c96368
Handle Infinity, -Infinity, NaN, and -0 in t.valueToNode(). (#8005)
| Q                        | A <!--(Can use an emoji 👍) -->
| ------------------------ | ---
| Fixed Issues?            | Fixes #8001
| Patch: Bug Fix?          | Y
| Major: Breaking Change?  | Not unless things were relying on a very specific AST structure as output
| Minor: New Feature?      |
| Tests Added + Pass?      | Yes
| Documentation PR         | <!-- If so, add `[skip ci]` to your commit message to skip CI -->
| Any Dependency Changes?  |
| License                  | MIT

The filed bug was for `-0`, but I also realize that `numericLiteral` also shouldn't be getting `-Infinity`/`Infinity` or `NaN` since those just get stringified with the JS-standard stringification logic which means we get a reference to `NaN` or `Infinity` identifiers, which could have been shadowed in a local scope and thus not be the right value. I've avoided that by generating `NaN` as `0/0` and the infinity values as `1/0` and `-1/0`.
2018-05-22 14:37:06 -07:00
Henry Zhu
b4d18f4764
Bigint Support without transform (#8006) 2018-05-22 15:31:34 -04:00
Brian Ng
981bff08e4 Fix some flow issues in @babel/parser flow plugin (#8002) 2018-05-22 10:48:49 -07:00
Nicolò Ribaudo
7d641d2e74
Update babel-types docs (InterpreterDirective) [skip ci] (#8004)
Introduced in #7928
2018-05-22 17:50:15 +02:00
Logan Smyth
f2882d570a Tests for react/ts compat and flow/ts compat. 2018-05-21 21:21:00 -07:00
Logan Smyth
cc5aeb3b50 Allow .ts and .tsx test fixtures. 2018-05-21 20:31:40 -07:00
Logan Smyth
d164f820e6
Merge pull request #7928 from loganfsmyth/shebang-node
Create InterpreterDirective AST node type and use to replace babel/core File's 'shebang' handling
2018-05-21 20:02:12 -07:00
Logan Smyth
43aa61d6be Make the typescript preset require a filename unless the user configured it for general use. 2018-05-21 18:34:50 -07:00
Logan Smyth
ca1c98b255 Allow .overrides and .env inside presets. 2018-05-21 18:23:07 -07:00
Logan Smyth
0963dbddea Rely on Babylon for interpreter directive parsing, instead of babel/core. 2018-05-21 18:19:59 -07:00
Logan Smyth
2058e0686e Add support for an InterpreterDirective AST node. 2018-05-21 18:19:58 -07:00
Logan Smyth
c0013264b7 Add tests for interpreter directive with retainLines and sourcemaps. 2018-05-21 18:08:32 -07:00
Logan Smyth
442ead701c Fix a few out-of-order test results. 2018-05-21 18:08:31 -07:00
Logan Smyth
5fb3696955 Avoid flow errors now that we've renamed Babylon to babel-parser. 2018-05-21 18:06:17 -07:00
Logan Smyth
69cca412eb
Make the filename option, as exposed to the plugins, consistently relative to the working directory (#7956)
| Q                        | A <!--(Can use an emoji 👍) -->
| ------------------------ | ---
| Fixed Issues?            | 
| Patch: Bug Fix?          | Y
| Major: Breaking Change?  | N
| Minor: New Feature?      |
| Tests Added + Pass?      | Yes
| Documentation PR         | <!-- If so, add `[skip ci]` to your commit message to skip CI -->
| Any Dependency Changes?  |
| License                  | MIT

Currently the `opts.filename` value exposed to plugins is just whatever the user passed. While it _could_ be relative to the working directory, if Babel was passed an absolute URL, it'll be absolute.

This PR explicitly ensures the filename is a relative path based on the working directory. This also exposes an officially endorsed API for reading the working directory path.
2018-05-21 17:10:57 -07:00
Mike Nason
3bee37b14d fix typo in error message (#7995) 2018-05-21 12:18:09 -07:00
Miguel Albernaz
bc757c8b75 passes the jsxPragma options from preset-typescript to plugin-transform-typescript (#7990) 2018-05-21 14:33:43 -04:00
Conor Hastings
c558dedd7b fix typo of babel in readme (#7992) [skip ci] 2018-05-21 07:42:13 +02:00
Justin Ridgewell
0879a6d608
Subsume json (#7985)
* Add Subsume JSON transform

https://github.com/tc39/proposal-json-superset is at stage 3.

This allows U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR to appear unescaped inside strings and directives.

* Move to Stage 3

* Break diretive parsing

* Update README

* Handle multi-escape sequences

* Remove babylon files after rename
2018-05-19 15:32:05 -04:00
Henry Zhu
51eef099b3 fixes [skip ci] 2018-05-19 00:12:26 -04:00
Chaitanya Kumar Kamatham
daf0ca8680 Rename "babylon" to "@babel/parser" (#7937) 🎉 2018-05-19 00:03:05 -04:00
Justin Ridgewell
0200a3e510
Build InterfaceTypeAnnotation generated type code (#7982) 2018-05-18 14:41:19 -04:00
Justin Ridgewell
27c39c512d
Class private properties (#7842)
* Update member-expression-to-functions

1. Babel using British spellings, so `memoise`
2. Provide a helper `AssignmentMemoiser` class, which will assign the memo'd value with the `n`th access.

* Private properties!

* Fixes

* Tests

* Update helper name

* Fix privates that reference other privates

* Don't extend a builtin

* Rebase
2018-05-18 14:03:23 -04:00
Ben Newman
70eb206c03 TypeScript: Fix TSInferType .typeParameter type. (#7967)
Follow-up to https://github.com/babel/babel/pull/7404

There is no TypeParameter type in the Babylon TypeScript AST hierarchy.
Flow does have a TypeParameter type, but it should not be confused with
the TypeScript TSTypeParameter, since Flow !== TypeScript, and the types
have totally different fields. Instead, the .typeParameter.type of a
Babylon-parsed TSInferType node should be TSTypeParameter.

It would probably be fine to leave the declared type of the TSInferType
.typeParameter field as TSType instead of TSTypeParameter, but the more
specific TSTypeParameter type should be safe/correct, since the TypeScript
parseInferType function always uses SyntaxKind.TypeParameter:
66d6e5e6e0/src/compiler/parser.ts (L3006)

I noticed this typo because it has been causing ast-types test failures
lately, e.g. https://travis-ci.org/benjamn/ast-types/jobs/369634972
2018-05-18 10:15:48 -05:00
Nicolò Ribaudo
229179b8aa Update babel-types (flow internal slots) (#7977) 2018-05-18 08:47:31 -05:00
Sam Goldman
6baa36cdc5 Support Flow's inline interface syntax (#7973)
* Support Flow's inline interface syntax

* Fix babel-generator
2018-05-18 08:11:27 -05:00