Compare commits

...

309 Commits

Author SHA1 Message Date
Henry Zhu
73e64c6cb0 v7.0.0-beta.39 2018-01-30 15:27:19 -05:00
Brian Ng
3deb246c7d Add some es5 features to babel-preset-env (#6526) 2018-01-30 13:53:38 -06:00
Henry Zhu
1ebc229fa5 Revert "make babel injectable in babel-register" (#7298)
Revert "make babel injectable in babel-register"
2018-01-30 14:16:02 -05:00
Nicolò Ribaudo
cc4913699b Update packages/babylon/README.md [skip ci]
https://github.com/babel/babel/pull/7292#discussion_r164765384
2018-01-30 20:08:15 +01:00
Henry Zhu
82b6ee734b Revert "make babel injectable in babel-register" 2018-01-30 12:39:38 -05:00
Kai Cataldo
22c8f6376c babel-core: Add parse method (#7291) 2018-01-30 12:38:58 -05:00
Raja Sekar
023550c87b Docs: updated link relative to babel/babylon (#7292) [skip ci] 2018-01-30 12:05:43 -05:00
Henry Zhu
8e0d247e8c Fix: fixup package name [skip ci] 2018-01-30 12:04:52 -05:00
Naveen jain
65ae4ff15b Fix: export default decorated class parsed as class expression (#7189) 2018-01-30 12:00:29 -05:00
Owen Buckley
2185256589 update substitution placeholder message in @babel/template (#7255) 2018-01-30 11:54:31 -05:00
Mateusz Burzyński
3316a554bf Support cjs shorthand for modules option in preset-es2015 & preset-env (#7283) 2018-01-30 11:46:21 -05:00
Nicolò Ribaudo
252ea5a966 Fix reused nodes - part 2 (#7149) 2018-01-29 22:59:06 +01:00
Mateusz Burzyński
912bcc186d Fix reused nodes - part 1 (#7149) 2018-01-29 22:59:06 +01:00
Nicolò Ribaudo
63ae923987 Add t.cloneNode and deprecate t.clone and t.cloneDeep (#7149) 2018-01-29 22:59:06 +01:00
Nicolò Ribaudo
dde9274986 Disallow duplicated nodes in tests output (#7149) 2018-01-29 22:59:06 +01:00
Mauro Bringolf
ba111c13b5 Add notice on constant checks to documentation (#7279) [skip ci] 2018-01-29 09:23:01 -05:00
Sven SAULEAU
967414d926 Merge pull request #7273 from Janpot/babel-register-inject
make babel injectable in babel-register
2018-01-26 17:50:53 +01:00
Mauro Bringolf
92fc26d399 Remove check-constants plugin (#6987)
* Rebased onto new version

* Moved constants check into a separate method
2018-01-26 10:43:09 -05:00
Brian Ng
fa5eb4f605 Make comment props more consistent (#7246) 2018-01-26 10:39:52 -05:00
Jan Potoms
d6a782b09c use @babel/core 2018-01-26 16:36:29 +01:00
Jan Potoms
567d25cfa5 Document the feature 2018-01-26 08:38:16 +01:00
Jan Potoms
1da831baa4 improve spec 2018-01-25 10:26:21 +01:00
Jan Potoms
b0d8c62d1c Fix issue where babel was retained 2018-01-25 10:18:02 +01:00
Jan Potoms
0e570eceb2 make babel injectable in babel-register 2018-01-25 08:16:34 +01:00
Justin Ridgewell
ca18ea5e79 Re-add optional chaining delete (#7257)
* Re-add optional chaining delete

* Move exec tests next to output tests

* Forgot to commit these
2018-01-24 11:26:02 -08:00
Alexander Pepper
63d9998aa4 babel-preset-env: Fixed links in readme and improved "Built-ins" example (#7271) 2018-01-24 10:02:03 -06:00
Raja Sekar
88e550c733 removed plugin transform eval (#7262) 2018-01-23 17:31:45 -05:00
Andy
b96fdf8780 typescript: Fix enum emit when values are strings (#7160) 2018-01-23 15:42:32 -06:00
Justin Ridgewell
180eda3211 Remove old optional chain features (#6345) 2018-01-22 14:03:43 -08:00
Kristofer Baxter
b3969d35fa Add preset-env target esmodules (#7212) 2018-01-22 15:44:10 -06:00
Andy
dccfed3601 TypeScript: Support parsing 'unique' type operator (#7239) 2018-01-22 16:09:22 -05:00
Jamie Kyle
5759c33b4c Add opts.message option to code frames (#7243)
* Add opts.message option to code frames

* Fix for missing loc.start in code-frame

* Add docs
2018-01-21 14:19:20 +11:00
Brian Ng
193bccc93c Ensure isPureAnnotated returns a boolean 2018-01-20 13:42:49 -06:00
Brian Ng
5ce54799ff Tweak and add tests to babel-helper-annotate-as-pure (#7245) 2018-01-20 13:29:38 -05:00
Brian Ng
064c17e03f Bump prettier and related deps (#7244) 2018-01-20 17:00:21 +01:00
Matt Ziemer
f9804e6beb Add 'loose' option link for babel-preset-env (#7241)
- Added a external link to a good explanation of “loose” transformations.
http://2ality.com/2015/12/babel6-loose-mode.html
2018-01-20 14:34:52 +02:00
Henry Zhu
47ce7e71c9 Update to beta.38 (#7231) 2018-01-17 18:03:11 -05:00
Luca
5ac8ba19a4 Fix typo [skip ci] (#7229) 2018-01-17 13:43:59 -05:00
Henry Zhu
b5d20ab171 v7.0.0-beta.38 2018-01-17 11:31:32 -05:00
Henry Zhu
539009a980 Remove old command [skip ci] 2018-01-17 10:59:53 -05:00
Boris Cherny
c3654d83c8 Generate TypeScript typings, and improve generated Flow typings (#7101)
* generate typescript types

* improve type generator output

* move generator scripts to scripts/generators

* use new stringifier for generating flow types too

* export summary types

* add support for oneOfNodeOrValueTypes to improve type generation

* export typescript types from top level, and remove module declaration

* generate typescript/flow types and copy typescript types to babel-types/lib as part of make build

* copy flow types to babel-types/lib as part of make build (fix #6839)

* improve typing: Identifier->name should be a string, not any

* avoid destructuring, to support node 4

* update doc generator to share more code, regenerate babel-types readme, pipe all generator output to stdout

* regenerate babel-types readme as part of make build

* improve typing: ClassProperty->key should be Identifier | StringLiteral | NumericLiteral | Expression, not any

* improve typing: optional node properties are nullable, not undefinedable

* improve docs: FlowClassImplements should be ClassImplements

* make ts usage more friendly: when using babel-types api, make optional params | undefined, and when reading nodes keep optional params | null

* rm lib/types.d.ts and lib/types.js in favor of packages/babel-types/lib

* add missing variance node type, address review comments

* add tests for flow variance

* Comment should be a disjoint union of tagged types

* update .flowconfig
2018-01-17 10:31:46 -05:00
Andy
667f5815c1 typescript: Properly set this.state.inType one token before parsing a type (#7225)
* typescript: Properly set this.state.inType one token before parsing a type

* Reuse tsParseTypeArguments and inline tsExpectLessThanThenParseInType
2018-01-17 08:36:04 -05:00
Sven SAULEAU
4f39e6ea4a Merge pull request #7219 from Andarist/fix/deps
Fix dependencies in @babel/traverse
2018-01-16 10:31:40 +01:00
Nicolò Ribaudo
64dfb7574e Remove old comment (#7220) 2018-01-15 14:57:43 -06:00
Mateusz Burzyński
d36b142e30 Moved @babel/generator to dependencies in @babel/traverse 2018-01-15 19:47:15 +01:00
Jorrit Schippers
3c8d831fe4 Prevent object shape change in jsx helper (#7170)
Keeping the shape of an object constant is a performance improvement for modern javascript engines. At the point of the code change it is certain that the `children` property will be set later, so the property can already be set to `undefined`.
2018-01-15 16:37:57 +01:00
Mateusz Burzyński
0a517b51cd Added custom NodePath.prototype.toString method as debug utility (#7218) 2018-01-15 13:07:05 +01:00
Mateusz Burzyński
79c84f2f9b Fixed _containerInsertAfter setting path key as stringified index (#7213) 2018-01-15 08:08:42 +01:00
Joe Haddad
ca86648726 bugfix: set color level when color is forced (#7216)
Color level 1 matches our usages, level 0 is no color
2018-01-14 12:43:20 -06:00
Raja Sekar
2d05487293 Add support for @@iterator (#7058) 2018-01-12 09:19:11 -06:00
Peri Nikhil
c3352ad2e0 Fix: unicode characters not allowed in regexes (#7179)
Issue #6691
2018-01-10 15:33:21 +01:00
Antoine Prieëls
26e4911eb2 Use the async version of transform in babel-cli (#6826)
* use the async version of transform in babel-cli

* Modify compile to use async version of transformFile

* Babel-CLI: transform files sequentially

* Remove useless res in callback
2018-01-09 19:17:07 -08:00
Henry Zhu
aa888e666a fix wording [skip ci] 2018-01-09 15:09:47 -05:00
Nicolò Ribaudo
8659e1a88c Remove old expected.{js,json} files (#7187) 2018-01-09 13:10:30 -06:00
Maaz Syed Adeeb
9e384f3915 Cleaning up some TS parsing tests (#7184) 2018-01-09 11:37:05 -06:00
Raja Sekar
f694b5d034 Doc changes for https://github.com/babel/babel/issues/7063 (#7185) 2018-01-09 11:10:00 -06:00
Artem Yavorsky
d765573c0b Remove excess check for hidden files. (#7183) 2018-01-09 10:21:49 -06:00
Henry Zhu
64161fa0b5 Fix syntax plugins in babylon readme [skip ci] (#7182) 2018-01-09 10:04:54 -06:00
Henry Zhu
52f22e9e1e Merge pull request #7181 from nicolo-ribaudo/pr-7169
Rename actual/expected to input/output in fixtures.
2018-01-09 10:43:33 -05:00
Brian Ng
3e5fce07e4 Regen lib/types (#7180) 2018-01-09 09:25:45 -06:00
Raja Sekar
0f42accb87 Renamed files 2018-01-09 15:36:42 +01:00
Raja Sekar
07e69c009b Code changes 2018-01-09 10:36:11 +01:00
Claudio Procida
ce420ba51c Fixes React isCompatTag validator accepting leading dash character (#7164) 2018-01-09 09:42:05 +01:00
Nicolò Ribaudo
9fe30b98a1 Remove "quotes" internal flag from babel-generator (#7174) 2018-01-08 23:37:33 -08:00
Mauro Bringolf
0a9f136d5f Minor improvements to block-scoping/tdz (#6782)
* Add test case for simple reference in tdz

* Add more examples from old issues as test cases

* Fix two testcases by excluding function declarations from being tdz checked

* Document the  option for block-scoping

* Add test cases with destructuring assignments

* Remove failing test cases

* [skip ci] Include type and default value for options
2018-01-08 21:49:05 -08:00
Mouad Debbar
e9ed687666 Bail out on JSX fragments instead of throwing (#7166)
* Bail out on JSX fragments instead of throwing

The `transform-react-inline-elements` plugin doesn't handle JSX fragments. It throws an exception because `node.openingElement` is undefined.

* Add a comment explaining `node.openingElement`
2018-01-08 21:38:52 -08:00
mtpc
63157159ab Preserve namespaced attributes when throwIfNamespace is false (#7173)
Previously that part would throw since it expects a JSXIdentifier but it (logically) gets a JSXNamespacedName when using a namespaced attribute.
2018-01-08 21:24:02 -08:00
Maaz Syed Adeeb
74682f33bc Support 'assert and assign' TypeScript syntax (#7098) 2018-01-08 15:29:27 -06:00
Henry Zhu
b1bf7798ab update to v7-beta.37 (#7104) 2018-01-08 12:05:49 -05:00
Henry Zhu
7c99f4653f v7.0.0-beta.37 2018-01-08 11:02:14 -05:00
Logan Smyth
a19349a22a Merge pull request #7091 from loganfsmyth/config-overrides
Allow configs to have an 'overrides' array
2018-01-07 13:51:07 -08:00
Nicolò Ribaudo
b93184e430 [decorators] Only transform declarations to expressions when needed (#7124) 2018-01-06 16:38:28 +01:00
Logan Smyth
bb17b72f4f Process .babelignore before .babelrc (#7161) 2018-01-05 20:39:36 -08:00
Logan Smyth
a76709cabc Throw errors for users of 'ignore'/'only' options are passed in, but the filename is unknown. 2018-01-05 12:47:47 -08:00
Logan Smyth
c292140254 Implement an 'overrides' config array to process in order for overrides. 2018-01-05 12:47:47 -08:00
Logan Smyth
f4a24a38ca Allow config objects to use test/include/exclude to limit application to specific files. 2018-01-05 12:47:47 -08:00
Logan Smyth
193e841d89 Allow .env and .overrides in presets. 2018-01-05 12:47:47 -08:00
Steve Fan
1ded1d7ff6 [@babel/standalone] Remove additional function context (#7094) 2018-01-04 21:15:51 -06:00
Daniel Bayerlein
aec6e5c370 Update license year (#7141) 2018-01-04 20:35:43 -06:00
Raja Sekar
152e95fb52 Preserve jsx comment (#7155) 2018-01-04 14:11:08 -06:00
Sophie Alpert
8250ff963e Suggest JSX fragment syntax in adjacent tag error (#7152) 2018-01-04 09:21:39 +01:00
Elad Chen
82c6ca2f96 Update README.md (#7140) 2018-01-03 09:59:46 -06:00
Mateusz Burzyński
820edd1e23 Fix computed properties being inserted after the class, thus making them unavailable for instance methods & properties (#7147) 2018-01-03 15:39:07 +01:00
Raja Sekar
e872f0d975 Regex parsing issue fix after function declaration. (#7121) 2018-01-03 14:21:18 +01:00
Tim Seckinger
c3f6f7fe28 fix buildCodeFrameError empty code frames 2018-01-03 13:53:15 +11:00
Andy
49775e2f12 Remove redundant property declarations (#7144) 2018-01-02 22:20:54 +01:00
Raja Sekar
f3410e761c Flow comment parsing (#7007) 2017-12-30 23:53:08 +01:00
Brian Ng
ebbd5c7321 Bump regenerator-transform and regen fixture (#7137) 2017-12-30 16:44:22 -06:00
Boris Cherny
4208099f5b Add validators for Flow AST node fields (#7107) 2017-12-30 15:26:01 -06:00
h1b9b
068c65a1dd Remove hasBeenLogged flag from preset-env (#7130) 2017-12-29 08:19:11 -06:00
Fabian Streitel
3956b3ee0e Fix turning division operator into line comment in compact mode (#7131) 2017-12-29 08:11:35 -06:00
Nicolò Ribaudo
2297e2d764 Fix a regression introduced in #7040 (#7116) 2017-12-28 22:15:53 +01:00
Gustavo Rios de Sousa e Silva
d761d765bd Replace target: uglify tests with forceAllTransforms in preset-env 2017-12-28 13:17:28 -06:00
Alan Pierce
ad2019aa30 Add syntax-typescript and transform-typescript to babel-standalone (#7119)
The preset was already there, but this is nice for configs working directly with
plugins.
2017-12-28 10:03:28 -06:00
Diogo Franco
f9e0805337 Regenerate fixtures (#7120)
* Update line endings in test fixtures to match current output

* Fix incorrectly set up static-property-tdz fixtures

It seems the fixture runner does not look into subfolders.

* Remove expected file that should not exist

* Reenable disable optimisation test

* Reenable disabled nbsp tests

* Reenable comments between props test

The comments adjacent to children test is still broken so it stays off.
2017-12-28 19:28:05 +09:00
Diogo Franco
0f60d42fdf Avoid adding #__PURE__ annotation to .bind(this)() expressions (#7043)
* Avoid adding #__PURE__ annotation to .bind(this)() expressions

Fixes the #__PURE__ annotation getting added to (async () => {})() IIFEs when the arrow function transform is running with spec: true.

* Return false instead of undefined

* Fix indentation in json files

* Add one more case to the async-iife fixtures
2017-12-28 17:02:54 +09:00
Henry Zhu
7d798952d2 v7.0.0-beta.36 2017-12-25 14:04:08 -05:00
Joe Lim
ed2b88830e Remove extraneous console output when running preset-env tests (#6576) 2017-12-25 13:47:19 -05:00
Bogdan Chadkin
d25918aa5d Fix generation flow unnamed computed property (#7095) 2017-12-22 12:55:40 -06:00
Artem Yavorsky
035286a810 [preset-env] Move all defaults to the separate module (#7084)
* preset-env: Move all defaults to the separate module.

* preset-env: Add test cases for defaults.
2017-12-22 10:42:06 -05:00
Logan Smyth
c9a00fbae8 Merge pull request #7090 from loganfsmyth/chain-processing-rewrite
Refactor config processing more
2017-12-21 19:57:07 -08:00
Logan Smyth
758fd0369c Rewrite config chain loading to build chain recursively to keep caching readable. 2017-12-21 19:06:36 -08:00
Logan Smyth
7b861796cf Centralize validation logic in common folder. 2017-12-21 14:45:19 -08:00
Logan Smyth
f9825394a7 Remove unnecessary folder nesting. 2017-12-21 14:45:19 -08:00
Logan Smyth
43e7d1d2cc Use an object instead of a 2-tuple. 2017-12-21 12:31:48 -08:00
Logan Smyth
de63443762 Split babelrc and babelignore searching into two functions. 2017-12-21 12:28:51 -08:00
Andy
6a73f39199 Support parsing export default abstract class {} (#7075) 2017-12-21 16:13:31 +01:00
Azharuddin
2190e10e9a Better error messages when Babel fails to parse import = and export =… (#7079)
* Better error messages when Babel fails to parse import = and export = syntax from typescript when using babel-plugin-transform-typescript

* Fixing Test cases

* Ran make fix and broken looong sentence into smaller

* Slight changes to Messages after review with Nicolo & existentialism

* Removed trailing space
2017-12-21 02:00:36 +02:00
Nicolò Ribaudo
ae3f5b9149 Return the obj in setPrototypeOf fallback (#7080) 2017-12-20 22:48:10 +01:00
Nicolò Ribaudo
0c885b3200 Add support for extending builtins (#7020) 2017-12-20 14:46:00 -05:00
Artem Yavorsky
148fe7d3ff Add proposal-async-generator-functions to babel-standalone (#7073) 2017-12-20 20:37:16 +01:00
Henry Zhu
cabdf3769d Merge pull request #7065 from babel/dotall-preset-env
Add dot-all regex support to preset-env and standalone
2017-12-19 20:45:18 -05:00
Logan Smyth
1178799f07 Remove the LoadedFile class. 2017-12-19 15:36:54 -08:00
Logan Smyth
b2f1d01965 Add type annotations to utility file. 2017-12-19 15:36:19 -08:00
Logan Smyth
4f53496546 Drop the OptionManager class in favor of function. 2017-12-19 14:19:37 -08:00
Logan Smyth
1312a30d54 Perform normalization in the chain building process. 2017-12-19 14:19:37 -08:00
Logan Smyth
4afbc02476 Move descriptor merging into config chain processing. 2017-12-19 14:19:37 -08:00
Brian Ng
080c7f1e2d Clean up logPlugin 2017-12-19 14:57:19 -06:00
Brian Ng
3cea9f412a Add dot-all regex support to preset-env and standalone 2017-12-19 11:39:00 -06:00
Brian Ng
cd10ea03b4 Fix bug with debug output and unreleased versions 2017-12-19 11:38:59 -06:00
Mathias Bynens
5f8a1a2613 Fix unicode-property-regex installation instructions (#7064) 2017-12-19 11:27:26 -06:00
Mathias Bynens
44da8201a5 Import babel-plugin-transform-dotall-regex (#7059)
Original: https://github.com/mathiasbynens/babel-plugin-transform-dotall-regex

Moving it into the official Babel repository makes it easier to maintain the transform.
2017-12-19 11:01:59 -05:00
Brian Ng
2b065350b5 Treat import type * as a parser error (#7061) 2017-12-19 10:54:20 -05:00
Nicolò Ribaudo
68476b6ddd Make .insert{Before,After} work by default when the parent is an eport declaration (#7040) 2017-12-19 00:05:29 +01:00
Maaz Syed Adeeb
17b37b5013 Handling babylon parsing errors in a better way (#6961)
* Handling babylon parsing errors in a better way

* Better error messages + Helpful URLs

* Replaced message from babylon completely

* Add importMeta plugin to the map
2017-12-18 15:49:34 -05:00
Bo Lingen
56638e1370 Add pipeline operator plugins to babel-standalone (#6955) 2017-12-18 10:10:20 -06:00
Francisco Ryan Tolmasky I
f0e46772a6 babel-types lists JSXIdentifier as an Expression (#6960)
Currently, Babel is treating JSXIdentifier, JSXMemberExpression, and JSXEmptyExpression as expressions as well, which means Babel will for example incorrectly allow you to place these anywhere an expression is wanted.

Closes #6851.
2017-12-18 09:27:43 -06:00
Mahmut Surekci
398bc43656 Add MIT license to proposal-unicode-property-regex (#7047) 2017-12-18 13:48:30 +01:00
Logan Smyth
44ea9433c0 Merge pull request #6952 from loganfsmyth/commonjs-lazy
Add a 'lazy' options to modules-commonjs
2017-12-17 19:32:51 -08:00
Logan Smyth
53826aaaa0 Expose a 'lazy' option for the CommonJS transform. 2017-12-17 18:42:35 -08:00
Logan Smyth
b900a3e5c2 Consistently return AST nodes. 2017-12-17 18:33:47 -08:00
dnalborczyk
ed4d90b33d expose import.meta syntax parser option as plugin (#7008) 2017-12-16 15:06:23 -06:00
Anthony Bianco
209a598d51 Fix loose option description in transform-modules-commonjs 2017-12-16 14:41:05 -06:00
Nicolò Ribaudo
9a146d01b0 [decorators] Don't transform every AssignmentExpression (#7032) 2017-12-15 16:17:31 -05:00
Rouven Weßling
f2437583ba Bump globals to version 11.1.0 (#7006) 2017-12-15 13:20:22 -05:00
Sven SAULEAU
a24c9f8ed6 Merge pull request #7028 from sophiebits/getLetReferences-n2
Fix O(n^2) getLetReferences – 40% faster on large flat files
2017-12-15 07:59:57 +01:00
Sophie Alpert
6a7223af29 Fix O(n^2) getLetReferences – 40% faster on large flat files
`this.blockPath.get("body")` constructs an array of paths corresponding to each node in `blocks.body` so takes O(n) time if n is that length. We were re-constructing that array on each iteration, so the entire loop was O(n^2).

On files with many statements in a single block (such as Rollup-generated bundles), this takes a large portion of time. In particular, this makes transforming react-dom.development.js about 40% faster. Not that you should be transforming our bundle with Babel.

Test Plan:
Make an HTML file with these three lines and watch it in the Chrome Performance tab to see timings (on my machine: 2.9s before, 1.6s after):

```
<!DOCTYPE html>
<script src="https://unpkg.com/babel-standalone@7.0.0-beta.3/babel.js"></script>
<script type="text/babel" src="https://unpkg.com/react-dom@16.2.0/umd/react-dom.development.js"></script>
```
2017-12-14 21:55:26 -08:00
Diogo Franco
a66845169f Rename misleading identifier
notRegenerator actually _enabled_ transforming regeneratorRuntime references.
2017-12-15 11:20:15 +09:00
Henry Zhu
8a4124b2ff v7.0.0-beta.35 2017-12-14 16:47:27 -05:00
Nicolò Ribaudo
05b22d2597 Update @babel/helper-wrap-function templates (#6984)
This commit introduces 4 changes:

1) Function declarations are wrapped using function declarations.
   This has two advantages:
    - We can rely on native hoisting, instead of using _blockHoist
    - The function isn't wrapped until it is called. This avoids
      problems where `regeneratorRuntime.wrap` was called before
      that `babel-polyfill` was imported.

   Example:
     function fn() {}
     // becomes
     function fn() { return _fn.apply(this, arguments); }
     function _fn() {
       _fn = _wrapper(/* Original function ... */);
       return _fn.apply(this, arguments);
     }

2) Use a single template for both named and anonymous function
   expressions. They already had the same behavior, but the one
   used for named functions was a bit longer.

3) Use normal functions instead of arrow functions to wrap
   function expressions.

4) Generate a name based on the original one for wrapped
   functions (e.g. `foo` becomes `_foo` instead of `_ref`).
2017-12-13 16:21:58 +01:00
Peri Nikhil
9cc0a26694 Move helpers from 'babel-plugin-proposal-decorators' to 'babel-helpers' (#7017) 2017-12-13 16:08:19 +01:00
Brian Ng
f5ef928586 Add method property to ObjectTypeProperty (#7005) 2017-12-11 09:32:16 -06:00
Brian Ng
42f66782be Improve error message in types assert (#7001) 2017-12-11 09:31:56 -06:00
Daniel Poindexter
12ac1bccd7 Fix type definitions to fully support Typescript (#6939) 2017-12-08 17:03:01 -06:00
Diogo Franco
82357d79a7 Workaround bad #__PURE__ annotation placement on IIFEs (#6999)
Based on a fix suggested by @kzc
2017-12-08 09:51:48 -05:00
Diogo Franco
2958548c2c Fix code generation for async generator methods (#6998)
Fixes generator to write `async *foo() {}` instead of `*async foo() {}`.
2017-12-08 17:38:31 +09:00
Henry Zhu
468aecca21 Add Babel's song: Hallelujah (thanks to Angus) [skip ci] (#6994) 2017-12-07 21:18:17 -05:00
Brian Ng
c7980b2b90 Bump prettier (#6991) 2017-12-07 17:36:49 -05:00
Henry Zhu
d6db5fb1e1 Update to the latest version of regenerator that uses the MIT license (#6992) 2017-12-07 15:32:36 -05:00
K Sashi Kumar
ac745ded0d Fix destructuring assignment spec violation (#6986) 2017-12-07 09:14:03 -06:00
Nicolò Ribaudo
a2aabbd33d Generate better builder names for JSX* and TS* (#6967)
e.g. JSXIdentifier -> jsxIdentifier.
The jSXIdentifier alias isn't removed, so this commit doesn't introduce breaking changes.
2017-12-07 12:17:40 +01:00
Henry Zhu
fcfa987926 publish babylon as next tag since it's not a scoped module yet [skip ci] (#6982) 2017-12-06 15:05:48 -05:00
Nicolò Ribaudo
509dbb7302 this before super() is a runtime error, not a static one. (#6467)
* Check that super.* is after super() at runtime

* "missing super() call in constructor" runtime

* "'this' is not allowed before super()" runtime
2017-12-06 06:46:54 +01:00
Leo Hsieh
e270fbe7f0 Update babylon ast links on CONTRIBUTING.md (#6972) [skip ci] 2017-12-04 23:43:40 +01:00
Andy
aa38c47160 For babylon typescript parser, fix false positive for ! after a line break (#6969)
Closes #6798
2017-12-04 19:57:22 +01:00
Nicolò Ribaudo
62bbee97d7 Better error message for import.meta and import() without plugin (#6962)
The correct error was already thrown when they weren't in statement position.
2017-12-03 17:45:37 +01:00
Daniel Tschinder
ac72bfbd33 Update babylon to use unicode 10 (#6958) 2017-12-03 11:55:50 +01:00
Henry Zhu
a7c9264c79 v7.0.0-beta.34 2017-12-02 09:38:52 -05:00
Raja Sekar
c41eb0d052 Do Expression from Stage 0 to Stage 1 (#6943) 2017-12-02 09:02:31 -05:00
Daniel Tschinder
de5ab72c49 Update flow to 0.59 and fix some flow issues (#6957) 2017-12-02 08:59:46 -05:00
Henry Zhu
607916880d update to beta.33 (#6948)
* update to beta.33

* typeof is excluded by default in loose mode
2017-12-02 08:59:08 -05:00
Daniel Tschinder
8270903ba2 Refactor @babel/types to be 100% ES-module (#6741)
This generates the dynamic functions at buildtime and also
splits the package into smaller files to avoid dependency circles.
2017-12-02 12:20:10 +01:00
Brian Ng
95fe785354 Fix stage refs to exportNamespaceFrom and exportDefaultFrom (#6949) 2017-12-01 12:29:51 -05:00
Henry Zhu
413aa79711 v7.0.0-beta.33 2017-12-01 09:27:57 -05:00
Henry Zhu
1a3a502f97 Remove some built files before publish [skip ci] (#6946) 2017-12-01 09:25:27 -05:00
Henry Zhu
5761eb0bb4 add readme entry for for-of assumeArray, use it (#6942) 2017-11-30 17:40:23 -06:00
Raja Sekar
a992d06c41 Porting babel-plugin-transform-for-of-as-array into transform-for-of as an option (#6914) 2017-11-30 17:48:56 -05:00
Brian Ng
d8bbaaae0a Split exportExtensions into exportDefault and exportNamespace plugins… (#6920)
* Split exportExtensions into two plugins in babylon
* rename proposal-export-default to proposal-export-default-from
* rename proposal-export-namespace to proposal-export-namespace-from
2017-11-30 17:46:36 -05:00
Daniel Tschinder
9d9710c765 Copy getters and setters correctly in interopWildcard (#6850) 2017-11-30 15:50:10 -06:00
Sam Gluck
18b91a8388 [plugin-proposal-class-properties] Fix small loose docs typo (#6941) 2017-11-30 15:09:36 -06:00
Artem Yavorsky
0a2a37c31f Fix export from assignment order for loose mode. (#6863)
* Consider reexports for bindingKindLookup.

* Update test cases according to reexports change

* Fix order for assign reexports.

* void 0 assignation to module keys only for loose mode.

* Create buildReexportsFromMeta helper.

* Update umd/amd fixtures.

* Refactor reexports build.

* Hoist template for reexports.

* Use map as a second argument of Array.from.

* Remove unnecessary export.
2017-11-29 11:58:29 -08:00
Boda
d731acc351 updated Unpkg link (#6929)
...to be the same as the link in the Installation section
2017-11-29 11:41:13 -05:00
Logan Smyth
fba19295b4 Merge pull request #6905 from loganfsmyth/config-options-merge
Merge all config & programmatic plugins/preset rather than duplicating
2017-11-28 13:46:36 -08:00
Logan Smyth
8fc8a1f2ee Use public options API for tests. 2017-11-28 13:25:10 -08:00
Nicolò Ribaudo
18c8d97c3d UpdateExpressions as callees must be parenthesized (#6922) 2017-11-27 23:31:24 +01:00
Henry Zhu
58962c35b5 update regenerator (removed explicit babel-types dep) (#6917) 2017-11-27 23:16:41 +01:00
Brian Ng
881fc14329 Add handling parens for extends clause in generator (#6897) 2017-11-27 12:08:35 -06:00
Daniel Lo Nigro
7d8932b6be Add comment to babel-standalone to dissuade removal of whitelist (#6910)
There was a good discussion on https://github.com/babel/babel/pull/6177. Linking to it in the code to preserve the comments.
2017-11-27 10:08:28 -08:00
Mauro Bringolf
6330a152ce Implement TDZ for ClassFieldDefinitionEvaluation (#6855)
* First implementation sketch and testcase

* Use helper instead of inline IIFE's

* minNodeVersion 6.0.0

* Hoisted visitor for subtraversal and fixed edgest case

* Resolve merge conflicts in helpers

* Remove duplicated helper from messing up Git
2017-11-26 16:56:04 +01:00
Logan Smyth
189c56628a Replace repeated plugins/preset in top-level config instead of running both. 2017-11-25 18:47:13 -08:00
Logan Smyth
8be488652f Allow plugins and presets to have explicit names. 2017-11-25 18:46:00 -08:00
Logan Smyth
cdf420d4d8 Rewrite config chain tests to use public loadOptions API. (#6909) 2017-11-25 18:25:20 -08:00
Nicolas Marien
cf62908bbd Keep user options intact in transformFile (#6890)
* Preserve user options in transformFile

* Improve tests for transformFile user opts handling
2017-11-25 10:13:56 -08:00
Logan Smyth
66ee192a7f Merge pull request #6904 from loganfsmyth/config-merge-prep
Add a 'cwd' option, and misc refactoring and tweaks before simple config merging
2017-11-24 22:54:40 -08:00
Logan Smyth
c635ff9c32 Remove duplicate from plugin list. 2017-11-24 19:45:15 -08:00
Logan Smyth
6cb9d20a0a Tie presets pass metadata to descriptors. 2017-11-24 19:45:15 -08:00
Logan Smyth
b5cb78d33a Move plugin pass initialization logic a bit. 2017-11-24 19:45:15 -08:00
Logan Smyth
1d0a3d6772 Remove duplicated assertion. Covered by validate() 2017-11-24 19:45:14 -08:00
Logan Smyth
18ea5aca51 Expose a 'cwd' option for Babel's root options. 2017-11-24 19:43:25 -08:00
Logan Smyth
db28c18458 Disallow nested '.env' blocks since they are useless. 2017-11-24 17:45:27 -08:00
Logan Smyth
a89171910f Merge pull request #6834 from loganfsmyth/caching-refactor
Expose `envName` as a top-level Babel option to avoid using environmental variables
2017-11-24 17:42:16 -08:00
Mark Shulhin
0056fb1cfb Fixed ignore in readme for babel-register [skip ci] (#6899) 2017-11-24 17:45:49 -05:00
Sven SAULEAU
041dd4a536 Merge pull request #6893 from Arfey/features/updated-gitignore-file
feat: updated .gitignore file
2017-11-24 20:13:37 +01:00
misha.gavela
428e294ded Merge branch 'master' of https://github.com/babel/babel into features/updated-gitignore-file 2017-11-24 19:21:30 +02:00
Brian Ng
0a3c2a0c4c Fix babylon test 2017-11-24 09:15:17 -06:00
misha.gavela
917e3ede31 feat: updated .gitignore file 2017-11-24 15:18:13 +02:00
Martin McKeaveney
6d820a2757 removing expression field from ArrowFunctionExpression (#6836) 2017-11-23 22:12:13 +01:00
Mateusz Burzyński
1ef7e0f48e Allowed hintedNames for namespaced imports, changed some other defaults for more readable ones (#6744) 2017-11-23 21:01:47 +01:00
Daniel Tschinder
9206df964d Use only imports in babel-traverse and remove double exports (#6881) 2017-11-23 20:59:54 +01:00
Brian Ng
c583a04a55 Fix setting deopt properly after evaluating multiple expressions (#6882) 2017-11-22 20:06:57 -05:00
Gidi Meir Morris
edbf5d33dc Fix "Better error messaging for unexpected tokens #6715" (#6875) 2017-11-22 15:31:03 -06:00
Brian Ng
8393a6d089 Add firefox 58 mappings to preset-env data (#6874) 2017-11-22 15:30:07 -06:00
Nicolò Ribaudo
464df13c69 Allow yielding an arrow function withour parens around the param (#6877) 2017-11-22 15:28:37 -06:00
Logan Smyth
80b4b7120b Quick fix for typescript import crash. (#6879) 2017-11-22 13:27:31 -08:00
Brian Ng
ccd7c25174 Regen babel-types docsdocs and interfaces [skip ci] 2017-11-22 08:53:16 -06:00
Sven SAULEAU
4384d38b90 Merge pull request #6862 from maurobringolf/const-violation-helper
Define readOnlyError helper and use in check-constants plugin
2017-11-22 12:18:52 +01:00
Yifeng Wang
3fae022320 Update CONTRIBUTING.md (#6868) 2017-11-22 10:47:06 +01:00
Henry Zhu
70361f1200 Remove the experimental folder 2017-11-21 20:03:16 -05:00
Artem Yavorsky
d72d567d43 Merge pull request #6866 from aaharu/reduce-preset-env-pkg-size
Add `.github` and `.idea` to `.npmignore` for babel-preset-env.
2017-11-21 21:06:52 +02:00
aaharu
4a455639e7 Add .github and .idea to .npmignore 2017-11-22 02:22:55 +09:00
Mauro Bringolf
ba441c5ce4 Define readOnlyError helper and use in check-constants plugin 2017-11-20 16:41:15 +01:00
Daniel Tschinder
7064b298d7 Make SpreadProperty and RestProperty a deprecatedAlias (#6853)
instead of hardcoding backwards compatiblity.
This way we get deprecation warnings and also builders will work.
2017-11-18 21:54:24 +01:00
Daniel Tschinder
f3004d0d4d Fix validation of WithStatement and enable flow in definitions (#6852)
Fixes also flow errors after activating flow
2017-11-18 18:17:31 +01:00
Vincent Chan
037b2025a6 description about building and testing babylon in CONTRIBUTING.md (#6756)
developers maybe confuse about the steps of building and testings in the mono project
2017-11-18 12:57:58 +01:00
Darío Hereñú
7d534dc32c Minor fix (styling) (#6849) [skip ci] 2017-11-18 06:51:44 +01:00
Anatoli Papirovski
2b710d0387 Do not access out of bounds arguments (#6792)
Potentially out of bounds arguments should not just be directly
accessed, instead use a ternary operator to check length.
2017-11-17 21:39:08 +01:00
Kevin Ji
e67cfc5b31 README: Use HTTPS and relative links when possible [skip ci] (#6843) 2017-11-17 10:34:44 -05:00
Sven SAULEAU
4552ee9962 Merge pull request #6844 from nicolo-ribaudo/babyon-watch
Add "make watch-babylon" [skip ci]
2017-11-17 14:16:32 +01:00
Nicolò Ribaudo
3c64554716 Add "make watch-babylon" [skip ci] 2017-11-17 09:50:46 +01:00
Steven Hargrove
cee9ae48e0 [skip ci] removed shorthand usage of official babel scoped presets & plugins from README.md's (#6820) 2017-11-16 22:51:23 -05:00
Logan Smyth
39dae28d5c Add missing argument and remove nonexistent one. (#6842) 2017-11-16 16:32:47 -08:00
Valerii Iatsko
16e898c692 @babel/cli: removed babel-node mention in README.md [skip ci] (#6829)
Follow up to 2374062bbd
2017-11-16 18:04:10 +01:00
Sven SAULEAU
bb89364813 Merge pull request #6727 from babel/feat-use-charcode-constants
[Babylon] Use char codes contants
2017-11-16 10:35:42 +01:00
Sven SAULEAU
57e2c45cbe chore: upgrade charcode 2017-11-16 09:57:20 +01:00
Raja Sekar
63397d0aad Better error message for super when not using an object method (#6754) 2017-11-15 21:29:46 -06:00
Artem Yavorsky
48906604f2 Add safari technology preview for babel-preset-env. (#6791) 2017-11-15 17:14:54 -06:00
Brian Ng
0f2ab2fe20 Fix some reserved type handling and declare class with multiple extends (#6725) 2017-11-15 16:16:15 -06:00
Artem Yavorsky
de3597983a [preset-env] Exclude transform-typeof-symbol with loose option. (#6831) 2017-11-15 14:13:59 -06:00
Logan Smyth
aa2d415507 Expose the envName as a programmatic and CLI option. 2017-11-15 11:24:39 -08:00
Sven SAULEAU
4c584ae341 chore: upgrade and fix charcodes 2017-11-15 19:53:30 +01:00
Logan Smyth
74439889d8 Centralize envName lookup using caching sidechannel. 2017-11-15 10:05:48 -08:00
Logan Smyth
74ea70718e Allow passing an cachable 'sidechannel' object into cache handlers. 2017-11-15 10:05:47 -08:00
Logan Smyth
bbff566024 Use expanded caching API to simplify usage. 2017-11-15 09:51:13 -08:00
Logan Smyth
3942862a2a Expose more caching flexibility for Babel's internal use. 2017-11-15 09:51:12 -08:00
Brian Ng
f3fd2ee3b2 Maintain plugin order with items in the include option (#6663) 2017-11-15 10:45:16 -06:00
Marcio Junior
6a19c2299a docs: [skip-ci] Remove @babel scope from babel-preset-env include/exc… (#6825) 2017-11-15 10:25:21 -06:00
Brian Ng
6371200215 Fix preset-env test 2017-11-15 10:07:04 -06:00
Brian Ng
47d5f0c20c Update dep versions inside preset-env-standalone 2017-11-15 09:54:03 -06:00
Artem Yavorsky
262d7518bd Move babel-preset-env-standalone to the monorepo. (#6438) 2017-11-15 09:50:36 -06:00
Brian Ng
287b485d0e Fix bug in preset-env usage plugin with destructure in for-of (#6662) 2017-11-15 09:45:54 -06:00
Nicolò Ribaudo
9ae23639ad Parse async arrows with flow type parameters (#6802)
Fixes #6712
2017-11-14 16:24:14 +01:00
Brian Ng
3c359698a7 Remove unneeded .eslintrc files (#6815) [skip ci] 2017-11-13 18:12:26 -05:00
Artem Yavorsky
056a995dd8 Fix shadow variables reassignment for block scoping in loops. (#6814) 2017-11-14 00:06:32 +01:00
Henry Zhu
84fe8e4181 use pr instead of tag for changelog/prs [skip ci] (#6819) 2017-11-13 16:08:08 -05:00
Logan Smyth
e44cef3473 Merge pull request #6818 from loganfsmyth/async-warnings
Add some nice warnings if plugins happen to return promises instead of sync values.
2017-11-13 12:42:58 -08:00
Logan Smyth
44c2791849 Expose a function for plugins to check if async plugins are supported by the current compilation. 2017-11-13 11:58:31 -08:00
Logan Smyth
0e88156d0c Add warnings to places where we might allow promises to be returned in later minors. 2017-11-13 11:58:30 -08:00
Henry Zhu
394ad93d22 Update to v7-beta.31 (#6804) 2017-11-13 10:50:29 -05:00
Sven SAULEAU
82a4919c11 Merge pull request #6803 from satya164/async-to-generator-pure
Add /*#__PURE__*/ annotatiotion for babel-plugin-async-to-generator
2017-11-13 16:31:37 +01:00
Sven SAULEAU
186f04a3e9 feat: use charcodes in JSX plugin 2017-11-13 13:15:32 +01:00
Sven SAULEAU
42c740ca0a Merge branch 'master' into async-to-generator-pure 2017-11-13 11:49:16 +01:00
Henry Zhu
4e6cd298c7 v7.0.0-beta.32 2017-11-12 08:32:53 -05:00
Satyajit Sahoo
7ae6e1e5a0 Add /*#__PURE__*/ annotatiotion for babel-plugin-async-to-generator. Fixes #6572 2017-11-12 18:31:48 +05:30
Clement Hoang
a18f83b4de Prefix XJS test directories with JSX instead (#6801) 2017-11-11 20:43:10 -05:00
Sven SAULEAU
097ff40001 feat: more charCodes 2017-11-11 18:08:43 +01:00
Mathias Bynens
25bde88dff Link to README on GitHub rather than the npm copy (#6796) 2017-11-11 08:14:45 -06:00
Logan Smyth
1165ecc616 Update README with new Sync-suffix functions. (#6794) 2017-11-10 15:19:24 -08:00
Logan Smyth
432a9b5092 Allow sourceType:unambiguous as a way to tell Babylon to guess the type. (#6789)
* Allow sourceType:unambiguous as a way to tell Babylon to guess the type.

* Update some docs.
2017-11-10 15:00:06 -08:00
John-David Dalton
330f9006a7 Add cache.clear() to clear the data reference when cache option is false. 2017-11-10 14:00:55 -08:00
Logan Smyth
47a93d6e2b Merge pull request #6783 from loganfsmyth/lazy-options-defaults
Apply option defaults when transforming, not up front.
2017-11-10 10:05:39 -08:00
Sven SAULEAU
c7a1bc774e Merge pull request #6785 from maurobringolf/new-ast-spec-link
Update AST spec link to new babylon location
2017-11-10 14:22:19 +01:00
maurobringolf
6707c83149 [skip ci] Swap repository for package 2017-11-10 13:39:48 +01:00
Sven SAULEAU
b75f3d25e4 docs: [skip ci] correct Babylon link 2017-11-10 10:48:42 +01:00
Sven SAULEAU
43960b561a docs: [skip ci] correct Babylon link 2017-11-10 10:46:55 +01:00
Mauro Bringolf
791b1f1bab Update AST spec link to new babylon location 2017-11-09 22:44:10 +01:00
Nicolò Ribaudo
9a231c5671 Remove support for flow bindings (#6528)
Flow bindings have been deprecated for a while.
The reason behind this change is that `declare var foo`
doesn't introduce a new local binding, but it represents
a global one.
2017-11-09 12:29:04 -08:00
Logan Smyth
4a5d551370 Set babelrc:false on config load for more consistent loading. 2017-11-09 12:26:40 -08:00
Logan Smyth
2bfa2eb5cd Apply option defaults when transforming, not up front. 2017-11-09 12:20:52 -08:00
Amin Marashi
83cd3fb2c9 Lazy-install sourceMapSupport (#6651)
* Install sourceMapSupport only when sourceMaps are requested

* Add tests for sourceMapSupport

* Fix sourceMap position for tests

* Fix gen_error file

* fix the test descriptions

* Refactor install sourceMap support

* Run sourceMapSupport only once

* Handle cases where sourceMaps is undefined
2017-11-09 12:20:26 -08:00
Anatoli Papirovski
aefbb1380e No unneeded empty arrays in transform spread (#6763)
* No unneeded empty arrays in transform spread

Since Array.prototype.concat creates a new array from inputs, there's
no need to call it from a new empty array ([].concat()).

* [fixup] simplify detection of new array
2017-11-09 14:51:56 -05:00
Logan Smyth
617d35245f Merge pull request #6776 from loganfsmyth/more-plugin-options
Hoist more plugin options and default useUnicodeFlag to 'true'.
2017-11-09 10:56:15 -08:00
Logan Smyth
d90ba531ee Merge pull request #6781 from loganfsmyth/parsegen-plugins
Make official API for plugins to override parser/generator
2017-11-09 10:45:12 -08:00
Logan Smyth
3782c7267e Default unicode-property-regex to outputting 'u' flag regexes. 2017-11-09 10:39:52 -08:00
Logan Smyth
fc7fcfac0a Expose a clear API for plugins to override the parser/generator. 2017-11-09 10:34:12 -08:00
Logan Smyth
52d337e4d9 Move plugin object validation into plugin file. 2017-11-09 10:24:04 -08:00
Logan Smyth
98969b8a73 Standardize on Sync suffix for sync APIs (with backward-compat) (#6780) 2017-11-09 10:22:51 -08:00
Sven SAULEAU
b79e3c0e99 fix: minor changes 2017-11-09 18:07:10 +01:00
Sven SAULEAU
88c1b4ef1c feat: more charcodes 2017-11-09 17:13:36 +01:00
Logan Smyth
e7c57ae85a Move a few more references to plugin options to the top level. 2017-11-08 23:07:56 -08:00
Logan Smyth
6fe7f77eb4 Merge pull request #6778 from loganfsmyth/use-peerdep
Use the peerDep to load types/template/traverse in plugins
2017-11-08 23:05:08 -08:00
Logan Smyth
e0fc5e974d Merge pull request #6777 from loganfsmyth/options-simplified
Add an official 'state.filename' and be more explicit about option passing.
2017-11-08 23:00:44 -08:00
Logan Smyth
d5643d27f4 Remove unused dependency. 2017-11-08 17:38:55 -08:00
Logan Smyth
4d7d4605b6 Centralize parserOpts and generatorOpts normalization. 2017-11-08 17:06:01 -08:00
Logan Smyth
39119f88e7 Pass explicit options list to babel-code-frame 2017-11-08 17:00:02 -08:00
Logan Smyth
6684986372 Expose an official API to access the current filename. 2017-11-08 16:48:25 -08:00
Logan Smyth
82513465ee Pass an explicit whitelist of options down into babel-generator. 2017-11-08 16:41:33 -08:00
Diogo Franco
81811bf1b9 Fix transform-arrow-functions in { spec: true } shadowing (#6760)
* Fix transform-arrow-functions in { spec: true } shadowing

The function name matching the variable declaration name could
shadow the actual function object inside the generated function,
leading to invalid behavior due to holding a reference to the
original unbound function.

* Combine it with transform-function-name just to be sure in spec: false

* Revert "Fix transform-arrow-functions in { spec: true } shadowing"

This reverts commit 1cafe2561d0b0ddd181b956a85eb074621da12e8.

* Much simpler version of the above fix

* Missing fixture updates

* Avoid using rest/spread to make the tests pass on node 4

* ...actually update _all_ the fixtures
2017-11-08 17:21:30 -05:00
Sven SAULEAU
6b417a8ecb chore: bump charcode plugin 2017-11-08 16:56:25 +01:00
Sven SAULEAU
cd8a869a18 fix: remove unwanted change 2017-11-08 13:20:11 +01:00
Sven SAULEAU
f3f005c67e feat: use charcode AOT transform 2017-11-07 19:16:04 +01:00
Sven SAULEAU
7dfa79f4c8 Merge branch 'master' into feat-use-charcode-constants 2017-11-07 18:09:52 +01:00
Sven SAULEAU
3e34162092 chore: bump charcode 2017-11-07 18:07:38 +01:00
Brian Ng
c440f045f5 Update preset-env README with removing core-js stubs change [skip ci] 2017-11-07 08:48:50 -06:00
Brian Ng
ef47d8b1be Remove core-js/regenerator-runtime stubs (#6755) 2017-11-07 08:23:38 -05:00
Logan Smyth
b19b66d94b Use peerDep rather than plugin param for common APIs. 2017-11-06 11:32:47 -08:00
Daniel Tschinder
7dbed2170e Move typscript test copy script to scripts folder and run once (#6749) 2017-11-06 09:46:49 -06:00
Daniel Tschinder
cc66495a95 Unify eslint/prettier config (#6747)
* Unify eslint/prettier config

Use a prettier config file and correctly configure trailing commas

Enable curly in babylon as in all other packages.

* Add experimental and codemods
2017-11-06 14:19:59 +01:00
Benedikt Meurer
de72ce6ce7 Changed for..in loops to iterating through Object.keys, so only own properties gets processed (#6748)
* Properly guard for..in loops with Object#hasOwnProperty.

I noticed that babylon spends a lot of time in what we call *slow mode*
`for..in` when running in Node (on V8), and the reason for that is that
the version distributed on npm is build with *loose mode*, which turns
methods on the prototype into enumerable properties. Let's look at a
simplified example of the `State` class from `src/tokenizer/state.js`:

```js
class State {
  constructor() { this.x = 1; }

  clone() {
    var state = new State();
    for (var key in this) {
      var val = this[key];
      state[key] = val;
    }
    return state;
  }
}
```

According to the specification the `State.prototype.clone` method is
non-enumerable. However when transpiling this with loose mode, we get
the following output:

```js
var State = (function() {
  function State() { this.x = 1; }

  State.prototype.clone = function clone() {
    var state = new State();
    for (var key in this) {
      var val = this[key];
      state[key] = val;
    }
    return state;
  }

  return State;
})();
```

So all of a sudden the `State.prototype.clone` method is enumerable.
This means that the `for..in` loop inside of that method enumerates
`x` and `clone` for `key`, whereas originally it was supposed to only
enumerate `x`. This in turn means that the shape of the result of a
call to `clone` will be different than the shape of a state that is
created via the `State` constructor. You can check this in `d8` using
the `--allow-natives-syntax` flag and this simple test driver:

```js
const s = new State;
%DebugPrint(s);
%DebugPrint(s.clone());
```

Using either the class version or the transpiled version we see:

```
$ out/Release/d8 --allow-natives-syntax state-original.js
0x2a9d7970d329 <State map = 0x2a9d40b0c751>
0x2a9d7970d3c1 <State map = 0x2a9d40b0c751>
$ out/Release/d8 --allow-natives-syntax state-loose.js
0x3729ee30d1b9 <State map = 0x3729af90c701>
0x3729ee30d251 <State map = 0x3729af90c7a1>
```

So as you can see, the transpiled version (using *loose mode*) produces
a different shape for the result of `clone`, whereas the original
version is fine. This pollutes all sites which use either a state
created from the `State` constructor or returned from the `clone`
method. The original one has only the `x` property in either case,
whereas in the transpiled version the result of `clone` has properties
`x` and `clone` on the instance.

To mitigate this effect, it's best to guard the `for..in` loops with
`Object.prototype.hasOwnProperty` calls, such that the actual body of
the loop only deals with own properties and not with properties from the
prototype chain. This change does exactly that for the two affected
`clone` functions.

In addition to the performance hit because of the unnecessary
polymorphism, there's also the performance hit because of the *slow
mode* `for..in` itself, which has to collect the properties from the
instance plus the prototype. Ideally the prototype properties shouldn't
be enumerable to avoid this whole set of problems. I see a couple of
possible solutions:

1. Distribute the original ES2015 version via npm.
2. Don't use loose mode, so that `Object.defineProperty` is used
   instead, correctly passing `enumerable:false`.
3. Globally change loose mode in Babel to generate the correct and
   fast `Object.defineProperty` instead.

I'd personally prefer a combination of 1. and 3. here, but I'm aware
that distributing the ES2015 code might not be an option yet. So the
mitigation of properly guarding the `for..in` here should already help.
But it'd be nice to have a discussion on using `Object.defineProperty`
in general, as I imagine that this could easily bite other applications
as well and this performance cliff is completely unobvious to
developers.

* Switch to Object.keys and Array.prototype.forEach.
2017-11-06 13:23:20 +01:00
Brian Ng
d81cca3b5f Add additional support for loose mode in helper-module-transforms (#6742) 2017-11-05 20:54:14 -05:00
Henry Zhu
e8a33165ff Publish to the latest dist tag [skip ci] (#6738)
- This is because with scoped packages the `latest` package was the first publish we did
- This happens to be beta.4..
- So in this case we should publish whatever version as latest anyway
2017-11-04 01:02:26 -04:00
Sven SAULEAU
b93800d3cb fix: use charcode package 2017-11-03 09:52:45 +01:00
Sven SAULEAU
233e60c765 Merge branch 'master' into feat-use-charcode-constants 2017-11-03 08:52:54 +01:00
Sven SAULEAU
72a90cb63d feat: more charcodes 2017-11-03 08:51:48 +01:00
Sven SAULEAU
b51ac5e60a feat: sort by value
Vim 🖤
2017-11-03 08:27:03 +01:00
Sven SAULEAU
8b206b2c3b feat: generate charCodes
Vim 🖤
2017-11-02 20:13:44 +01:00
Sven SAULEAU
a2ed843636 feat: add more charCodes 2017-11-02 18:14:29 +01:00
Sven SAULEAU
b95810f4b4 refactor: switch to individual exports 2017-11-02 17:57:58 +01:00
Sven SAULEAU
abb4850709 refactor: use charCodes 2017-11-02 16:40:08 +01:00
Sven SAULEAU
459e289d63 feat: setup constants 2017-11-02 09:10:26 +01:00
11337 changed files with 238264 additions and 219337 deletions

View File

@@ -2,3 +2,4 @@
packages/*/test/fixtures
packages/*/lib
packages/babel-standalone/babel.js
packages/babel-preset-env-standalone/babel-preset-env.js

View File

@@ -32,7 +32,6 @@ function istanbulHacks() {
let envOpts = {
loose: true,
exclude: ["transform-typeof-symbol"],
};
const config = {
@@ -43,9 +42,9 @@ const config = {
],
plugins: [
["@babel/proposal-class-properties", { loose: true }],
"@babel/proposal-export-namespace",
"@babel/proposal-export-namespace-from",
"@babel/proposal-numeric-separator",
["@babel/proposal-object-rest-spread", { useBuiltIns: true}],
["@babel/proposal-object-rest-spread", { useBuiltIns: true }],
]
};

View File

@@ -9,3 +9,6 @@ end_of_line = lf
[*.{js,json}]
indent_style = space
indent_size = 2
[*.{md,markdown}]
trim_trailing_whitespace = false

View File

@@ -12,18 +12,11 @@ codemods/*/lib
codemods/*/dist
codemods/*/test/fixtures
codemods/*/test/tmp
experimental/*/lib
experimental/*/node_modules
experimental/*/test/fixtures
experimental/*/test/tmp
experimental/babel-preset-env/data
experimental/babel-preset-env/test/debug-fixtures
packages/babel-preset-env/data
packages/babel-preset-env/test/debug-fixtures
packages/babel-preset-env-standalone/babel-preset-env.js
packages/babel-preset-env-standalone/babel-preset-env.min.js
packages/babel-standalone/babel.js
packages/babel-standalone/babel.min.js
packages/babylon/build
packages/babylon/scripts
packages/babylon/test/expressions
# Prettier tries to insert trailing commas in function calls, which Node.js
# doesn't natively support. This causes an error when loading the Gulp tasks.
packages/babel-standalone/src/gulpTasks.js

View File

@@ -5,11 +5,31 @@
],
"rules": {
"curly": ["error", "multi-line"],
"prettier/prettier": ["error", { "trailingComma": "es5" }],
"prettier/prettier": "error",
"no-case-declarations": "error"
},
"env": {
"node": true,
"mocha": true
}
"node": true
},
"overrides": [
{
"files": [
"packages/*/src/**/*.js",
"codemods/*/src/**/*.js"
],
"rules": {
"no-undefined-identifier": "error"
}
},
{
"files": [
"packages/*/test/**/*.js",
"codemods/*/test/**/*.js",
"test/**/*.js"
],
"env": {
"mocha": true
}
}
]
}

View File

@@ -4,22 +4,20 @@
.*/packages/.*/test
.*/codemods/.*/lib
.*/codemods/.*/test
.*/experimental/.*/lib
.*/experimental/.*/test
.*/node_modules/conventional-changelog-core/
[include]
packages/*/src
codemods/*/src
experimental/*/src
[libs]
lib/file.js
lib/parser.js
lib/types.js
lib/packages/babel-types/lib/index.js.flow
lib/third-party-libs.js.flow
[options]
include_warnings=true
suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe
suppress_comment= \\(.\\|\n\\)*\\$FlowIssue
suppress_comment= \\(.\\|\n\\)*\\$FlowIgnore

3
.gitignore vendored
View File

@@ -34,6 +34,9 @@ package-lock.json
/babel.sublime-workspace
packages/babel-standalone/babel.js
packages/babel-standalone/babel.min.js
packages/babel-preset-env-standalone/babel-preset-env.js
packages/babel-preset-env-standalone/babel-preset-env.min.js
/codemods/*/lib
/codemods/*/node_modules
/packages/babylon/build
.idea/

14
.prettierrc Normal file
View File

@@ -0,0 +1,14 @@
{
"trailingComma": "es5",
"overrides": [{
"files": [
"**/codemods/*/src/**/*.js",
"**/codemods/*/test/**/*.js",
"**/packages/*/src/**/*.js",
"**/packages/*/test/**/*.js"
],
"options": {
"trailingComma": "all"
}
}]
}

View File

@@ -24,7 +24,7 @@ contributing, please read the
## Not sure where to start?
- If you aren't just making a documentation change, you'll probably want to learn a bit about a few topics.
- [ASTs](https://en.wikipedia.org/wiki/Abstract_syntax_tree) (Abstract Syntax Tree): The Babel AST [spec](https://github.com/babel/babel/tree/master/packages/babylon/blob/master/ast/spec.md) is a bit different from [ESTree](https://github.com/estree/estree). The differences are listed [here](https://github.com/babel/babel/tree/master/packages/babylon#output).
- [ASTs](https://en.wikipedia.org/wiki/Abstract_syntax_tree) (Abstract Syntax Tree): The Babel AST [spec](https://github.com/babel/babel/blob/master/packages/babylon/ast/spec.md) is a bit different from [ESTree](https://github.com/estree/estree). The differences are listed [here](https://github.com/babel/babel/tree/master/packages/babylon#output).
- Check out [`/doc`](https://github.com/babel/babel/tree/master/doc) for information about Babel's internals
- Check out [the Babel Plugin Handbook](https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#babel-plugin-handbook) - core plugins are written the same way as any other plugin!
- Check out [AST Explorer](http://astexplorer.net/#/scUfOmVOG5) to learn more about ASTs or make your own plugin in the browser
@@ -115,7 +115,7 @@ $ TEST_ONLY=babel-cli make test
`TEST_ONLY` will also match substrings of the package name:
```sh
# Run tests for the babel-plugin-transform-classes package.
# Run tests for the @babel/plugin-transform-classes package.
$ TEST_ONLY=es2015-class make test
```
@@ -161,35 +161,35 @@ In case you're locally getting errors which are not on the CI, it may be due to
Most packages in [`/packages`](https://github.com/babel/babel/tree/master/packages) have a `test` folder, however some tests might be in other packages or in [`/packages/babel-core`](https://github.com/babel/babel/tree/master/packages/babel-core/test/fixtures).
#### `babel-plugin-x`
#### `@babel/plugin-x`
All the Babel plugins (and other packages) that have a `/test/fixtures` are written in a similar way.
For example, in [`babel-plugin-transform-exponentiation-operator/test`](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-exponentiation-operator/test):
For example, in [`@babel/plugin-transform-exponentiation-operator/test`](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-exponentiation-operator/test):
- There is an `index.js` file. It imports our [test helper](https://github.com/babel/babel/tree/master/packages/babel-helper-plugin-test-runner). (You don't have to worry about this).
- There can be multiple folders under [`/fixtures`](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures)
- There is an [`options.json`](https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/options.json) file whose function is similar to a `.babelrc` file, allowing you to pass in the plugins and settings you need for your tests.
- For this test, we only need the relevant plugin, so it's just `{ "plugins": ["@babel/transform-exponentiation-operator"] }`.
- For this test, we only need the relevant plugin, so it's just `{ "plugins": ["@babel/plugin-transform-exponentiation-operator"] }`.
- If necessary, you can have an `options.json` with different options in each subfolder.
- In each subfolder, you can organize your directory structure by categories of tests. (Example: these folders can be named after the feature you are testing or can reference the issue number they fix)
- Generally, there are two kinds of tests for plugins
- The first is a simple test of the input and output produced by running Babel on some code. We do this by creating an [`actual.js`](https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/binary/actual.js) file and an [`expected.js`](https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/binary/expected.js) file.
- If you need to expect an error, you can ignore creating the `expected.js` file and pass a new `throws` key to the `options.json` that contains the error string that is created.
- The first is a simple test of the input and output produced by running Babel on some code. We do this by creating an [`input.js`](https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/binary/input.js) file and an [`output.js`](https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/binary/output.js) file.
- If you need to expect an error, you can ignore creating the `output.js` file and pass a new `throws` key to the `options.json` that contains the error string that is created.
- The second and preferred type is a test that actually evaluates the produced code and asserts that certain properties are true or false. We do this by creating an [`exec.js`](https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/comprehensive/exec.js) file.
In an actual/expected test, you simply write out the code you want transformed in `actual.js`.
In a fixture test, you simply write out the code you want transformed in `input.js`.
```js
// actual.js
// input.js
2 ** 2;
```
and the expected output after transforming it with your `options.json` in `expected.js`.
and the expected output after transforming it with your `options.json` in `output.js`.
```js
// expected.js
// output.js
Math.pow(2, 2);
```
In an `exec.js` test, we run or check that the code actually does what it's supposed to do rather than just check the static output.
@@ -205,8 +205,8 @@ If you need to check for an error that is thrown you can add to the `options.jso
```js
// options.json example
{
"plugins": [["@babel/proposal-object-rest-spread", { "useBuiltIns": "invalidOption" }]],
"throws": "@babel/proposal-object-rest-spread currently only accepts a boolean option for useBuiltIns (defaults to false)"
"plugins": [["@babel/plugin-proposal-object-rest-spread", { "useBuiltIns": "invalidOption" }]],
"throws": "@babel/plugin-proposal-object-rest-spread currently only accepts a boolean option for useBuiltIns (defaults to false)"
}
```
@@ -227,13 +227,25 @@ Inside the `packages/babylon/tests/fixtures` folder are categories/groupings of
etc.). To add a test, create a folder under one of these groupings (or create a new one) with a
descriptive name, and add the following:
* Create an `actual.js` file that contains the code you want Babylon to parse.
* Create an `input.js` file that contains the code you want Babylon to parse.
* Add an `expected.json` file with the expected parser output. For added convenience, if there is no `expected.json` present, the test runner will generate one for you.
* Add an `output.json` file with the expected parser output. For added convenience, if there is no `output.json` present, the test runner will generate one for you.
After writing tests for babylon, just build it by running:
```sh
$ make build-babylon
```
Then, to run the tests, use:
```sh
$ TEST_ONLY=babylon make test-only
```
#### Bootstrapping expected output
For both `babel-plugin-x` and `babylon`, you can easily generate an `expected.js`/`expected.json` automatically by just providing `actual.js` and running the tests as you usually would.
For both `@babel/plugin-x` and `babylon`, you can easily generate an `output.js`/`output.json` automatically by just providing `input.js` and running the tests as you usually would.
```
// Example
@@ -244,8 +256,8 @@ For both `babel-plugin-x` and `babylon`, you can easily generate an `expected.js
- comments
- basic
- block-trailing-comment
- actual.js
- expected.json (will be generated if not created)
- input.js
- output.json (will be generated if not created)
```
### Debugging code
@@ -267,7 +279,7 @@ To include the changes, we have to make sure to build Babel:
$ make build
```
Next, we need to execute `Generator.generate()`, which can be achieved by running a test case in the `babel-generator` package.
Next, we need to execute `Generator.generate()`, which can be achieved by running a test case in the `@babel/generator` package.
For example, we can run the test case that tests the generation of class declarations:
```bash
@@ -275,7 +287,6 @@ $ TEST_DEBUG=true TEST_GREP=ClassDeclaration make test-only
./scripts/test.sh
Debugger listening on port 9229.
Warning: This is an experimental feature and could change at any time.
To start debugging, open the following URL in Chrome:
chrome-devtools://devtools/remote/serve_file/@60cd6e859b9f557d2312f5bf532f6aec5f284980/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:9229/3cdaebd2-be88-4e7b-a94b-432950ab72d0
```
@@ -298,8 +309,8 @@ Note that the code shown in Chrome DevTools is compiled code and therefore diffe
- Start working about the Babel transform itself!
## Internals
- AST spec ([babylon/ast/spec.md](https://github.com/babel/babel/tree/master/packages/babylon/blob/master/ast/spec.md))
- Versioning ([doc/design/versioning.md](https://github.com/babel/babel/blob/master/doc/design/versioning.md)
- AST spec ([babylon/ast/spec.md](https://github.com/babel/babel/blob/master/packages/babylon/ast/spec.md))
- Versioning ([doc/design/versioning.md](https://github.com/babel/babel/blob/master/doc/design/versioning.md))
- Monorepo ([doc/design/monorepo.md](https://github.com/babel/babel/blob/master/doc/design/monorepo.md))
- Compiler environment support ([doc/design/compiler-environment-support.md](https://github.com/babel/babel/blob/master/doc/design/compiler-environment-support.md))
- Compiler assumptions ([doc/design/compiler-assumptions.md](https://github.com/babel/babel/blob/master/doc/design/compiler-assumptions.md))

View File

@@ -3,9 +3,6 @@
const plumber = require("gulp-plumber");
const through = require("through2");
const chalk = require("chalk");
const pump = require("pump");
const uglify = require("gulp-uglify");
const rename = require("gulp-rename");
const newer = require("gulp-newer");
const babel = require("gulp-babel");
const watch = require("gulp-watch");
@@ -13,13 +10,12 @@ const gutil = require("gulp-util");
const filter = require("gulp-filter");
const gulp = require("gulp");
const path = require("path");
const merge = require("merge-stream");
const RootMostResolvePlugin = require("webpack-dependency-suite")
.RootMostResolvePlugin;
const webpack = require("webpack");
const webpackStream = require("webpack-stream");
const merge = require("merge-stream");
const registerStandalonePackageTask = require("./scripts/gulp-tasks")
.registerStandalonePackageTask;
const sources = ["codemods", "packages", "experimental"];
const sources = ["codemods", "packages"];
function swapSrcWithLib(srcPath) {
const parts = srcPath.split(path.sep);
@@ -81,114 +77,40 @@ gulp.task("watch", ["build"], function() {
});
});
gulp.task("build-babel-standalone", cb => {
pump(
[
gulp.src(__dirname + "/packages/babel-standalone/src/index.js"),
webpackBuild(),
gulp.dest(__dirname + "/packages/babel-standalone"),
uglify(),
rename({ extname: ".min.js" }),
gulp.dest(__dirname + "/packages/babel-standalone"),
],
cb
);
});
registerStandalonePackageTask(
gulp,
"babel",
"Babel",
path.join(__dirname, "packages"),
require("./packages/babel-core/package.json").version
);
function webpackBuild() {
let version = require("./packages/babel-core/package.json").version;
const presetEnvWebpackPlugins = [
new webpack.NormalModuleReplacementPlugin(
/\.\/available-plugins/,
require.resolve(
path.join(
__dirname,
"./packages/babel-preset-env-standalone/src/available-plugins"
)
)
),
new webpack.NormalModuleReplacementPlugin(
/caniuse-lite\/data\/regions\/.+/,
require.resolve(
path.join(
__dirname,
"./packages/babel-preset-env-standalone/src/caniuse-lite-regions"
)
)
),
];
// If this build is part of a pull request, include the pull request number in
// the version number.
if (process.env.CIRCLE_PR_NUMBER) {
version += "+pr." + process.env.CIRCLE_PR_NUMBER;
}
const config = {
module: {
rules: [
{
test: /\.js$/,
include: /node_modules/,
loader: "babel-loader",
options: {
// Some of the node_modules may have their own "babel" section in
// their project.json (or a ".babelrc" file). We need to ignore
// those as we're using our own Babel options.
babelrc: false,
presets: [
[
"@babel/env",
{
loose: true,
exclude: ["transform-typeof-symbol"],
},
],
],
},
},
{
test: /\.js$/,
exclude: /node_modules/,
loader: "babel-loader",
options: {
// Some of the node_modules may have their own "babel" section in
// their project.json (or a ".babelrc" file). We need to ignore
// those as we're using our own Babel options.
babelrc: false,
presets: [
[
"@babel/env",
{
loose: true,
exclude: ["transform-typeof-symbol"],
},
],
["@babel/stage-0", { loose: true }],
],
},
},
],
// babylon is already bundled and does not require parsing
noParse: [/babylon\/lib/],
},
node: {
// Mock Node.js modules that Babel require()s but that we don't
// particularly care about.
fs: "empty",
module: "empty",
net: "empty",
},
output: {
filename: "babel.js",
library: "Babel",
libraryTarget: "umd",
},
plugins: [
new webpack.DefinePlugin({
"process.env.NODE_ENV": '"production"',
BABEL_VERSION: JSON.stringify(version),
VERSION: JSON.stringify(version),
}),
/*new webpack.NormalModuleReplacementPlugin(
/..\/..\/package/,
"../../../../src/babel-package-shim"
),*/
new webpack.optimize.ModuleConcatenationPlugin(),
],
resolve: {
plugins: [
// Dedupe packages that are used across multiple plugins.
// This replaces DedupePlugin from Webpack 1.x
new RootMostResolvePlugin(__dirname, true),
],
},
};
return webpackStream(config, webpack);
// To write JSON for debugging:
/*return webpackStream(config, webpack, (err, stats) => {
require('gulp-util').log(stats.toString({colors: true}));
require('fs').writeFileSync('webpack-debug.json', JSON.stringify(stats.toJson()));
});*/
}
registerStandalonePackageTask(
gulp,
"babel-preset-env",
"babelPresetEnv",
path.join(__dirname, "packages"),
require("./packages/babel-preset-env/package.json").version,
presetEnvWebpackPlugins
);

View File

@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2014-2017 Sebastian McKenzie <sebmck@gmail.com>
Copyright (c) 2014-2018 Sebastian McKenzie <sebmck@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the

View File

@@ -1,5 +1,5 @@
MAKEFLAGS = -j1
FLOW_COMMIT = 4cc2b9f7fadf2e9e445ee9b7b980c65d69d3fbc0
FLOW_COMMIT = 622bbc4f07acb77eb1109830c70815f827401d90
TEST262_COMMIT = 1282e842febf418ca27df13fa4b32f7e5021b470
export NODE_ENV = test
@@ -7,7 +7,7 @@ export NODE_ENV = test
# Fix color output until TravisCI fixes https://github.com/travis-ci/travis-ci/issues/7967
export FORCE_COLOR = true
SOURCES = packages codemods experimental
SOURCES = packages codemods
.PHONY: build build-dist watch lint fix clean test-clean test-only test test-ci publish bootstrap
@@ -16,8 +16,17 @@ build: clean
# Build babylon before building all other projects
make build-babylon
./node_modules/.bin/gulp build
node ./packages/babel-types/scripts/generateTypeHelpers.js
# call build again as the generated files might need to be compiled again.
./node_modules/.bin/gulp build
# generate flow and typescript typings
node scripts/generators/flow.js > ./packages/babel-types/lib/index.js.flow
node scripts/generators/typescript.js > ./packages/babel-types/lib/index.d.ts
# generate docs
node scripts/generators/docs.js > ./packages/babel-types/README.md
ifneq ("$(BABEL_ENV)", "cov")
make build-standalone
make build-preset-env-standalone
endif
build-babylon:
@@ -27,17 +36,23 @@ build-babylon:
build-standalone:
./node_modules/.bin/gulp build-babel-standalone
build-preset-env-standalone:
./node_modules/.bin/gulp build-babel-preset-env-standalone
build-dist: build
cd packages/babel-polyfill; \
scripts/build-dist.sh
cd packages/babel-runtime; \
node scripts/build-dist.js
node scripts/generate-babel-types-docs.js
watch: clean
make clean-lib
BABEL_ENV=development ./node_modules/.bin/gulp watch
watch-babylon:
cd packages/babylon; \
./node_modules/.bin/rollup -c -w
flow:
./node_modules/.bin/flow check --strip-root
@@ -50,8 +65,6 @@ fix:
clean: test-clean
rm -rf packages/babel-polyfill/browser*
rm -rf packages/babel-polyfill/dist
# rm -rf packages/babel-runtime/helpers
# rm -rf packages/babel-runtime/core-js
rm -rf coverage
rm -rf packages/*/npm-debug*
@@ -110,11 +123,13 @@ test-test262-update-whitelist:
publish:
git pull --rebase
make clean-lib
rm -rf packages/babel-runtime/helpers
rm -rf packages/babel-runtime/core-js
BABEL_ENV=production make build-dist
make test
# not using lerna independent mode atm, so only update packages that have changed since we use ^
# --only-explicit-updates
./node_modules/.bin/lerna publish --force-publish=* --npm-tag=next --exact --skip-temp-tag
./node_modules/.bin/lerna publish --force-publish=* --exact --skip-temp-tag
make clean
bootstrap:

116
README.md
View File

@@ -24,9 +24,9 @@
<a href="https://medium.com/friendship-dot-js/i-peeked-into-my-node-modules-directory-and-you-wont-believe-what-happened-next-b89f63d21558"><img alt="Business Strategy Status" src="https://img.shields.io/badge/business%20model-flavortown-green.svg"></a>
</p>
Babel is community-driven and thus mostly maintained by a group of [volunteers](https://babeljs.io/team). It has a lot of [companies and projects](http://babeljs.io/users) using it but almost no sponsors/people funded to work on it. If you'd like to help maintain the future of the project, please consider:
Babel is community-driven and thus mostly maintained by a group of [volunteers](https://babeljs.io/team). It has a lot of [companies and projects](https://babeljs.io/users) using it but almost no sponsors/people funded to work on it. If you'd like to help maintain the future of the project, please consider:
- Giving developer time on the project. (Message us on [Twitter](https://twitter.com/babeljs) or [Slack](slack.babeljs.io))
- Giving developer time on the project. (Message us on [Twitter](https://twitter.com/babeljs) or [Slack](https://slack.babeljs.io/))
- [Giving funds by becoming a backer/sponsor on OpenCollective](https://opencollective.com/babel)
## Intro
@@ -63,19 +63,23 @@ Mostly a handful of volunteers! Please check out our [team page](https://babeljs
### Looking for support?
For questions and support please visit join our [Slack Community](https://slack.babeljs.io/), ask a question on [Stack Overflow](http://stackoverflow.com/questions/tagged/babeljs), or ping us on [Twitter](https://twitter.com/babeljs/).
For questions and support please visit join our [Slack Community](https://slack.babeljs.io/), ask a question on [Stack Overflow](https://stackoverflow.com/questions/tagged/babeljs), or ping us on [Twitter](https://twitter.com/babeljs).
### Is there a Babel song?
I'm so glad you asked: [Hallelujah —— In Praise of Babel](SONG.md) by [@angus-c](https://github.com/angus-c). Tweet us your recordings!
### Where are the docs?
Check out our website: [babeljs.io](http://babeljs.io/), and report issues/features at [babel/website](https://github.com/babel/website/issues).
Check out our website: [babeljs.io](https://babeljs.io/), and report issues/features at [babel/website](https://github.com/babel/website/issues).
### Want to report a bug or request a feature?
Please read through our [CONTRIBUTING.md](https://github.com/babel/babel/blob/master/CONTRIBUTING.md) and fill out the issue template at [babel/issues](https://github.com/babel/babel/issues)!
Please read through our [CONTRIBUTING.md](CONTRIBUTING.md) and fill out the issue template at [babel/issues](https://github.com/babel/babel/issues)!
### Want to contribute to Babel?
Check out our [CONTRIBUTING.md](https://github.com/babel/babel/blob/master/CONTRIBUTING.md) to get started with setting up the repo.
Check out our [CONTRIBUTING.md](CONTRIBUTING.md) to get started with setting up the repo.
- If you have already joined Slack, join our [#development](https://babeljs.slack.com/messages/development) channel and say hi!
- Check out the issues with the [good first issue](https://github.com/babel/babel/labels/good%20first%20issue) and [help wanted](https://github.com/babel/babel/labels/help%20wanted) label. We suggest also looking at the closed ones to get a sense of the kinds of issues you can tackle.
@@ -84,7 +88,7 @@ Check out our [CONTRIBUTING.md](https://github.com/babel/babel/blob/master/CONTR
### How is the repo structured?
The Babel repo is managed as a [monorepo](https://github.com/babel/babel/blob/master/doc/design/monorepo.md) that is composed of many [npm packages](/packages#readme).
The Babel repo is managed as a [monorepo](doc/design/monorepo.md) that is composed of many [npm packages](packages/README.md).
## Backers
@@ -95,30 +99,30 @@ Support us with a monthly donation and help us continue our activities. [[Become
<a href="https://opencollective.com/babel/backer/2/website" target="_blank"><img src="https://opencollective.com/babel/backer/2/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/3/website" target="_blank"><img src="https://opencollective.com/babel/backer/3/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/4/website" target="_blank"><img src="https://opencollective.com/babel/backer/4/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/5/website" target="_blank"><img src="https://opencollective.com/babel/backer/5/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/6/website" target="_blank"><img src="https://opencollective.com/babel/backer/6/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/7/website" target="_blank"><img src="https://opencollective.com/babel/backer/7/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/8/website" target="_blank"><img src="https://opencollective.com/babel/backer/8/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/9/website" target="_blank"><img src="https://opencollective.com/babel/backer/9/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/10/website" target="_blank"><img src="https://opencollective.com/babel/backer/10/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/11/website" target="_blank"><img src="https://opencollective.com/babel/backer/11/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/12/website" target="_blank"><img src="https://opencollective.com/babel/backer/12/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/13/website" target="_blank"><img src="https://opencollective.com/babel/backer/13/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/14/website" target="_blank"><img src="https://opencollective.com/babel/backer/14/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/15/website" target="_blank"><img src="https://opencollective.com/babel/backer/15/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/16/website" target="_blank"><img src="https://opencollective.com/babel/backer/16/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/17/website" target="_blank"><img src="https://opencollective.com/babel/backer/17/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/18/website" target="_blank"><img src="https://opencollective.com/babel/backer/18/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/19/website" target="_blank"><img src="https://opencollective.com/babel/backer/19/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/20/website" target="_blank"><img src="https://opencollective.com/babel/backer/20/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/21/website" target="_blank"><img src="https://opencollective.com/babel/backer/21/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/22/website" target="_blank"><img src="https://opencollective.com/babel/backer/22/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/23/website" target="_blank"><img src="https://opencollective.com/babel/backer/23/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/24/website" target="_blank"><img src="https://opencollective.com/babel/backer/24/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/25/website" target="_blank"><img src="https://opencollective.com/babel/backer/25/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/26/website" target="_blank"><img src="https://opencollective.com/babel/backer/26/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/27/website" target="_blank"><img src="https://opencollective.com/babel/backer/27/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/28/website" target="_blank"><img src="https://opencollective.com/babel/backer/28/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/5/website" target="_blank"><img src="https://opencollective.com/babel/backer/5/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/6/website" target="_blank"><img src="https://opencollective.com/babel/backer/6/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/7/website" target="_blank"><img src="https://opencollective.com/babel/backer/7/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/8/website" target="_blank"><img src="https://opencollective.com/babel/backer/8/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/9/website" target="_blank"><img src="https://opencollective.com/babel/backer/9/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/10/website" target="_blank"><img src="https://opencollective.com/babel/backer/10/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/11/website" target="_blank"><img src="https://opencollective.com/babel/backer/11/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/12/website" target="_blank"><img src="https://opencollective.com/babel/backer/12/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/13/website" target="_blank"><img src="https://opencollective.com/babel/backer/13/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/14/website" target="_blank"><img src="https://opencollective.com/babel/backer/14/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/15/website" target="_blank"><img src="https://opencollective.com/babel/backer/15/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/16/website" target="_blank"><img src="https://opencollective.com/babel/backer/16/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/17/website" target="_blank"><img src="https://opencollective.com/babel/backer/17/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/18/website" target="_blank"><img src="https://opencollective.com/babel/backer/18/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/19/website" target="_blank"><img src="https://opencollective.com/babel/backer/19/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/20/website" target="_blank"><img src="https://opencollective.com/babel/backer/20/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/21/website" target="_blank"><img src="https://opencollective.com/babel/backer/21/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/22/website" target="_blank"><img src="https://opencollective.com/babel/backer/22/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/23/website" target="_blank"><img src="https://opencollective.com/babel/backer/23/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/24/website" target="_blank"><img src="https://opencollective.com/babel/backer/24/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/25/website" target="_blank"><img src="https://opencollective.com/babel/backer/25/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/26/website" target="_blank"><img src="https://opencollective.com/babel/backer/26/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/27/website" target="_blank"><img src="https://opencollective.com/babel/backer/27/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/28/website" target="_blank"><img src="https://opencollective.com/babel/backer/28/avatar.svg"></a>
<a href="https://opencollective.com/babel/backer/29/website" target="_blank"><img src="https://opencollective.com/babel/backer/29/avatar.svg"></a>
## Sponsors
@@ -130,32 +134,32 @@ Become a sponsor and get your logo on our README on Github with a link to your s
<a href="https://opencollective.com/babel/sponsor/2/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/2/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/3/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/3/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/4/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/4/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/5/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/5/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/6/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/6/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/7/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/7/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/8/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/8/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/9/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/9/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/10/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/10/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/11/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/11/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/12/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/12/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/13/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/13/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/14/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/14/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/15/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/15/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/16/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/16/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/17/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/17/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/18/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/18/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/19/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/19/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/20/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/20/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/21/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/21/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/22/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/22/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/23/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/23/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/24/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/24/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/25/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/25/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/26/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/26/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/27/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/27/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/28/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/28/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/5/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/5/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/6/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/6/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/7/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/7/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/8/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/8/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/9/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/9/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/10/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/10/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/11/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/11/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/12/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/12/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/13/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/13/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/14/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/14/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/15/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/15/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/16/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/16/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/17/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/17/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/18/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/18/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/19/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/19/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/20/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/20/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/21/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/21/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/22/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/22/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/23/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/23/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/24/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/24/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/25/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/25/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/26/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/26/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/27/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/27/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/28/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/28/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/29/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/29/avatar.svg"></a>
## License
[MIT](https://github.com/babel/babel/blob/master/LICENSE)
[MIT](LICENSE)

67
SONG.md Normal file
View File

@@ -0,0 +1,67 @@
## Hallelujah—In Praise of Babel
I heard there was a clever trick
That rewrote all your JavaScript
But you dont really care for magic, do you
Well it goes like this: the source, the dist
The ES five, the ES six
The sacred script transforming Hallelujah
Hallelujah, Hallelujah
Hallelujah, Hallelujah
So I added all the shiny things
Classes, spreads and template strings
Through syntax sugared code I tried to woo you
Generators, const and let
I used them all without regret
And its a terse and a destructured Hallelujah
Hallelujah etc.
Well my faith was strong but I needed proof
The standard was my source of truth
But TC39 meant nothing to you
So even though you werent impressed
I checked the build against the spec
And its a more-or-less compliant Hallelujah
Hallelujah etc.
Now you say the build steps too complex
And you claim no need for ES Next
Well I used to think that way before I knew you
But your code grows older with each line
Its a joyless dirge on a withered vine
Its a threnody for a bygone Hallelujah
Hallelujah etc.
Yes I learned about the danger signs
How theyd polyfilled a thousand lines
The cost of using Maps and Symbols threw you
Still I disregarded common sense
Now my source is small but the builds immense
And its a slow and unresponsive Hallelujah
Hallelujah etc.
There was a time when they let me know
Whats really going on below
But now theres only source maps there to school you
And debuggings not a progress march
Its a frenzied fumble in the dark
Its a labyrinthine search for Hallelujah
Hallelujah etc.
Well, maybe theres a god up there
But all I ever got from prayers
Was broken builds and errors that would spook you
And that anguished cry you hear at night
Is the plugin I forgot to write
Its a cold and its a broken Hallelujah
Hallelujah etc.
[Angus Croll](https://github.com/angus-c)

View File

@@ -2,6 +2,8 @@ general:
artifacts:
- "packages/babel-standalone/babel.js"
- "packages/babel-standalone/babel.min.js"
- "packages/babel-preset-env-standalone/babel-preset-env.js"
- "packages/babel-preset-env-standalone/babel-preset-env.min.js"
machine:
node:
@@ -25,3 +27,4 @@ test:
# data for a JS file that's several megabytes large is bound to fail. Here,
# we just run the babel-standalone test separately.
- ./node_modules/mocha/bin/_mocha packages/babel-standalone/test/ --opts test/mocha.opts
- ./node_modules/mocha/bin/_mocha packages/babel-preset-env-standalone/test/ --opts test/mocha.opts

View File

@@ -1,6 +0,0 @@
{
"rules": {
"prettier/prettier": ["error", { "trailingComma": "all" }],
"no-undefined-identifier": 2
}
}

View File

@@ -36,21 +36,21 @@ npm install --save-dev @babel/plugin-codemod-optional-catch-binding
```json
{
"plugins": ["@babel/codemod-optional-catch-binding"]
"plugins": ["@babel/plugin-codemod-optional-catch-binding"]
}
```
### Via CLI
```sh
babel --plugins @babel/codemod-optional-catch-binding script.js
babel --plugins @babel/plugin-codemod-optional-catch-binding script.js
```
### Via Node API
```javascript
require("@babel/core").transform("code", {
plugins: ["@babel/codemod-optional-catch-binding"]
plugins: ["@babel/plugin-codemod-optional-catch-binding"]
});
```

View File

@@ -1,6 +1,6 @@
{
"name": "@babel/plugin-codemod-optional-catch-binding",
"version": "7.0.0-beta.31",
"version": "7.0.0-beta.39",
"description": "Remove unused catch bindings",
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-remove-unused-catch-binding",
"license": "MIT",
@@ -9,13 +9,13 @@
"@babel/plugin"
],
"dependencies": {
"@babel/plugin-syntax-optional-catch-binding": "7.0.0-beta.31"
"@babel/plugin-syntax-optional-catch-binding": "7.0.0-beta.39"
},
"peerDependencies": {
"@babel/core": "7.0.0-beta.31"
"@babel/core": "7.0.0-beta.39"
},
"devDependencies": {
"@babel/core": "7.0.0-beta.31",
"@babel/helper-plugin-test-runner": "7.0.0-beta.31"
"@babel/core": "7.0.0-beta.39",
"@babel/helper-plugin-test-runner": "7.0.0-beta.39"
}
}

View File

@@ -1,7 +1,7 @@
import syntaxOptionalCatchBinding from "@babel/plugin-syntax-optional-catch-binding";
import { types as t } from "@babel/core";
export default function(babel) {
const { types: t } = babel;
export default function() {
return {
inherits: syntaxOptionalCatchBinding,

View File

@@ -1 +1 @@
The [AST specification](https://github.com/babel/babylon/blob/master/ast/spec.md) has been moved to the Babylon repo, `babel/babylon`.
The [AST specification](https://github.com/babel/babel/blob/master/packages/babylon/ast/spec.md) has been moved to the Babylon package, `packages/babylon`.

View File

@@ -1,6 +0,0 @@
{
"rules": {
"prettier/prettier": ["error", { "trailingComma": "all" }],
"no-undefined-identifier": 2
}
}

View File

@@ -1,6 +0,0 @@
/lib
debug-fixtures
fixtures
/data
/flow-typed
test/tmp

View File

@@ -1,572 +0,0 @@
# @babel/preset-env [![npm](https://img.shields.io/npm/v/babel-preset-env.svg)](https://www.npmjs.com/package/babel-preset-env) [![travis](https://img.shields.io/travis/babel/babel-preset-env/master.svg)](https://travis-ci.org/babel/babel-preset-env) [![npm-downloads](https://img.shields.io/npm/dm/babel-preset-env.svg)](https://www.npmjs.com/package/babel-preset-env) [![codecov](https://img.shields.io/codecov/c/github/babel/babel-preset-env/master.svg?maxAge=43200)](https://codecov.io/github/babel/babel-preset-env)
> A Babel preset that compiles [ES2015+](https://github.com/tc39/proposals/blob/master/finished-proposals.md) down to ES5 by automatically determining the Babel plugins and polyfills you need based on your targeted browser or runtime environments.
```sh
npm install @babel/preset-env --save-dev
```
Without any configuration options, @babel/preset-env behaves exactly the same as @babel/preset-latest (or @babel/preset-es2015, @babel/preset-es2016, and @babel/preset-es2017 together).
```json
{
"presets": ["@babel/env"]
}
```
You can also configure it to only include the polyfills and transforms needed for the browsers you support. Compiling only what's needed can make your bundles smaller and your life easier.
This example only includes the polyfills and code transforms needed for the last two versions of each browser, and versions of Safari greater than or equal to 7. We use [browserslist](https://github.com/ai/browserslist) to parse this information, so you can use [any valid query format supported by browserslist](https://github.com/ai/browserslist#queries).
```json
{
"presets": [
["@babel/env", {
"targets": {
"browsers": ["last 2 versions", "safari >= 7"]
}
}]
]
}
```
Similarly, if you're targeting Node.js instead of the browser, you can configure babel-preset-env to only include the polyfills and transforms necessary for a particular version:
```json
{
"presets": [
["@babel/env", {
"targets": {
"node": "6.10"
}
}]
]
}
```
For convenience, you can use `"node": "current"` to only include the necessary polyfills and transforms for the Node.js version that you use to run Babel:
```json
{
"presets": [
["@babel/env", {
"targets": {
"node": "current"
}
}]
]
}
```
- [How it Works](#how-it-works)
- [Install](#install)
- [Usage](#usage)
- [Options](#options)
- [Examples](#examples)
- [Issues](#issues)
## How it Works
### Determine environment support for ECMAScript features
Use external data such as [`compat-table`](https://github.com/kangax/compat-table) to determine browser support. (We should create PRs there when necessary)
![](https://cloud.githubusercontent.com/assets/588473/19214029/58deebce-8d48-11e6-9004-ee3fbcb75d8b.png)
We can periodically run [build-data.js](https://github.com/babel/babel-preset-env/blob/master/scripts/build-data.js) which generates [plugins.json](https://github.com/babel/babel-preset-env/blob/master/data/plugins.json).
Ref: [#7](https://github.com/babel/babel-preset-env/issues/7)
### Maintain a mapping between JavaScript features and Babel plugins
> Currently located at [plugin-features.js](https://github.com/babel/babel-preset-env/blob/master/data/plugin-features.js).
This should be straightforward to do in most cases. There might be cases where plugins should be split up more or certain plugins aren't standalone enough (or impossible to do).
### Support all plugins in Babel that are considered `latest`
> Default behavior without options is the same as `@babel/preset-latest`.
It won't include `stage-x` plugins. env will support all plugins in what we consider the latest version of JavaScript (by matching what we do in [`@babel/preset-latest`](http://babeljs.io/docs/plugins/preset-latest/)).
Ref: [#14](https://github.com/babel/babel-preset-env/issues/14)
### Determine the lowest common denominator of plugins to be included in the preset
If you are targeting IE 8 and Chrome 55 it will include all plugins required by IE 8 since you would need to support both still.
### Support a target option `"node": "current"` to compile for the currently running node version.
For example, if you are building on Node 6, arrow functions won't be converted, but they will if you build on Node 0.12.
### Support a `browsers` option like autoprefixer.
Use [browserslist](https://github.com/ai/browserslist) to declare supported environments by performing queries like `> 1%, last 2 versions`.
Ref: [#19](https://github.com/babel/babel-preset-env/pull/19)
### Browserslist support.
[Browserslist](https://github.com/ai/browserslist) is a library used to share a supported list of browsers between different front-end tools like [autoprefixer](https://github.com/postcss/autoprefixer), [stylelint](https://stylelint.io/), [eslint-plugin-compat](https://github.com/amilajack/eslint-plugin-compat) and many others.
By default, @babel/preset-env will use [browserslist config sources](https://github.com/ai/browserslist#queries).
For example, to enable only the polyfills and plugins needed for a project targeting *last 2 versions* and *IE10*:
**.babelrc**
```json
{
"presets": [
["@babel/env", {
"useBuiltIns": "entry"
}]
]
}
```
**browserslist**
```
Last 2 versions
IE 10
```
or
**package.json**
```
"browserslist": "last 2 versions, ie 10"
```
Browserslist config will be ignored if: 1) `targets.browsers` was specified 2) or with `ignoreBrowserslistConfig: true` option ([see more](#ignoreBrowserslistConfig)):
#### Targets merging.
1. If [targets.browsers](#targetsbrowsers) is defined - the browserslist config will be ignored. The browsers specified in `targets` will be merged with [any other explicitly defined targets](#targets). If merged, targets defined explicitly will override the same targets received from `targets.browsers`.
2. If [targets.browsers](#targetsbrowsers) is _not_ defined - the program will search browserslist file or `package.json` with `browserslist` field. The search will start from the working directory of the process or from the path specified by the `configPath` option, and go up to the system root. If both a browserslist file and configuration inside a `package.json` are found, an exception will be thrown.
3. If a browserslist config was found and other targets are defined (but not [targets.browsers](#targetsbrowsers)), the targets will be merged in the same way as `targets` defined explicitly with `targets.browsers`.
## Install
With [npm](https://www.npmjs.com):
```sh
npm install --save-dev @babel/preset-env
```
Or [yarn](https://yarnpkg.com):
```sh
yarn add @babel/preset-env --dev
```
## Usage
The default behavior without options runs all transforms (behaves the same as [@babel/preset-latest](https://babeljs.io/docs/plugins/preset-latest/)).
```json
{
"presets": ["@babel/env"]
}
```
## Options
For more information on setting options for a preset, refer to the [plugin/preset options](http://babeljs.io/docs/plugins/#plugin-preset-options) documentation.
### `targets`
`{ [string]: number | string }`, defaults to `{}`.
Takes an object of environment versions to support.
Each target environment takes a number or a string (we recommend using a string when specifying minor versions like `node: "6.10"`).
Example environments: `chrome`, `opera`, `edge`, `firefox`, `safari`, `ie`, `ios`, `android`, `node`, `electron`.
The [data](https://github.com/babel/babel-preset-env/blob/master/data/plugins.json) for this is generated by running the [build-data script](https://github.com/babel/babel-preset-env/blob/master/scripts/build-data.js) which pulls in data from [compat-table](https://kangax.github.io/compat-table).
### `targets.node`
`number | string | "current" | true`
If you want to compile against the current node version, you can specify `"node": true` or `"node": "current"`, which would be the same as `"node": process.versions.node`.
### `targets.browsers`
`Array<string> | string`
A query to select browsers (ex: last 2 versions, > 5%) using [browserslist](https://github.com/ai/browserslist).
Note, browsers' results are overridden by explicit items from `targets`.
### `spec`
`boolean`, defaults to `false`.
Enable more spec compliant, but potentially slower, transformations for any plugins in this preset that support them.
### `loose`
`boolean`, defaults to `false`.
Enable "loose" transformations for any plugins in this preset that allow them.
### `modules`
`"amd" | "umd" | "systemjs" | "commonjs" | false`, defaults to `"commonjs"`.
Enable transformation of ES6 module syntax to another module type.
Setting this to `false` will not transform modules.
### `debug`
`boolean`, defaults to `false`.
Outputs the targets/plugins used and the version specified in [plugin data version](https://github.com/babel/babel-preset-env/blob/master/data/plugins.json) to `console.log`.
### `include`
`Array<string>`, defaults to `[]`.
An array of plugins to always include.
Valid options include any:
- [Babel plugins](https://github.com/babel/babel-preset-env/blob/master/data/plugin-features.js) - both with (`@babel/plugin-transform-spread`) and without prefix (`transform-spread`) are supported.
- [Built-ins](https://github.com/babel/babel-preset-env/blob/master/data/built-in-features.js), such as `map`, `set`, or `object.assign`.
This option is useful if there is a bug in a native implementation, or a combination of a non-supported feature + a supported one doesn't work.
For example, Node 4 supports native classes but not spread. If `super` is used with a spread argument, then the `transform-classes` transform needs to be `include`d, as it is not possible to transpile a spread with `super` otherwise.
> NOTE: The `include` and `exclude` options _only_ work with the [plugins included with this preset](https://github.com/babel/babel-preset-env/blob/master/data/plugin-features.js); so, for example, including `proposal-do-expressions` or excluding `proposal-function-bind` will throw errors. To use a plugin _not_ included with this preset, add them to your [config](https://babeljs.io/docs/usage/babelrc/) directly.
### `exclude`
`Array<string>`, defaults to `[]`.
An array of plugins to always exclude/remove.
The possible options are the same as the `include` option.
This option is useful for "blacklisting" a transform like `transform-regenerator` if you don't use generators and don't want to include `regeneratorRuntime` (when using `useBuiltIns`) or for using another plugin like [fast-async](https://github.com/MatAtBread/fast-async) instead of [Babel's async-to-gen](http://babeljs.io/docs/plugins/proposal-async-generator-functions/).
### `useBuiltIns`
`"usage"` | `"entry"` | `false`, defaults to `false`.
A way to apply `@babel/preset-env` for polyfills (via `@babel/polyfill`).
```sh
npm install @babel/polyfill --save
```
#### `useBuiltIns: 'usage'`
Adds specific imports for polyfills when they are used in each file. We take advantage of the fact that a bundler will load the same polyfill only once.
**In**
a.js
```js
var a = new Promise();
```
b.js
```js
var b = new Map();
```
**Out (if environment doesn't support it)**
```js
import "@babel/polyfill/core-js/modules/es6.promise";
var a = new Promise();
```
```js
import "@babel/polyfill/core-js/modules/es6.map";
var b = new Map();
```
**Out (if environment supports it)**
```js
var a = new Promise();
```
```js
var b = new Map();
```
#### `useBuiltIns: 'entry'`
> NOTE: Only use `require("@babel/polyfill");` once in your whole app.
> Multiple imports or requires of `@babel/polyfill` will throw an error since it can cause global collisions and other issues that are hard to trace.
> We recommend creating a single entry file that only contains the `require` statement.
This option enables a new plugin that replaces the statement `import "@babel/polyfill"` or `require("@babel/polyfill")` with individual requires for `@babel/polyfill` based on environment.
**In**
```js
import "@babel/polyfill";
```
**Out (different based on environment)**
```js
import "@babel/polyfill/core-js/modules/es7.string.pad-start";
import "@babel/polyfill/core-js/modules/es7.string.pad-end";
```
#### `useBuiltIns: false`
Don't add polyfills automatically per file, or transform `import "@babel/polyfill"` to individual polyfills.
### `forceAllTransforms`
`boolean`, defaults to `false`.
<p><details>
<summary><b>Example</b></summary>
With Babel 7's .babelrc.js support, you can force all transforms to be run if env is set to `production`.
```js
module.exports = {
presets: [
["@babel/env", {
targets: {
chrome: 59,
edge: 13,
firefox: 50,
},
// for uglifyjs...
forceAllTransforms: process.env === "production"
}],
],
};
```
</details></p>
> NOTE: `targets.uglify` is deprecated and will be removed in the next major in
favor of this.
By default, this preset will run all the transforms needed for the targeted
environment(s). Enable this option if you want to force running _all_
transforms, which is useful if the output will be run through UglifyJS or an
environment that only supports ES5.
> NOTE: Uglify has a work-in-progress "Harmony" branch to address the lack of
ES6 support, but it is not yet stable. You can follow its progress in
[UglifyJS2 issue #448](https://github.com/mishoo/UglifyJS2/issues/448). If you
require an alternative minifier which _does_ support ES6 syntax, we recommend
using [babel-minify](https://github.com/babel/minify).
### `configPath`
`string`, defaults to `process.cwd()`
The starting point where the config search for browserslist will start, and ascend to the system root until found.
### `ignoreBrowserslistConfig`
`boolean`, defaults to `false`
Toggles whether or not [browserslist config sources](https://github.com/ai/browserslist#queries) are used, which includes searching for any browserslist files or referencing the browserslist key inside package.json. This is useful for projects that use a browserslist config for files that won't be compiled with Babel.
### `shippedProposals`
`boolean`, defaults to `false`
Toggles enabling support for builtin/feature proposals that have shipped in browsers. If your target environments have native support for a feature proposal, its matching parser syntax plugin is enabled instead of performing any transform. Note that this _does not_ enable the same transformations as [`@babel/preset-stage3`](https://babeljs.io/docs/plugins/preset-stage-3/), since proposals can continue to change before landing in browsers.
The following are currently supported:
**Builtins**
- [Promise.prototype.finally](https://github.com/tc39/proposal-promise-finally)
**Features**
- [Asynchronous Iterators](https://github.com/tc39/proposal-async-iteration)
- [Object rest/spread properties](https://github.com/tc39/proposal-object-rest-spread)
- [Optional catch binding](https://github.com/tc39/proposal-optional-catch-binding)
- [Unicode property escapes in regular expressions](https://github.com/tc39/proposal-regexp-unicode-property-escapes)
---
## Examples
### Export with various targets
```js
export class A {}
```
#### Target only Chrome 52
**.babelrc**
```json
{
"presets": [
["@babel/env", {
"targets": {
"chrome": 52
}
}]
]
}
```
**Out**
```js
class A {}
exports.A = A;
```
#### Target Chrome 52 with webpack 2/rollup and loose mode
**.babelrc**
```json
{
"presets": [
["@babel/env", {
"targets": {
"chrome": 52
},
"modules": false,
"loose": true
}]
]
}
```
**Out**
```js
export class A {}
```
#### Target specific browsers via browserslist
**.babelrc**
```json
{
"presets": [
["@babel/env", {
"targets": {
"chrome": 52,
"browsers": ["last 2 versions", "safari 7"]
}
}]
]
}
```
**Out**
```js
export var A = function A() {
_classCallCheck(this, A);
};
```
#### Target latest node via `node: true` or `node: "current"`
**.babelrc**
```json
{
"presets": [
["@babel/env", {
"targets": {
"node": "current"
}
}]
]
}
```
**Out**
```js
class A {}
exports.A = A;
```
### Show debug output
**.babelrc**
```json
{
"presets": [
["@babel/env", {
"targets": {
"safari": 10
},
"modules": false,
"useBuiltIns": "entry",
"debug": true
}]
]
}
```
**stdout**
```sh
Using targets:
{
"safari": 10
}
Modules transform: false
Using plugins:
transform-exponentiation-operator {}
transform-async-to-generator {}
Using polyfills:
es7.object.values {}
es7.object.entries {}
es7.object.get-own-property-descriptors {}
web.timers {}
web.immediate {}
web.dom.iterable {}
```
### Include and exclude specific plugins/built-ins
> always include arrow functions, explicitly exclude generators
```json
{
"presets": [
["@babel/env", {
"targets": {
"browsers": ["last 2 versions", "safari >= 7"]
},
"include": ["@babel/transform-arrow-functions", "es6.map"],
"exclude": ["@babel/transform-regenerator", "es6.set"]
}]
]
}
```
## Issues
If you get a `SyntaxError: Unexpected token ...` error when using the [object-rest-spread](https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-object-rest-spread) transform then make sure the plugin has been updated to, at least, `v6.19.0`.

View File

@@ -1,63 +0,0 @@
{
"name": "@babel/preset-env",
"version": "7.0.0-beta.31",
"description": "A Babel preset for each environment.",
"author": "Henry Zhu <hi@henryzoo.com>",
"homepage": "https://babeljs.io/",
"license": "MIT",
"repository": "https://github.com/babel/babel/tree/master/experimental/babel-preset-env",
"main": "lib/index.js",
"scripts": {
"build-data": "node ./scripts/build-data.js"
},
"dependencies": {
"@babel/plugin-check-constants": "7.0.0-beta.31",
"@babel/plugin-proposal-async-generator-functions": "7.0.0-beta.31",
"@babel/plugin-proposal-object-rest-spread": "7.0.0-beta.31",
"@babel/plugin-proposal-optional-catch-binding": "7.0.0-beta.31",
"@babel/plugin-proposal-unicode-property-regex": "7.0.0-beta.31",
"@babel/plugin-syntax-async-generators": "7.0.0-beta.31",
"@babel/plugin-syntax-object-rest-spread": "7.0.0-beta.31",
"@babel/plugin-syntax-optional-catch-binding": "7.0.0-beta.31",
"@babel/plugin-transform-arrow-functions": "7.0.0-beta.31",
"@babel/plugin-transform-async-to-generator": "7.0.0-beta.31",
"@babel/plugin-transform-block-scoped-functions": "7.0.0-beta.31",
"@babel/plugin-transform-block-scoping": "7.0.0-beta.31",
"@babel/plugin-transform-classes": "7.0.0-beta.31",
"@babel/plugin-transform-computed-properties": "7.0.0-beta.31",
"@babel/plugin-transform-destructuring": "7.0.0-beta.31",
"@babel/plugin-transform-duplicate-keys": "7.0.0-beta.31",
"@babel/plugin-transform-exponentiation-operator": "7.0.0-beta.31",
"@babel/plugin-transform-for-of": "7.0.0-beta.31",
"@babel/plugin-transform-function-name": "7.0.0-beta.31",
"@babel/plugin-transform-literals": "7.0.0-beta.31",
"@babel/plugin-transform-modules-amd": "7.0.0-beta.31",
"@babel/plugin-transform-modules-commonjs": "7.0.0-beta.31",
"@babel/plugin-transform-modules-systemjs": "7.0.0-beta.31",
"@babel/plugin-transform-modules-umd": "7.0.0-beta.31",
"@babel/plugin-transform-new-target": "7.0.0-beta.31",
"@babel/plugin-transform-object-super": "7.0.0-beta.31",
"@babel/plugin-transform-parameters": "7.0.0-beta.31",
"@babel/plugin-transform-regenerator": "7.0.0-beta.31",
"@babel/plugin-transform-shorthand-properties": "7.0.0-beta.31",
"@babel/plugin-transform-spread": "7.0.0-beta.31",
"@babel/plugin-transform-sticky-regex": "7.0.0-beta.31",
"@babel/plugin-transform-template-literals": "7.0.0-beta.31",
"@babel/plugin-transform-typeof-symbol": "7.0.0-beta.31",
"@babel/plugin-transform-unicode-regex": "7.0.0-beta.31",
"browserslist": "^2.4.0",
"invariant": "^2.2.2",
"semver": "^5.3.0"
},
"peerDependencies": {
"@babel/core": "7.0.0-beta.31"
},
"devDependencies": {
"@babel/cli": "7.0.0-beta.31",
"@babel/core": "7.0.0-beta.31",
"@babel/helper-fixtures": "7.0.0-beta.31",
"@babel/helper-plugin-test-runner": "7.0.0-beta.31",
"compat-table": "kangax/compat-table#957f1ff15972e8fb2892a172f985e9af27bf1c75",
"electron-to-chromium": "^1.3.27"
}
}

View File

@@ -1,5 +0,0 @@
{
"rules": {
"prettier/prettier": ["error", { "trailingComma": "es5" }]
}
}

View File

@@ -1,36 +0,0 @@
export default {
"check-constants": require("@babel/plugin-check-constants"),
"syntax-async-generators": require("@babel/plugin-syntax-async-generators"),
"syntax-object-rest-spread": require("@babel/plugin-syntax-object-rest-spread"),
"syntax-optional-catch-binding": require("@babel/plugin-syntax-optional-catch-binding"),
"transform-async-to-generator": require("@babel/plugin-transform-async-to-generator"),
"proposal-async-generator-functions": require("@babel/plugin-proposal-async-generator-functions"),
"transform-arrow-functions": require("@babel/plugin-transform-arrow-functions"),
"transform-block-scoped-functions": require("@babel/plugin-transform-block-scoped-functions"),
"transform-block-scoping": require("@babel/plugin-transform-block-scoping"),
"transform-classes": require("@babel/plugin-transform-classes"),
"transform-computed-properties": require("@babel/plugin-transform-computed-properties"),
"transform-destructuring": require("@babel/plugin-transform-destructuring"),
"transform-duplicate-keys": require("@babel/plugin-transform-duplicate-keys"),
"transform-for-of": require("@babel/plugin-transform-for-of"),
"transform-function-name": require("@babel/plugin-transform-function-name"),
"transform-literals": require("@babel/plugin-transform-literals"),
"transform-modules-amd": require("@babel/plugin-transform-modules-amd"),
"transform-modules-commonjs": require("@babel/plugin-transform-modules-commonjs"),
"transform-modules-systemjs": require("@babel/plugin-transform-modules-systemjs"),
"transform-modules-umd": require("@babel/plugin-transform-modules-umd"),
"transform-object-super": require("@babel/plugin-transform-object-super"),
"transform-parameters": require("@babel/plugin-transform-parameters"),
"transform-shorthand-properties": require("@babel/plugin-transform-shorthand-properties"),
"transform-spread": require("@babel/plugin-transform-spread"),
"transform-sticky-regex": require("@babel/plugin-transform-sticky-regex"),
"transform-template-literals": require("@babel/plugin-transform-template-literals"),
"transform-typeof-symbol": require("@babel/plugin-transform-typeof-symbol"),
"transform-unicode-regex": require("@babel/plugin-transform-unicode-regex"),
"transform-exponentiation-operator": require("@babel/plugin-transform-exponentiation-operator"),
"transform-new-target": require("@babel/plugin-transform-new-target"),
"proposal-object-rest-spread": require("@babel/plugin-proposal-object-rest-spread"),
"proposal-optional-catch-binding": require("@babel/plugin-proposal-optional-catch-binding"),
"transform-regenerator": require("@babel/plugin-transform-regenerator"),
"proposal-unicode-property-regex": require("@babel/plugin-proposal-unicode-property-regex"),
};

View File

@@ -1,75 +0,0 @@
/*eslint quotes: ["error", "double", { "avoidEscape": true }]*/
import semver from "semver";
import { prettifyVersion, semverify } from "./utils";
const wordEnds = size => {
return size > 1 ? "s" : "";
};
export const logMessage = (message, context) => {
const pre = context ? `[${context}] ` : "";
const logStr = ` ${pre}${message}`;
console.log(logStr);
};
export const logPlugin = (plugin, targets, list, context) => {
const envList = list[plugin] || {};
const filteredList = Object.keys(targets).reduce((a, b) => {
if (!envList[b] || semver.lt(targets[b], semverify(envList[b]))) {
a[b] = prettifyVersion(targets[b]);
}
return a;
}, {});
const formattedTargets = JSON.stringify(filteredList)
.replace(/,/g, ", ")
.replace(/^\{"/, '{ "')
.replace(/"\}$/, '" }');
logMessage(`${plugin} ${formattedTargets}`, context);
};
export const logEntryPolyfills = (
importPolyfillIncluded,
polyfills,
filename,
onDebug,
) => {
if (!importPolyfillIncluded) {
console.log(
`
[${filename}] \`import '@babel/polyfill'\` was not found.`,
);
return;
}
if (!polyfills.size) {
console.log(
`
[${filename}] Based on your targets, none were added.`,
);
return;
}
console.log(
`
[${filename}] Replaced \`@babel/polyfill\` with the following polyfill${wordEnds(
polyfills.size,
)}:`,
);
onDebug(polyfills);
};
export const logUsagePolyfills = (polyfills, filename, onDebug) => {
if (!polyfills.size) {
console.log(
`
[${filename}] Based on your code and targets, none were added.`,
);
return;
}
console.log(
`
[${filename}] Added following polyfill${wordEnds(polyfills.size)}:`,
);
onDebug(polyfills);
};

View File

@@ -1,272 +0,0 @@
//@flow
import semver from "semver";
import builtInsList from "../data/built-ins.json";
import { logPlugin } from "./debug";
import { defaultWebIncludes } from "./default-includes";
import moduleTransformations from "./module-transformations";
import normalizeOptions from "./normalize-options.js";
import pluginList from "../data/plugins.json";
import {
builtIns as proposalBuiltIns,
features as proposalPlugins,
pluginSyntaxMap,
} from "../data/shipped-proposals.js";
import useBuiltInsEntryPlugin from "./use-built-ins-entry-plugin";
import addUsedBuiltInsPlugin from "./use-built-ins-plugin";
import getTargets from "./targets-parser";
import availablePlugins from "./available-plugins";
import { filterStageFromList, prettifyTargets, semverify } from "./utils";
import type { Plugin, Targets } from "./types";
const getPlugin = (pluginName: string) => {
const plugin = availablePlugins[pluginName];
if (!plugin) {
throw new Error(
`Could not find plugin "${pluginName}". Ensure there is an entry in ./available-plugins.js for it.`,
);
}
return plugin;
};
const builtInsListWithoutProposals = filterStageFromList(
builtInsList,
proposalBuiltIns,
);
const pluginListWithoutProposals = filterStageFromList(
pluginList,
proposalPlugins,
);
export const isPluginRequired = (
supportedEnvironments: Targets,
plugin: Targets,
): boolean => {
const targetEnvironments: Array<string> = Object.keys(supportedEnvironments);
if (targetEnvironments.length === 0) {
return true;
}
const isRequiredForEnvironments: Array<
string,
> = targetEnvironments.filter(environment => {
// Feature is not implemented in that environment
if (!plugin[environment]) {
return true;
}
const lowestImplementedVersion: string = plugin[environment];
const lowestTargetedVersion: string = supportedEnvironments[environment];
if (!semver.valid(lowestTargetedVersion)) {
throw new Error(
// eslint-disable-next-line max-len
`Invalid version passed for target "${environment}": "${lowestTargetedVersion}". Versions must be in semver format (major.minor.patch)`,
);
}
return semver.gt(
semverify(lowestImplementedVersion),
lowestTargetedVersion,
);
});
return isRequiredForEnvironments.length > 0;
};
let hasBeenLogged = false;
const getBuiltInTargets = targets => {
const builtInTargets = Object.assign({}, targets);
if (builtInTargets.uglify != null) {
delete builtInTargets.uglify;
}
return builtInTargets;
};
export const transformIncludesAndExcludes = (opts: Array<string>): Object => {
return opts.reduce(
(result, opt) => {
const target = opt.match(/^(es\d+|web)\./) ? "builtIns" : "plugins";
result[target].add(opt);
return result;
},
{
all: opts,
plugins: new Set(),
builtIns: new Set(),
},
);
};
const getPlatformSpecificDefaultFor = (targets: Targets): ?Array<string> => {
const targetNames = Object.keys(targets);
const isAnyTarget = !targetNames.length;
const isWebTarget = targetNames.some(name => name !== "node");
return isAnyTarget || isWebTarget ? defaultWebIncludes : null;
};
const filterItems = (
list,
includes,
excludes,
targets,
defaultItems,
): Set<string> => {
const result = new Set();
for (const item in list) {
const excluded = excludes.has(item);
if (!excluded) {
if (isPluginRequired(targets, list[item])) {
result.add(item);
} else {
const shippedProposalsSyntax = pluginSyntaxMap.get(item);
if (shippedProposalsSyntax) {
result.add(shippedProposalsSyntax);
}
}
}
}
if (defaultItems) {
defaultItems.forEach(item => !excludes.has(item) && result.add(item));
}
includes.forEach(item => result.add(item));
return result;
};
export default function buildPreset(
context: Object,
opts: Object = {},
): { plugins: Array<Plugin> } {
const {
configPath,
debug,
exclude: optionsExclude,
forceAllTransforms,
ignoreBrowserslistConfig,
include: optionsInclude,
loose,
modules,
shippedProposals,
spec,
targets: optionsTargets,
useBuiltIns,
} = normalizeOptions(opts);
// TODO: remove this in next major
let hasUglifyTarget = false;
if (optionsTargets && optionsTargets.uglify) {
hasUglifyTarget = true;
delete optionsTargets.uglify;
console.log("");
console.log("The uglify target has been deprecated. Set the top level");
console.log("option `forceAllTransforms: true` instead.");
console.log("");
}
const targets = getTargets(optionsTargets, {
ignoreBrowserslistConfig,
configPath,
});
const include = transformIncludesAndExcludes(optionsInclude);
const exclude = transformIncludesAndExcludes(optionsExclude);
const transformTargets = forceAllTransforms || hasUglifyTarget ? {} : targets;
const transformations = filterItems(
shippedProposals ? pluginList : pluginListWithoutProposals,
include.plugins,
exclude.plugins,
transformTargets,
);
let polyfills;
let polyfillTargets;
if (useBuiltIns) {
polyfillTargets = getBuiltInTargets(targets);
polyfills = filterItems(
shippedProposals ? builtInsList : builtInsListWithoutProposals,
include.builtIns,
exclude.builtIns,
polyfillTargets,
getPlatformSpecificDefaultFor(polyfillTargets),
);
}
const plugins = [];
const pluginUseBuiltIns = useBuiltIns !== false;
// NOTE: not giving spec here yet to avoid compatibility issues when
// transform-modules-commonjs gets its spec mode
if (modules !== false && moduleTransformations[modules]) {
plugins.push([getPlugin(moduleTransformations[modules]), { loose }]);
}
transformations.forEach(pluginName =>
plugins.push([
getPlugin(pluginName),
{ spec, loose, useBuiltIns: pluginUseBuiltIns },
]),
);
const regenerator = transformations.has("transform-regenerator");
if (debug && !hasBeenLogged) {
hasBeenLogged = true;
console.log("@babel/preset-env: `DEBUG` option");
console.log("\nUsing targets:");
console.log(JSON.stringify(prettifyTargets(targets), null, 2));
console.log(`\nUsing modules transform: ${modules.toString()}`);
console.log("\nUsing plugins:");
transformations.forEach(transform => {
logPlugin(transform, targets, pluginList);
});
if (!useBuiltIns) {
console.log(
"\nUsing polyfills: No polyfills were added, since the `useBuiltIns` option was not set.",
);
} else {
console.log(
`
Using polyfills with \`${useBuiltIns}\` option:`,
);
}
}
if (useBuiltIns === "usage" || useBuiltIns === "entry") {
const pluginOptions = {
debug,
polyfills,
regenerator,
onDebug: (polyfills, context) => {
polyfills.forEach(polyfill =>
logPlugin(polyfill, polyfillTargets, builtInsList, context),
);
},
};
plugins.push([
useBuiltIns === "usage" ? addUsedBuiltInsPlugin : useBuiltInsEntryPlugin,
pluginOptions,
]);
}
return {
plugins,
};
}

View File

@@ -1,126 +0,0 @@
//@flow
import { logEntryPolyfills } from "./debug";
type Plugin = {
visitor: Object,
pre: Function,
post: Function,
name: string,
};
type RequireType = "require" | "import";
function isPolyfillSource(value: string): boolean {
return value === "@babel/polyfill";
}
export default function({ types: t }: { types: Object }): Plugin {
function createImportDeclaration(polyfill: string): Object {
const declar = t.importDeclaration([], t.stringLiteral(polyfill));
declar._blockHoist = 3;
return declar;
}
function createRequireStatement(polyfill: string): Object {
return t.expressionStatement(
t.callExpression(t.identifier("require"), [t.stringLiteral(polyfill)]),
);
}
function isRequire(path: Object): boolean {
return (
t.isExpressionStatement(path.node) &&
t.isCallExpression(path.node.expression) &&
t.isIdentifier(path.node.expression.callee) &&
path.node.expression.callee.name === "require" &&
path.node.expression.arguments.length === 1 &&
t.isStringLiteral(path.node.expression.arguments[0]) &&
isPolyfillSource(path.node.expression.arguments[0].value)
);
}
function createImport(
polyfill: string,
requireType: RequireType,
core: ?boolean,
): Object {
if (core) {
polyfill = `@babel/polyfill/lib/core-js/modules/${polyfill}`;
}
if (requireType === "import") {
return createImportDeclaration(polyfill);
}
return createRequireStatement(polyfill);
}
function createImports(
polyfills: Array<string>,
requireType: RequireType,
regenerator: boolean,
): Array<Object> {
const items = Array.isArray(polyfills) ? new Set(polyfills) : polyfills;
const imports = [];
items.forEach(p => imports.push(createImport(p, requireType, true)));
if (regenerator) {
imports.push(
createImport(
"@babel/polyfill/lib/regenerator-runtime/runtime",
requireType,
),
);
}
return imports;
}
const isPolyfillImport = {
ImportDeclaration(path, state) {
if (
path.node.specifiers.length === 0 &&
isPolyfillSource(path.node.source.value)
) {
this.importPolyfillIncluded = true;
path.replaceWithMultiple(
createImports(state.opts.polyfills, "import", state.opts.regenerator),
);
}
},
Program(path, state) {
path.get("body").forEach(bodyPath => {
if (isRequire(bodyPath)) {
bodyPath.replaceWithMultiple(
createImports(
state.opts.polyfills,
"require",
state.opts.regenerator,
),
);
}
});
},
};
return {
name: "transform-polyfill-require",
visitor: isPolyfillImport,
pre() {
this.numPolyfillImports = 0;
this.importPolyfillIncluded = false;
},
post() {
const { debug, onDebug, polyfills } = this.opts;
if (debug) {
logEntryPolyfills(
this.importPolyfillIncluded,
polyfills,
this.file.opts.filename,
onDebug,
);
}
},
};
}

View File

@@ -1,63 +0,0 @@
// @flow
import semver from "semver";
import type { Targets } from "./types";
// Convert version to a semver value.
// 2.5 -> 2.5.0; 1 -> 1.0.0;
export const semverify = (version: string | number): string => {
if (typeof version === "string" && semver.valid(version)) {
return version;
}
const split = version.toString().split(".");
while (split.length < 3) {
split.push("0");
}
return split.join(".");
};
export const prettifyVersion = (version: string): string => {
if (typeof version !== "string") {
return version;
}
const parts = [semver.major(version)];
const minor = semver.minor(version);
const patch = semver.patch(version);
if (minor || patch) {
parts.push(minor);
}
if (patch) {
parts.push(patch);
}
return parts.join(".");
};
export const prettifyTargets = (targets: Targets): Object => {
return Object.keys(targets).reduce((results, target) => {
let value = targets[target];
if (typeof value === "string") {
value = prettifyVersion(value);
}
results[target] = value;
return results;
}, {});
};
export const filterStageFromList = (list: any, stageList: any) => {
return Object.keys(list).reduce((result, item) => {
if (!stageList[item]) {
result[item] = list[item];
}
return result;
}, {});
};

View File

@@ -1,8 +0,0 @@
{
"env": {
"mocha": true
},
"rules": {
"max-len": 0
}
}

View File

@@ -1,135 +0,0 @@
@babel/preset-env: `DEBUG` option
Using targets:
{
"android": "4"
}
Using modules transform: commonjs
Using plugins:
check-constants { "android":"4" }
transform-arrow-functions { "android":"4" }
transform-block-scoped-functions { "android":"4" }
transform-block-scoping { "android":"4" }
transform-classes { "android":"4" }
transform-computed-properties { "android":"4" }
transform-destructuring { "android":"4" }
transform-duplicate-keys { "android":"4" }
transform-for-of { "android":"4" }
transform-function-name { "android":"4" }
transform-literals { "android":"4" }
transform-object-super { "android":"4" }
transform-parameters { "android":"4" }
transform-shorthand-properties { "android":"4" }
transform-spread { "android":"4" }
transform-sticky-regex { "android":"4" }
transform-template-literals { "android":"4" }
transform-typeof-symbol { "android":"4" }
transform-unicode-regex { "android":"4" }
transform-new-target { "android":"4" }
transform-regenerator { "android":"4" }
transform-exponentiation-operator { "android":"4" }
transform-async-to-generator { "android":"4" }
Using polyfills with `entry` option:
[src/in.js] Replaced `@babel/polyfill` with the following polyfills:
es6.typed.array-buffer { "android":"4" }
es6.typed.int8-array { "android":"4" }
es6.typed.uint8-array { "android":"4" }
es6.typed.uint8-clamped-array { "android":"4" }
es6.typed.int16-array { "android":"4" }
es6.typed.uint16-array { "android":"4" }
es6.typed.int32-array { "android":"4" }
es6.typed.uint32-array { "android":"4" }
es6.typed.float32-array { "android":"4" }
es6.typed.float64-array { "android":"4" }
es6.map { "android":"4" }
es6.set { "android":"4" }
es6.weak-map { "android":"4" }
es6.weak-set { "android":"4" }
es6.reflect.apply { "android":"4" }
es6.reflect.construct { "android":"4" }
es6.reflect.define-property { "android":"4" }
es6.reflect.delete-property { "android":"4" }
es6.reflect.get { "android":"4" }
es6.reflect.get-own-property-descriptor { "android":"4" }
es6.reflect.get-prototype-of { "android":"4" }
es6.reflect.has { "android":"4" }
es6.reflect.is-extensible { "android":"4" }
es6.reflect.own-keys { "android":"4" }
es6.reflect.prevent-extensions { "android":"4" }
es6.reflect.set { "android":"4" }
es6.reflect.set-prototype-of { "android":"4" }
es6.promise { "android":"4" }
es6.symbol { "android":"4" }
es6.object.freeze { "android":"4" }
es6.object.seal { "android":"4" }
es6.object.prevent-extensions { "android":"4" }
es6.object.is-frozen { "android":"4" }
es6.object.is-sealed { "android":"4" }
es6.object.is-extensible { "android":"4" }
es6.object.get-own-property-descriptor { "android":"4" }
es6.object.get-prototype-of { "android":"4" }
es6.object.keys { "android":"4" }
es6.object.get-own-property-names { "android":"4" }
es6.object.assign { "android":"4" }
es6.object.is { "android":"4" }
es6.object.set-prototype-of { "android":"4" }
es6.function.name { "android":"4" }
es6.string.raw { "android":"4" }
es6.string.from-code-point { "android":"4" }
es6.string.code-point-at { "android":"4" }
es6.string.repeat { "android":"4" }
es6.string.starts-with { "android":"4" }
es6.string.ends-with { "android":"4" }
es6.string.includes { "android":"4" }
es6.regexp.flags { "android":"4" }
es6.regexp.match { "android":"4" }
es6.regexp.replace { "android":"4" }
es6.regexp.split { "android":"4" }
es6.regexp.search { "android":"4" }
es6.array.from { "android":"4" }
es6.array.of { "android":"4" }
es6.array.copy-within { "android":"4" }
es6.array.find { "android":"4" }
es6.array.find-index { "android":"4" }
es6.array.fill { "android":"4" }
es6.array.iterator { "android":"4" }
es6.number.is-finite { "android":"4" }
es6.number.is-integer { "android":"4" }
es6.number.is-safe-integer { "android":"4" }
es6.number.is-nan { "android":"4" }
es6.number.epsilon { "android":"4" }
es6.number.min-safe-integer { "android":"4" }
es6.number.max-safe-integer { "android":"4" }
es6.number.parse-float { "android":"4" }
es6.number.parse-int { "android":"4" }
es6.math.acosh { "android":"4" }
es6.math.asinh { "android":"4" }
es6.math.atanh { "android":"4" }
es6.math.cbrt { "android":"4" }
es6.math.clz32 { "android":"4" }
es6.math.cosh { "android":"4" }
es6.math.expm1 { "android":"4" }
es6.math.fround { "android":"4" }
es6.math.hypot { "android":"4" }
es6.math.imul { "android":"4" }
es6.math.log1p { "android":"4" }
es6.math.log10 { "android":"4" }
es6.math.log2 { "android":"4" }
es6.math.sign { "android":"4" }
es6.math.sinh { "android":"4" }
es6.math.tanh { "android":"4" }
es6.math.trunc { "android":"4" }
es7.array.includes { "android":"4" }
es7.object.values { "android":"4" }
es7.object.entries { "android":"4" }
es7.object.get-own-property-descriptors { "android":"4" }
es7.string.pad-start { "android":"4" }
es7.string.pad-end { "android":"4" }
web.timers { "android":"4" }
web.immediate { "android":"4" }
web.dom.iterable { "android":"4" }
src/in.js -> lib/in.js

View File

@@ -1,20 +0,0 @@
@babel/preset-env: `DEBUG` option
Using targets:
{
"node": "6"
}
Using modules transform: commonjs
Using plugins:
transform-destructuring { "node":"6" }
transform-for-of { "node":"6" }
transform-function-name { "node":"6" }
transform-exponentiation-operator { "node":"6" }
transform-async-to-generator { "node":"6" }
Using polyfills with `entry` option:
[src/in.js] `import '@babel/polyfill'` was not found.
src/in.js -> lib/in.js

View File

@@ -1,46 +0,0 @@
The uglify target has been deprecated. Set the top level
option `forceAllTransforms: true` instead.
@babel/preset-env: `DEBUG` option
Using targets:
{
"chrome": "55"
}
Using modules transform: false
Using plugins:
check-constants {}
transform-arrow-functions {}
transform-block-scoped-functions {}
transform-block-scoping {}
transform-classes {}
transform-computed-properties {}
transform-destructuring {}
transform-duplicate-keys {}
transform-for-of {}
transform-function-name {}
transform-literals {}
transform-object-super {}
transform-parameters {}
transform-shorthand-properties {}
transform-spread {}
transform-sticky-regex {}
transform-template-literals {}
transform-typeof-symbol {}
transform-unicode-regex {}
transform-new-target {}
transform-regenerator {}
transform-exponentiation-operator {}
transform-async-to-generator {}
Using polyfills with `entry` option:
[src/in.js] Replaced `@babel/polyfill` with the following polyfills:
es7.string.pad-start { "chrome":"55" }
es7.string.pad-end { "chrome":"55" }
web.timers { "chrome":"55" }
web.immediate { "chrome":"55" }
web.dom.iterable { "chrome":"55" }
src/in.js -> lib/in.js

View File

@@ -1,137 +0,0 @@
@babel/preset-env: `DEBUG` option
Using targets:
{
"chrome": "54",
"ie": "10",
"node": "6"
}
Using modules transform: commonjs
Using plugins:
check-constants { "ie":"10" }
transform-arrow-functions { "ie":"10" }
transform-block-scoped-functions { "ie":"10" }
transform-block-scoping { "ie":"10" }
transform-classes { "ie":"10" }
transform-computed-properties { "ie":"10" }
transform-destructuring { "ie":"10", "node":"6" }
transform-duplicate-keys { "ie":"10" }
transform-for-of { "ie":"10", "node":"6" }
transform-function-name { "ie":"10", "node":"6" }
transform-literals { "ie":"10" }
transform-object-super { "ie":"10" }
transform-parameters { "ie":"10" }
transform-shorthand-properties { "ie":"10" }
transform-spread { "ie":"10" }
transform-sticky-regex { "ie":"10" }
transform-template-literals { "ie":"10" }
transform-typeof-symbol { "ie":"10" }
transform-unicode-regex { "ie":"10" }
transform-new-target { "ie":"10" }
transform-regenerator { "ie":"10" }
transform-exponentiation-operator { "ie":"10", "node":"6" }
transform-async-to-generator { "chrome":"54", "ie":"10", "node":"6" }
Using polyfills with `entry` option:
[src/in.js] Replaced `@babel/polyfill` with the following polyfills:
es6.typed.array-buffer { "ie":"10", "node":"6" }
es6.typed.int8-array { "ie":"10", "node":"6" }
es6.typed.uint8-array { "ie":"10", "node":"6" }
es6.typed.uint8-clamped-array { "ie":"10", "node":"6" }
es6.typed.int16-array { "ie":"10", "node":"6" }
es6.typed.uint16-array { "ie":"10", "node":"6" }
es6.typed.int32-array { "ie":"10", "node":"6" }
es6.typed.uint32-array { "ie":"10", "node":"6" }
es6.typed.float32-array { "ie":"10", "node":"6" }
es6.typed.float64-array { "ie":"10", "node":"6" }
es6.map { "ie":"10", "node":"6" }
es6.set { "ie":"10", "node":"6" }
es6.weak-map { "ie":"10", "node":"6" }
es6.weak-set { "ie":"10", "node":"6" }
es6.reflect.apply { "ie":"10" }
es6.reflect.construct { "ie":"10" }
es6.reflect.define-property { "ie":"10" }
es6.reflect.delete-property { "ie":"10" }
es6.reflect.get { "ie":"10" }
es6.reflect.get-own-property-descriptor { "ie":"10" }
es6.reflect.get-prototype-of { "ie":"10" }
es6.reflect.has { "ie":"10" }
es6.reflect.is-extensible { "ie":"10" }
es6.reflect.own-keys { "ie":"10" }
es6.reflect.prevent-extensions { "ie":"10" }
es6.reflect.set { "ie":"10" }
es6.reflect.set-prototype-of { "ie":"10" }
es6.promise { "ie":"10", "node":"6" }
es6.symbol { "ie":"10", "node":"6" }
es6.object.freeze { "ie":"10" }
es6.object.seal { "ie":"10" }
es6.object.prevent-extensions { "ie":"10" }
es6.object.is-frozen { "ie":"10" }
es6.object.is-sealed { "ie":"10" }
es6.object.is-extensible { "ie":"10" }
es6.object.get-own-property-descriptor { "ie":"10" }
es6.object.get-prototype-of { "ie":"10" }
es6.object.keys { "ie":"10" }
es6.object.get-own-property-names { "ie":"10" }
es6.object.assign { "ie":"10" }
es6.object.is { "ie":"10" }
es6.object.set-prototype-of { "ie":"10" }
es6.function.name { "ie":"10", "node":"6" }
es6.string.raw { "ie":"10" }
es6.string.from-code-point { "ie":"10" }
es6.string.code-point-at { "ie":"10" }
es6.string.repeat { "ie":"10" }
es6.string.starts-with { "ie":"10" }
es6.string.ends-with { "ie":"10" }
es6.string.includes { "ie":"10" }
es6.regexp.flags { "ie":"10" }
es6.regexp.match { "ie":"10" }
es6.regexp.replace { "ie":"10" }
es6.regexp.split { "ie":"10" }
es6.regexp.search { "ie":"10" }
es6.array.from { "ie":"10", "node":"6" }
es6.array.of { "ie":"10" }
es6.array.copy-within { "ie":"10" }
es6.array.find { "ie":"10" }
es6.array.find-index { "ie":"10" }
es6.array.fill { "ie":"10" }
es6.array.iterator { "ie":"10" }
es6.number.is-finite { "ie":"10" }
es6.number.is-integer { "ie":"10" }
es6.number.is-safe-integer { "ie":"10" }
es6.number.is-nan { "ie":"10" }
es6.number.epsilon { "ie":"10" }
es6.number.min-safe-integer { "ie":"10" }
es6.number.max-safe-integer { "ie":"10" }
es6.number.parse-float { "ie":"10" }
es6.number.parse-int { "ie":"10" }
es6.math.acosh { "ie":"10" }
es6.math.asinh { "ie":"10" }
es6.math.atanh { "ie":"10" }
es6.math.cbrt { "ie":"10" }
es6.math.clz32 { "ie":"10" }
es6.math.cosh { "ie":"10" }
es6.math.expm1 { "ie":"10" }
es6.math.fround { "ie":"10" }
es6.math.hypot { "ie":"10" }
es6.math.imul { "ie":"10" }
es6.math.log1p { "ie":"10" }
es6.math.log10 { "ie":"10" }
es6.math.log2 { "ie":"10" }
es6.math.sign { "ie":"10" }
es6.math.sinh { "ie":"10" }
es6.math.tanh { "ie":"10" }
es6.math.trunc { "ie":"10" }
es7.array.includes { "ie":"10" }
es7.object.values { "ie":"10", "node":"6" }
es7.object.entries { "ie":"10", "node":"6" }
es7.object.get-own-property-descriptors { "ie":"10", "node":"6" }
es7.string.pad-start { "chrome":"54", "ie":"10", "node":"6" }
es7.string.pad-end { "chrome":"54", "ie":"10", "node":"6" }
web.timers { "chrome":"54", "ie":"10", "node":"6" }
web.immediate { "chrome":"54", "ie":"10", "node":"6" }
web.dom.iterable { "chrome":"54", "ie":"10", "node":"6" }
src/in.js -> lib/in.js

View File

@@ -1,78 +0,0 @@
Warning, the following targets are using a decimal version:
electron: 0.36
We recommend using a string for minor/patch versions to avoid numbers like 6.10
getting parsed as 6.1, which can lead to unexpected behavior.
@babel/preset-env: `DEBUG` option
Using targets:
{
"electron": "0.36"
}
Using modules transform: commonjs
Using plugins:
check-constants { "electron":"0.36" }
transform-block-scoping { "electron":"0.36" }
transform-destructuring { "electron":"0.36" }
transform-for-of { "electron":"0.36" }
transform-function-name { "electron":"0.36" }
transform-parameters { "electron":"0.36" }
transform-sticky-regex { "electron":"0.36" }
transform-unicode-regex { "electron":"0.36" }
transform-regenerator { "electron":"0.36" }
transform-exponentiation-operator { "electron":"0.36" }
transform-async-to-generator { "electron":"0.36" }
Using polyfills with `entry` option:
[src/in.js] Replaced `@babel/polyfill` with the following polyfills:
es6.typed.array-buffer { "electron":"0.36" }
es6.typed.data-view { "electron":"0.36" }
es6.typed.int8-array { "electron":"0.36" }
es6.typed.uint8-array { "electron":"0.36" }
es6.typed.uint8-clamped-array { "electron":"0.36" }
es6.typed.int16-array { "electron":"0.36" }
es6.typed.uint16-array { "electron":"0.36" }
es6.typed.int32-array { "electron":"0.36" }
es6.typed.uint32-array { "electron":"0.36" }
es6.typed.float32-array { "electron":"0.36" }
es6.typed.float64-array { "electron":"0.36" }
es6.map { "electron":"0.36" }
es6.set { "electron":"0.36" }
es6.weak-map { "electron":"0.36" }
es6.weak-set { "electron":"0.36" }
es6.reflect.apply { "electron":"0.36" }
es6.reflect.construct { "electron":"0.36" }
es6.reflect.define-property { "electron":"0.36" }
es6.reflect.delete-property { "electron":"0.36" }
es6.reflect.get { "electron":"0.36" }
es6.reflect.get-own-property-descriptor { "electron":"0.36" }
es6.reflect.get-prototype-of { "electron":"0.36" }
es6.reflect.has { "electron":"0.36" }
es6.reflect.is-extensible { "electron":"0.36" }
es6.reflect.own-keys { "electron":"0.36" }
es6.reflect.prevent-extensions { "electron":"0.36" }
es6.reflect.set { "electron":"0.36" }
es6.reflect.set-prototype-of { "electron":"0.36" }
es6.promise { "electron":"0.36" }
es6.symbol { "electron":"0.36" }
es6.function.name { "electron":"0.36" }
es6.regexp.flags { "electron":"0.36" }
es6.regexp.match { "electron":"0.36" }
es6.regexp.replace { "electron":"0.36" }
es6.regexp.split { "electron":"0.36" }
es6.regexp.search { "electron":"0.36" }
es6.array.from { "electron":"0.36" }
es7.object.values { "electron":"0.36" }
es7.object.entries { "electron":"0.36" }
es7.object.get-own-property-descriptors { "electron":"0.36" }
es7.string.pad-start { "electron":"0.36" }
es7.string.pad-end { "electron":"0.36" }
web.timers { "electron":"0.36" }
web.immediate { "electron":"0.36" }
web.dom.iterable { "electron":"0.36" }
src/in.js -> lib/in.js

View File

@@ -1,43 +0,0 @@
@babel/preset-env: `DEBUG` option
Using targets:
{
"chrome": "55"
}
Using modules transform: false
Using plugins:
check-constants {}
transform-arrow-functions {}
transform-block-scoped-functions {}
transform-block-scoping {}
transform-classes {}
transform-computed-properties {}
transform-destructuring {}
transform-duplicate-keys {}
transform-for-of {}
transform-function-name {}
transform-literals {}
transform-object-super {}
transform-parameters {}
transform-shorthand-properties {}
transform-spread {}
transform-sticky-regex {}
transform-template-literals {}
transform-typeof-symbol {}
transform-unicode-regex {}
transform-new-target {}
transform-regenerator {}
transform-exponentiation-operator {}
transform-async-to-generator {}
Using polyfills with `entry` option:
[src/in.js] Replaced `@babel/polyfill` with the following polyfills:
es7.string.pad-start { "chrome":"55" }
es7.string.pad-end { "chrome":"55" }
web.timers { "chrome":"55" }
web.immediate { "chrome":"55" }
web.dom.iterable { "chrome":"55" }
src/in.js -> lib/in.js

View File

@@ -1,25 +0,0 @@
Warning, the following targets are using a decimal version:
node: 7.4
We recommend using a string for minor/patch versions to avoid numbers like 6.10
getting parsed as 6.1, which can lead to unexpected behavior.
@babel/preset-env: `DEBUG` option
Using targets:
{
"firefox": "52",
"node": "7.4"
}
Using modules transform: commonjs
Using plugins:
transform-destructuring { "firefox":"52" }
transform-for-of { "firefox":"52" }
transform-function-name { "firefox":"52" }
transform-literals { "firefox":"52" }
Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set.
src/in.js -> lib/in.js

View File

@@ -1,23 +0,0 @@
@babel/preset-env: `DEBUG` option
Using targets:
{
"chrome": "60"
}
Using modules transform: commonjs
Using plugins:
proposal-async-generator-functions { "chrome":"60" }
syntax-object-rest-spread { "chrome":"60" }
proposal-optional-catch-binding { "chrome":"60" }
proposal-unicode-property-regex { "chrome":"60" }
Using polyfills with `entry` option:
[src/in.js] Replaced `@babel/polyfill` with the following polyfills:
es7.promise.finally { "chrome":"60" }
web.timers { "chrome":"60" }
web.immediate { "chrome":"60" }
web.dom.iterable { "chrome":"60" }
src/in.js -> lib/in.js

View File

@@ -1,139 +0,0 @@
@babel/preset-env: `DEBUG` option
Using targets:
{}
Using modules transform: commonjs
Using plugins:
check-constants {}
transform-arrow-functions {}
transform-block-scoped-functions {}
transform-block-scoping {}
transform-classes {}
transform-computed-properties {}
transform-destructuring {}
transform-duplicate-keys {}
transform-for-of {}
transform-function-name {}
transform-literals {}
transform-object-super {}
transform-parameters {}
transform-shorthand-properties {}
transform-spread {}
transform-sticky-regex {}
transform-template-literals {}
transform-typeof-symbol {}
transform-unicode-regex {}
transform-new-target {}
transform-regenerator {}
transform-exponentiation-operator {}
transform-async-to-generator {}
proposal-async-generator-functions {}
proposal-object-rest-spread {}
proposal-optional-catch-binding {}
proposal-unicode-property-regex {}
Using polyfills with `entry` option:
[src/in.js] Replaced `@babel/polyfill` with the following polyfills:
es6.typed.array-buffer {}
es6.typed.data-view {}
es6.typed.int8-array {}
es6.typed.uint8-array {}
es6.typed.uint8-clamped-array {}
es6.typed.int16-array {}
es6.typed.uint16-array {}
es6.typed.int32-array {}
es6.typed.uint32-array {}
es6.typed.float32-array {}
es6.typed.float64-array {}
es6.map {}
es6.set {}
es6.weak-map {}
es6.weak-set {}
es6.reflect.apply {}
es6.reflect.construct {}
es6.reflect.define-property {}
es6.reflect.delete-property {}
es6.reflect.get {}
es6.reflect.get-own-property-descriptor {}
es6.reflect.get-prototype-of {}
es6.reflect.has {}
es6.reflect.is-extensible {}
es6.reflect.own-keys {}
es6.reflect.prevent-extensions {}
es6.reflect.set {}
es6.reflect.set-prototype-of {}
es6.promise {}
es6.symbol {}
es6.object.freeze {}
es6.object.seal {}
es6.object.prevent-extensions {}
es6.object.is-frozen {}
es6.object.is-sealed {}
es6.object.is-extensible {}
es6.object.get-own-property-descriptor {}
es6.object.get-prototype-of {}
es6.object.keys {}
es6.object.get-own-property-names {}
es6.object.assign {}
es6.object.is {}
es6.object.set-prototype-of {}
es6.function.name {}
es6.string.raw {}
es6.string.from-code-point {}
es6.string.code-point-at {}
es6.string.repeat {}
es6.string.starts-with {}
es6.string.ends-with {}
es6.string.includes {}
es6.regexp.flags {}
es6.regexp.match {}
es6.regexp.replace {}
es6.regexp.split {}
es6.regexp.search {}
es6.array.from {}
es6.array.of {}
es6.array.copy-within {}
es6.array.find {}
es6.array.find-index {}
es6.array.fill {}
es6.array.iterator {}
es6.number.is-finite {}
es6.number.is-integer {}
es6.number.is-safe-integer {}
es6.number.is-nan {}
es6.number.epsilon {}
es6.number.min-safe-integer {}
es6.number.max-safe-integer {}
es6.number.parse-float {}
es6.number.parse-int {}
es6.math.acosh {}
es6.math.asinh {}
es6.math.atanh {}
es6.math.cbrt {}
es6.math.clz32 {}
es6.math.cosh {}
es6.math.expm1 {}
es6.math.fround {}
es6.math.hypot {}
es6.math.imul {}
es6.math.log1p {}
es6.math.log10 {}
es6.math.log2 {}
es6.math.sign {}
es6.math.sinh {}
es6.math.tanh {}
es6.math.trunc {}
es7.array.includes {}
es7.object.values {}
es7.object.entries {}
es7.object.get-own-property-descriptors {}
es7.string.pad-start {}
es7.string.pad-end {}
es7.promise.finally {}
web.timers {}
web.immediate {}
web.dom.iterable {}
src/in.js -> lib/in.js

View File

@@ -1,140 +0,0 @@
@babel/preset-env: `DEBUG` option
Using targets:
{
"chrome": "54",
"edge": "13",
"firefox": "49",
"ie": "10",
"ios": "9",
"safari": "7"
}
Using modules transform: commonjs
Using plugins:
check-constants { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
transform-arrow-functions { "ie":"10", "ios":"9", "safari":"7" }
transform-block-scoped-functions { "ie":"10", "ios":"9", "safari":"7" }
transform-block-scoping { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
transform-classes { "ie":"10", "ios":"9", "safari":"7" }
transform-computed-properties { "ie":"10", "safari":"7" }
transform-destructuring { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
transform-duplicate-keys { "ie":"10", "safari":"7" }
transform-for-of { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
transform-function-name { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
transform-literals { "firefox":"49", "ie":"10", "safari":"7" }
transform-object-super { "ie":"10", "ios":"9", "safari":"7" }
transform-parameters { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
transform-shorthand-properties { "ie":"10", "safari":"7" }
transform-spread { "ie":"10", "ios":"9", "safari":"7" }
transform-sticky-regex { "ie":"10", "ios":"9", "safari":"7" }
transform-template-literals { "ie":"10", "safari":"7" }
transform-typeof-symbol { "ie":"10", "safari":"7" }
transform-unicode-regex { "ie":"10", "ios":"9", "safari":"7" }
transform-new-target { "edge":"13", "ie":"10", "ios":"9", "safari":"7" }
transform-regenerator { "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
transform-exponentiation-operator { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
transform-async-to-generator { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
Using polyfills with `entry` option:
[src/in.js] Replaced `@babel/polyfill` with the following polyfills:
es6.typed.array-buffer { "ie":"10", "ios":"9", "safari":"7" }
es6.typed.int8-array { "ie":"10", "ios":"9", "safari":"7" }
es6.typed.uint8-array { "ie":"10", "ios":"9", "safari":"7" }
es6.typed.uint8-clamped-array { "ie":"10", "ios":"9", "safari":"7" }
es6.typed.int16-array { "ie":"10", "ios":"9", "safari":"7" }
es6.typed.uint16-array { "ie":"10", "ios":"9", "safari":"7" }
es6.typed.int32-array { "ie":"10", "ios":"9", "safari":"7" }
es6.typed.uint32-array { "ie":"10", "ios":"9", "safari":"7" }
es6.typed.float32-array { "ie":"10", "ios":"9", "safari":"7" }
es6.typed.float64-array { "ie":"10", "ios":"9", "safari":"7" }
es6.map { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
es6.set { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
es6.weak-map { "edge":"13", "firefox":"49", "ie":"10", "safari":"7" }
es6.weak-set { "edge":"13", "firefox":"49", "ie":"10", "safari":"7" }
es6.reflect.apply { "ie":"10", "ios":"9", "safari":"7" }
es6.reflect.construct { "ie":"10", "ios":"9", "safari":"7" }
es6.reflect.define-property { "ie":"10", "ios":"9", "safari":"7" }
es6.reflect.delete-property { "ie":"10", "ios":"9", "safari":"7" }
es6.reflect.get { "ie":"10", "ios":"9", "safari":"7" }
es6.reflect.get-own-property-descriptor { "ie":"10", "ios":"9", "safari":"7" }
es6.reflect.get-prototype-of { "ie":"10", "ios":"9", "safari":"7" }
es6.reflect.has { "ie":"10", "ios":"9", "safari":"7" }
es6.reflect.is-extensible { "ie":"10", "ios":"9", "safari":"7" }
es6.reflect.own-keys { "ie":"10", "ios":"9", "safari":"7" }
es6.reflect.prevent-extensions { "ie":"10", "ios":"9", "safari":"7" }
es6.reflect.set { "ie":"10", "ios":"9", "safari":"7" }
es6.reflect.set-prototype-of { "ie":"10", "ios":"9", "safari":"7" }
es6.promise { "ie":"10", "ios":"9", "safari":"7" }
es6.symbol { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
es6.object.freeze { "ie":"10", "safari":"7" }
es6.object.seal { "ie":"10", "safari":"7" }
es6.object.prevent-extensions { "ie":"10", "safari":"7" }
es6.object.is-frozen { "ie":"10", "safari":"7" }
es6.object.is-sealed { "ie":"10", "safari":"7" }
es6.object.is-extensible { "ie":"10", "safari":"7" }
es6.object.get-own-property-descriptor { "ie":"10", "safari":"7" }
es6.object.get-prototype-of { "ie":"10", "safari":"7" }
es6.object.keys { "ie":"10", "safari":"7" }
es6.object.get-own-property-names { "ie":"10", "safari":"7" }
es6.object.assign { "ie":"10", "safari":"7" }
es6.object.is { "ie":"10", "safari":"7" }
es6.object.set-prototype-of { "ie":"10", "safari":"7" }
es6.function.name { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
es6.string.raw { "ie":"10", "safari":"7" }
es6.string.from-code-point { "ie":"10", "safari":"7" }
es6.string.code-point-at { "ie":"10", "safari":"7" }
es6.string.repeat { "ie":"10", "safari":"7" }
es6.string.starts-with { "ie":"10", "safari":"7" }
es6.string.ends-with { "ie":"10", "safari":"7" }
es6.string.includes { "ie":"10", "safari":"7" }
es6.regexp.flags { "edge":"13", "ie":"10", "safari":"7" }
es6.regexp.match { "edge":"13", "ie":"10", "ios":"9", "safari":"7" }
es6.regexp.replace { "edge":"13", "ie":"10", "ios":"9", "safari":"7" }
es6.regexp.split { "edge":"13", "ie":"10", "ios":"9", "safari":"7" }
es6.regexp.search { "edge":"13", "ie":"10", "ios":"9", "safari":"7" }
es6.array.from { "edge":"13", "ie":"10", "ios":"9", "safari":"7" }
es6.array.of { "ie":"10", "safari":"7" }
es6.array.copy-within { "ie":"10", "safari":"7" }
es6.array.find { "ie":"10", "safari":"7" }
es6.array.find-index { "ie":"10", "safari":"7" }
es6.array.fill { "ie":"10", "safari":"7" }
es6.array.iterator { "ie":"10", "safari":"7" }
es6.number.is-finite { "ie":"10", "safari":"7" }
es6.number.is-integer { "ie":"10", "safari":"7" }
es6.number.is-safe-integer { "ie":"10", "safari":"7" }
es6.number.is-nan { "ie":"10", "safari":"7" }
es6.number.epsilon { "ie":"10", "safari":"7" }
es6.number.min-safe-integer { "ie":"10", "safari":"7" }
es6.number.max-safe-integer { "ie":"10", "safari":"7" }
es6.number.parse-float { "ie":"10", "safari":"7" }
es6.number.parse-int { "ie":"10", "safari":"7" }
es6.math.acosh { "ie":"10", "safari":"7" }
es6.math.asinh { "ie":"10", "safari":"7" }
es6.math.atanh { "ie":"10", "safari":"7" }
es6.math.cbrt { "ie":"10", "safari":"7" }
es6.math.clz32 { "ie":"10", "safari":"7" }
es6.math.cosh { "ie":"10", "safari":"7" }
es6.math.expm1 { "ie":"10", "safari":"7" }
es6.math.fround { "ie":"10", "safari":"7" }
es6.math.hypot { "ie":"10", "safari":"7" }
es6.math.imul { "ie":"10" }
es6.math.log1p { "ie":"10", "safari":"7" }
es6.math.log10 { "ie":"10", "safari":"7" }
es6.math.log2 { "ie":"10", "safari":"7" }
es6.math.sign { "ie":"10", "safari":"7" }
es6.math.sinh { "ie":"10", "safari":"7" }
es6.math.tanh { "ie":"10", "safari":"7" }
es6.math.trunc { "ie":"10", "safari":"7" }
es7.array.includes { "edge":"13", "ie":"10", "ios":"9", "safari":"7" }
es7.object.values { "edge":"13", "ie":"10", "ios":"9", "safari":"7" }
es7.object.entries { "edge":"13", "ie":"10", "ios":"9", "safari":"7" }
es7.object.get-own-property-descriptors { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
es7.string.pad-start { "chrome":"54", "edge":"13", "ie":"10", "ios":"9", "safari":"7" }
es7.string.pad-end { "chrome":"54", "edge":"13", "ie":"10", "ios":"9", "safari":"7" }
web.timers { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
web.immediate { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
web.dom.iterable { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
src/in.js -> lib/in.js

View File

@@ -1,42 +0,0 @@
@babel/preset-env: `DEBUG` option
Using targets:
{
"chrome": "52",
"firefox": "50",
"ie": "11"
}
Using modules transform: commonjs
Using plugins:
check-constants { "firefox":"50", "ie":"11" }
transform-arrow-functions { "ie":"11" }
transform-block-scoping { "firefox":"50", "ie":"11" }
transform-classes { "ie":"11" }
transform-computed-properties { "ie":"11" }
transform-destructuring { "firefox":"50", "ie":"11" }
transform-duplicate-keys { "ie":"11" }
transform-for-of { "firefox":"50", "ie":"11" }
transform-function-name { "firefox":"50", "ie":"11" }
transform-literals { "firefox":"50", "ie":"11" }
transform-object-super { "ie":"11" }
transform-parameters { "firefox":"50", "ie":"11" }
transform-shorthand-properties { "ie":"11" }
transform-spread { "ie":"11" }
transform-sticky-regex { "ie":"11" }
transform-template-literals { "ie":"11" }
transform-typeof-symbol { "ie":"11" }
transform-unicode-regex { "ie":"11" }
transform-new-target { "ie":"11" }
transform-regenerator { "firefox":"50", "ie":"11" }
transform-exponentiation-operator { "firefox":"50", "ie":"11" }
transform-async-to-generator { "chrome":"52", "firefox":"50", "ie":"11" }
Using polyfills with `usage` option:
[src/in.js] Based on your code and targets, none were added.
src/in.js -> lib/in.js
[src/in2.js] Based on your code and targets, none were added.
src/in2.js -> lib/in2.js

View File

@@ -1,15 +0,0 @@
@babel/preset-env: `DEBUG` option
Using targets:
{
"chrome": "55"
}
Using modules transform: commonjs
Using plugins:
Using polyfills with `usage` option:
[src/in.js] Based on your code and targets, none were added.
src/in.js -> lib/in.js

View File

@@ -1,46 +0,0 @@
@babel/preset-env: `DEBUG` option
Using targets:
{
"chrome": "52",
"firefox": "50",
"ie": "11"
}
Using modules transform: commonjs
Using plugins:
check-constants { "firefox":"50", "ie":"11" }
transform-arrow-functions { "ie":"11" }
transform-block-scoping { "firefox":"50", "ie":"11" }
transform-classes { "ie":"11" }
transform-computed-properties { "ie":"11" }
transform-destructuring { "firefox":"50", "ie":"11" }
transform-duplicate-keys { "ie":"11" }
transform-for-of { "firefox":"50", "ie":"11" }
transform-function-name { "firefox":"50", "ie":"11" }
transform-literals { "firefox":"50", "ie":"11" }
transform-object-super { "ie":"11" }
transform-parameters { "firefox":"50", "ie":"11" }
transform-shorthand-properties { "ie":"11" }
transform-spread { "ie":"11" }
transform-sticky-regex { "ie":"11" }
transform-template-literals { "ie":"11" }
transform-typeof-symbol { "ie":"11" }
transform-unicode-regex { "ie":"11" }
transform-new-target { "ie":"11" }
transform-regenerator { "firefox":"50", "ie":"11" }
transform-exponentiation-operator { "firefox":"50", "ie":"11" }
transform-async-to-generator { "chrome":"52", "firefox":"50", "ie":"11" }
Using polyfills with `usage` option:
[src/in.js] Added following polyfills:
es6.promise { "ie":"11" }
es6.map { "firefox":"50", "ie":"11" }
src/in.js -> lib/in.js
[src/in2.js] Added following polyfills:
regenerator-runtime { "chrome":"52", "firefox":"50", "ie":"11" }
web.dom.iterable { "chrome":"52", "firefox":"50", "ie":"11" }
src/in2.js -> lib/in2.js

View File

@@ -1,147 +0,0 @@
Warning, the following targets are using a decimal version:
electron: 0.36
node: 6.1
We recommend using a string for minor/patch versions to avoid numbers like 6.10
getting parsed as 6.1, which can lead to unexpected behavior.
@babel/preset-env: `DEBUG` option
Using targets:
{
"chrome": "54",
"electron": "0.36",
"ie": "10",
"node": "6.1"
}
Using modules transform: commonjs
Using plugins:
check-constants { "electron":"0.36", "ie":"10" }
transform-arrow-functions { "ie":"10" }
transform-block-scoped-functions { "ie":"10" }
transform-block-scoping { "electron":"0.36", "ie":"10" }
transform-classes { "ie":"10" }
transform-computed-properties { "ie":"10" }
transform-destructuring { "electron":"0.36", "ie":"10", "node":"6.1" }
transform-duplicate-keys { "ie":"10" }
transform-for-of { "electron":"0.36", "ie":"10", "node":"6.1" }
transform-function-name { "electron":"0.36", "ie":"10", "node":"6.1" }
transform-literals { "ie":"10" }
transform-object-super { "ie":"10" }
transform-parameters { "electron":"0.36", "ie":"10" }
transform-shorthand-properties { "ie":"10" }
transform-spread { "ie":"10" }
transform-sticky-regex { "electron":"0.36", "ie":"10" }
transform-template-literals { "ie":"10" }
transform-typeof-symbol { "ie":"10" }
transform-unicode-regex { "electron":"0.36", "ie":"10" }
transform-new-target { "ie":"10" }
transform-regenerator { "electron":"0.36", "ie":"10" }
transform-exponentiation-operator { "electron":"0.36", "ie":"10", "node":"6.1" }
transform-async-to-generator { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" }
Using polyfills with `entry` option:
[src/in.js] Replaced `@babel/polyfill` with the following polyfills:
es6.typed.array-buffer { "electron":"0.36", "ie":"10", "node":"6.1" }
es6.typed.data-view { "electron":"0.36" }
es6.typed.int8-array { "electron":"0.36", "ie":"10", "node":"6.1" }
es6.typed.uint8-array { "electron":"0.36", "ie":"10", "node":"6.1" }
es6.typed.uint8-clamped-array { "electron":"0.36", "ie":"10", "node":"6.1" }
es6.typed.int16-array { "electron":"0.36", "ie":"10", "node":"6.1" }
es6.typed.uint16-array { "electron":"0.36", "ie":"10", "node":"6.1" }
es6.typed.int32-array { "electron":"0.36", "ie":"10", "node":"6.1" }
es6.typed.uint32-array { "electron":"0.36", "ie":"10", "node":"6.1" }
es6.typed.float32-array { "electron":"0.36", "ie":"10", "node":"6.1" }
es6.typed.float64-array { "electron":"0.36", "ie":"10", "node":"6.1" }
es6.map { "electron":"0.36", "ie":"10", "node":"6.1" }
es6.set { "electron":"0.36", "ie":"10", "node":"6.1" }
es6.weak-map { "electron":"0.36", "ie":"10", "node":"6.1" }
es6.weak-set { "electron":"0.36", "ie":"10", "node":"6.1" }
es6.reflect.apply { "electron":"0.36", "ie":"10" }
es6.reflect.construct { "electron":"0.36", "ie":"10" }
es6.reflect.define-property { "electron":"0.36", "ie":"10" }
es6.reflect.delete-property { "electron":"0.36", "ie":"10" }
es6.reflect.get { "electron":"0.36", "ie":"10" }
es6.reflect.get-own-property-descriptor { "electron":"0.36", "ie":"10" }
es6.reflect.get-prototype-of { "electron":"0.36", "ie":"10" }
es6.reflect.has { "electron":"0.36", "ie":"10" }
es6.reflect.is-extensible { "electron":"0.36", "ie":"10" }
es6.reflect.own-keys { "electron":"0.36", "ie":"10" }
es6.reflect.prevent-extensions { "electron":"0.36", "ie":"10" }
es6.reflect.set { "electron":"0.36", "ie":"10" }
es6.reflect.set-prototype-of { "electron":"0.36", "ie":"10" }
es6.promise { "electron":"0.36", "ie":"10", "node":"6.1" }
es6.symbol { "electron":"0.36", "ie":"10", "node":"6.1" }
es6.object.freeze { "ie":"10" }
es6.object.seal { "ie":"10" }
es6.object.prevent-extensions { "ie":"10" }
es6.object.is-frozen { "ie":"10" }
es6.object.is-sealed { "ie":"10" }
es6.object.is-extensible { "ie":"10" }
es6.object.get-own-property-descriptor { "ie":"10" }
es6.object.get-prototype-of { "ie":"10" }
es6.object.keys { "ie":"10" }
es6.object.get-own-property-names { "ie":"10" }
es6.object.assign { "ie":"10" }
es6.object.is { "ie":"10" }
es6.object.set-prototype-of { "ie":"10" }
es6.function.name { "electron":"0.36", "ie":"10", "node":"6.1" }
es6.string.raw { "ie":"10" }
es6.string.from-code-point { "ie":"10" }
es6.string.code-point-at { "ie":"10" }
es6.string.repeat { "ie":"10" }
es6.string.starts-with { "ie":"10" }
es6.string.ends-with { "ie":"10" }
es6.string.includes { "ie":"10" }
es6.regexp.flags { "electron":"0.36", "ie":"10" }
es6.regexp.match { "electron":"0.36", "ie":"10" }
es6.regexp.replace { "electron":"0.36", "ie":"10" }
es6.regexp.split { "electron":"0.36", "ie":"10" }
es6.regexp.search { "electron":"0.36", "ie":"10" }
es6.array.from { "electron":"0.36", "ie":"10", "node":"6.1" }
es6.array.of { "ie":"10" }
es6.array.copy-within { "ie":"10" }
es6.array.find { "ie":"10" }
es6.array.find-index { "ie":"10" }
es6.array.fill { "ie":"10" }
es6.array.iterator { "ie":"10" }
es6.number.is-finite { "ie":"10" }
es6.number.is-integer { "ie":"10" }
es6.number.is-safe-integer { "ie":"10" }
es6.number.is-nan { "ie":"10" }
es6.number.epsilon { "ie":"10" }
es6.number.min-safe-integer { "ie":"10" }
es6.number.max-safe-integer { "ie":"10" }
es6.number.parse-float { "ie":"10" }
es6.number.parse-int { "ie":"10" }
es6.math.acosh { "ie":"10" }
es6.math.asinh { "ie":"10" }
es6.math.atanh { "ie":"10" }
es6.math.cbrt { "ie":"10" }
es6.math.clz32 { "ie":"10" }
es6.math.cosh { "ie":"10" }
es6.math.expm1 { "ie":"10" }
es6.math.fround { "ie":"10" }
es6.math.hypot { "ie":"10" }
es6.math.imul { "ie":"10" }
es6.math.log1p { "ie":"10" }
es6.math.log10 { "ie":"10" }
es6.math.log2 { "ie":"10" }
es6.math.sign { "ie":"10" }
es6.math.sinh { "ie":"10" }
es6.math.tanh { "ie":"10" }
es6.math.trunc { "ie":"10" }
es7.array.includes { "ie":"10" }
es7.object.values { "electron":"0.36", "ie":"10", "node":"6.1" }
es7.object.entries { "electron":"0.36", "ie":"10", "node":"6.1" }
es7.object.get-own-property-descriptors { "electron":"0.36", "ie":"10", "node":"6.1" }
es7.string.pad-start { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" }
es7.string.pad-end { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" }
web.timers { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" }
web.immediate { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" }
web.dom.iterable { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" }
src/in.js -> lib/in.js

View File

@@ -1,137 +0,0 @@
@babel/preset-env: `DEBUG` option
Using targets:
{
"chrome": "54",
"ie": "10",
"node": "6.10"
}
Using modules transform: commonjs
Using plugins:
check-constants { "ie":"10" }
transform-arrow-functions { "ie":"10" }
transform-block-scoped-functions { "ie":"10" }
transform-block-scoping { "ie":"10" }
transform-classes { "ie":"10" }
transform-computed-properties { "ie":"10" }
transform-destructuring { "ie":"10" }
transform-duplicate-keys { "ie":"10" }
transform-for-of { "ie":"10" }
transform-function-name { "ie":"10" }
transform-literals { "ie":"10" }
transform-object-super { "ie":"10" }
transform-parameters { "ie":"10" }
transform-shorthand-properties { "ie":"10" }
transform-spread { "ie":"10" }
transform-sticky-regex { "ie":"10" }
transform-template-literals { "ie":"10" }
transform-typeof-symbol { "ie":"10" }
transform-unicode-regex { "ie":"10" }
transform-new-target { "ie":"10" }
transform-regenerator { "ie":"10" }
transform-exponentiation-operator { "ie":"10", "node":"6.10" }
transform-async-to-generator { "chrome":"54", "ie":"10", "node":"6.10" }
Using polyfills with `entry` option:
[src/in.js] Replaced `@babel/polyfill` with the following polyfills:
es6.typed.array-buffer { "ie":"10" }
es6.typed.int8-array { "ie":"10" }
es6.typed.uint8-array { "ie":"10" }
es6.typed.uint8-clamped-array { "ie":"10" }
es6.typed.int16-array { "ie":"10" }
es6.typed.uint16-array { "ie":"10" }
es6.typed.int32-array { "ie":"10" }
es6.typed.uint32-array { "ie":"10" }
es6.typed.float32-array { "ie":"10" }
es6.typed.float64-array { "ie":"10" }
es6.map { "ie":"10" }
es6.set { "ie":"10" }
es6.weak-map { "ie":"10" }
es6.weak-set { "ie":"10" }
es6.reflect.apply { "ie":"10" }
es6.reflect.construct { "ie":"10" }
es6.reflect.define-property { "ie":"10" }
es6.reflect.delete-property { "ie":"10" }
es6.reflect.get { "ie":"10" }
es6.reflect.get-own-property-descriptor { "ie":"10" }
es6.reflect.get-prototype-of { "ie":"10" }
es6.reflect.has { "ie":"10" }
es6.reflect.is-extensible { "ie":"10" }
es6.reflect.own-keys { "ie":"10" }
es6.reflect.prevent-extensions { "ie":"10" }
es6.reflect.set { "ie":"10" }
es6.reflect.set-prototype-of { "ie":"10" }
es6.promise { "ie":"10" }
es6.symbol { "ie":"10" }
es6.object.freeze { "ie":"10" }
es6.object.seal { "ie":"10" }
es6.object.prevent-extensions { "ie":"10" }
es6.object.is-frozen { "ie":"10" }
es6.object.is-sealed { "ie":"10" }
es6.object.is-extensible { "ie":"10" }
es6.object.get-own-property-descriptor { "ie":"10" }
es6.object.get-prototype-of { "ie":"10" }
es6.object.keys { "ie":"10" }
es6.object.get-own-property-names { "ie":"10" }
es6.object.assign { "ie":"10" }
es6.object.is { "ie":"10" }
es6.object.set-prototype-of { "ie":"10" }
es6.function.name { "ie":"10" }
es6.string.raw { "ie":"10" }
es6.string.from-code-point { "ie":"10" }
es6.string.code-point-at { "ie":"10" }
es6.string.repeat { "ie":"10" }
es6.string.starts-with { "ie":"10" }
es6.string.ends-with { "ie":"10" }
es6.string.includes { "ie":"10" }
es6.regexp.flags { "ie":"10" }
es6.regexp.match { "ie":"10" }
es6.regexp.replace { "ie":"10" }
es6.regexp.split { "ie":"10" }
es6.regexp.search { "ie":"10" }
es6.array.from { "ie":"10" }
es6.array.of { "ie":"10" }
es6.array.copy-within { "ie":"10" }
es6.array.find { "ie":"10" }
es6.array.find-index { "ie":"10" }
es6.array.fill { "ie":"10" }
es6.array.iterator { "ie":"10" }
es6.number.is-finite { "ie":"10" }
es6.number.is-integer { "ie":"10" }
es6.number.is-safe-integer { "ie":"10" }
es6.number.is-nan { "ie":"10" }
es6.number.epsilon { "ie":"10" }
es6.number.min-safe-integer { "ie":"10" }
es6.number.max-safe-integer { "ie":"10" }
es6.number.parse-float { "ie":"10" }
es6.number.parse-int { "ie":"10" }
es6.math.acosh { "ie":"10" }
es6.math.asinh { "ie":"10" }
es6.math.atanh { "ie":"10" }
es6.math.cbrt { "ie":"10" }
es6.math.clz32 { "ie":"10" }
es6.math.cosh { "ie":"10" }
es6.math.expm1 { "ie":"10" }
es6.math.fround { "ie":"10" }
es6.math.hypot { "ie":"10" }
es6.math.imul { "ie":"10" }
es6.math.log1p { "ie":"10" }
es6.math.log10 { "ie":"10" }
es6.math.log2 { "ie":"10" }
es6.math.sign { "ie":"10" }
es6.math.sinh { "ie":"10" }
es6.math.tanh { "ie":"10" }
es6.math.trunc { "ie":"10" }
es7.array.includes { "ie":"10" }
es7.object.values { "ie":"10", "node":"6.10" }
es7.object.entries { "ie":"10", "node":"6.10" }
es7.object.get-own-property-descriptors { "ie":"10", "node":"6.10" }
es7.string.pad-start { "chrome":"54", "ie":"10", "node":"6.10" }
es7.string.pad-end { "chrome":"54", "ie":"10", "node":"6.10" }
web.timers { "chrome":"54", "ie":"10", "node":"6.10" }
web.immediate { "chrome":"54", "ie":"10", "node":"6.10" }
web.dom.iterable { "chrome":"54", "ie":"10", "node":"6.10" }
src/in.js -> lib/in.js

View File

@@ -1,3 +0,0 @@
import "@babel/polyfill/lib/core-js/modules/es6.symbol";
import "@babel/polyfill/lib/core-js/modules/web.dom.iterable";
Symbol.iterator in arr;

View File

@@ -1,3 +0,0 @@
import "@babel/polyfill/lib/core-js/modules/es6.symbol";
import "@babel/polyfill/lib/core-js/modules/web.dom.iterable";
arr[Symbol.iterator]();

View File

@@ -1,3 +0,0 @@
function* a() {
yield 1;
}

View File

@@ -1,5 +0,0 @@
import "@babel/polyfill/lib/core-js/modules/web.dom.iterable";
function* a() {
yield* 1;
}

View File

@@ -1,2 +0,0 @@
import "@babel/polyfill/lib/core-js/modules/es6.typed.data-view";
import "@babel/polyfill/lib/core-js/modules/es6.reflect.apply";

View File

@@ -1 +0,0 @@
import "@babel/polyfill/lib/regenerator-runtime/runtime";

View File

@@ -1,38 +0,0 @@
Array.from; // static method
Map; // built-in
new Promise(); // new builtin
Symbol.match; // as member expression
_arr[Symbol.iterator](); // Symbol.iterator
// no import
Array.asdf;
Array2.from;
Map2;
new Promise2();
Symbol.asdf;
Symbol2.match;
_arr9[Symbol2.iterator]();
_arr9[Symbol.iterator2]();
G.assign; // static method
function H(WeakMap) {
var blah = new WeakMap();
} // shadowed
// not covered by this plugin
var asdf = 'copyWithin';
i[asdf]; // computed with identifier
j["copyWithin"]; // computed with template
var _k = k,
_a = _k[asdf]; // computed

View File

@@ -1,14 +0,0 @@
import "@babel/polyfill/lib/core-js/modules/es6.object.assign";
var objectClass = Object;
var arrayInstance = [];
var assignStr = "assign";
var entriesStr = "entries";
var valuesStr = "values";
var inclidesStr = "includes";
var findStr = "find"; // Allow static methods be assigned to variables only directly in the module.
externalVar[valuesStr]; // don't include
objectClass[assignStr]({}); // include
arrayInstance[entriesStr]({}); // don't include

View File

@@ -1,10 +0,0 @@
import "@babel/polyfill/lib/core-js/modules/es6.array.find";
import "@babel/polyfill/lib/core-js/modules/es7.array.includes";
var arrayInstance = [];
var inclidesStr = "includes";
var findStr = "find"; // Allow instance methods be assigned to variables.
arrayInstance[inclidesStr](); // include
externalVar[findStr]; // include

View File

@@ -1,23 +0,0 @@
Array.from; // static function
Map; // top level built-in
// instance methods may have false positives (which is ok)
a.includes(); // method call
b['find']; // computed string?
c.prototype.findIndex(); // .prototype
d.fill.bind(); //.bind
e.padStart.apply(); // .apply
f.padEnd.call(); // .call
String.prototype.startsWith.call; // prototype.call
var {
codePointAt,
endsWith
} = k; // destructuring

View File

@@ -1,50 +0,0 @@
import "@babel/polyfill/lib/core-js/modules/es6.regexp.split";
import "@babel/polyfill/lib/core-js/modules/es6.regexp.replace";
import "@babel/polyfill/lib/core-js/modules/es6.regexp.search";
import "@babel/polyfill/lib/core-js/modules/es6.array.copy-within";
import "@babel/polyfill/lib/core-js/modules/es6.string.ends-with";
import "@babel/polyfill/lib/core-js/modules/es6.string.code-point-at";
import "@babel/polyfill/lib/core-js/modules/es6.string.starts-with";
import "@babel/polyfill/lib/core-js/modules/es7.string.pad-end";
import "@babel/polyfill/lib/core-js/modules/es7.string.pad-start";
import "@babel/polyfill/lib/core-js/modules/es6.array.fill";
import "@babel/polyfill/lib/core-js/modules/es6.array.find-index";
import "@babel/polyfill/lib/core-js/modules/es6.array.find";
import "@babel/polyfill/lib/core-js/modules/es7.array.includes";
import "@babel/polyfill/lib/core-js/modules/es6.string.includes";
import "@babel/polyfill/lib/core-js/modules/es6.map";
import "@babel/polyfill/lib/core-js/modules/es6.array.from";
Array.from; // static function
Map; // top level built-in
// instance methods may have false positives (which is ok)
a.includes(); // method call
b['find']; // computed string?
c.prototype.findIndex(); // .prototype
d.fill.bind(); //.bind
e.padStart.apply(); // .apply
f.padEnd.call(); // .call
String.prototype.startsWith.call; // prototype.call
var _k = k,
codePointAt = _k.codePointAt,
endsWith = _k.endsWith; // destructuring
var asdf = "copyWithin";
var asdf2 = "split";
var asdf3 = "re" + "place";
i[asdf]; // computed with identifier
j["search"]; // computed with template
k[asdf3]; // computed with concat strings
var _k2 = k,
_a = _k2[asdf2]; // computed

View File

@@ -1,36 +0,0 @@
Array.from; // static method
Map; // built-in
new Promise(); // new builtin
Symbol.match; // as member expression
// no import
Array.asdf;
Array2.from;
Map2;
new Promise2();
Symbol.asdf;
Symbol2.match;
_arr9[Symbol2.iterator]();
_arr9[Symbol.iterator2]();
G.assign; // static method
function H(WeakMap) {
var blah = new WeakMap();
} // shadowed
// not covered by this plugin
var asdf = 'copyWithin';
i[asdf]; // computed with identifier
j[`copyWithin`]; // computed with template
var {
[asdf]: _a
} = k; // computed

View File

@@ -1,34 +0,0 @@
import "@babel/polyfill/lib/core-js/modules/web.dom.iterable";
import "@babel/polyfill/lib/core-js/modules/es6.symbol";
import "@babel/polyfill/lib/core-js/modules/es6.regexp.match";
import "@babel/polyfill/lib/core-js/modules/es6.promise";
import "@babel/polyfill/lib/core-js/modules/es6.map";
import "@babel/polyfill/lib/core-js/modules/es6.array.from";
Array.from; // static method
Map; // built-in
new Promise(); // new builtin
Symbol.match; // as member expression
_arr[Symbol.iterator](); // Symbol.iterator
// no import
Array.asdf;
Array2.from;
Map2;
new Promise2();
Symbol.asdf;
Symbol2.match;
_arr9[Symbol2.iterator]();
_arr9[Symbol.iterator2]();
G.assign; // static method
function H(WeakMap) {
var blah = new WeakMap();
} // shadowed

View File

@@ -1,24 +0,0 @@
import "@babel/polyfill/lib/core-js/modules/es6.promise";
import "@babel/polyfill/lib/regenerator-runtime/runtime";
var a = function () {
var _ref = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
case "end":
return _context.stop();
}
}
}, _callee, this);
}));
return function a() {
return _ref.apply(this, arguments);
};
}();
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _next(value) { step("next", value); } function _throw(err) { step("throw", err); } _next(); }); }; }

View File

@@ -1,17 +0,0 @@
import "@babel/polyfill/lib/regenerator-runtime/runtime";
var _marked =
/*#__PURE__*/
regeneratorRuntime.mark(a);
function a() {
return regeneratorRuntime.wrap(function a$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
case "end":
return _context.stop();
}
}
}, _marked, this);
}

View File

@@ -1,5 +0,0 @@
"use strict";
require("@babel/polyfill/lib/core-js/modules/es6.promise");
Promise;

View File

@@ -1,10 +0,0 @@
{
"presets": [
["../../../../lib", {
"configPath": "../fixtures/preset-options/browserslist-config-ignore-with-false",
"modules": false,
"debug": true,
"ignoreBrowserslistConfig": true
}]
]
}

View File

@@ -1,9 +0,0 @@
{
"presets": [
["../../../../lib", {
"configPath": "../fixtures/preset-options/browserslist-config",
"modules": false,
"debug": true
}]
]
}

View File

@@ -1,13 +0,0 @@
{
"presets": [
["../../../../lib", {
"configPath": "../fixtures/preset-options/browserslist-package-ignore-with-array",
"targets": {
"chrome": 55,
"browsers": []
},
"modules": false,
"debug": true
}]
]
}

View File

@@ -1,12 +0,0 @@
{
"presets": [
["../../../../lib", {
"configPath": "../fixtures/preset-options/browserslist-package",
"targets": {
"chrome": 55
},
"modules": false,
"debug": true
}]
]
}

View File

@@ -1,9 +0,0 @@
import "@babel/polyfill/lib/core-js/modules/es7.object.values";
import "@babel/polyfill/lib/core-js/modules/es7.object.entries";
import "@babel/polyfill/lib/core-js/modules/es7.object.get-own-property-descriptors";
import "@babel/polyfill/lib/core-js/modules/es7.string.pad-start";
import "@babel/polyfill/lib/core-js/modules/es7.string.pad-end";
import "@babel/polyfill/lib/core-js/modules/web.timers";
import "@babel/polyfill/lib/core-js/modules/web.immediate";
import "@babel/polyfill/lib/core-js/modules/web.dom.iterable";
a ** b;

View File

@@ -1,18 +0,0 @@
{
"presets": [
["../../../../lib", {
"targets": {
"chrome": 55
},
"modules": false,
"useBuiltIns": "entry",
"exclude": [
"es7.string.pad-start",
"es7.string.pad-end",
"web.timers",
"web.immediate",
"web.dom.iterable"
]
}]
]
}

View File

@@ -1,11 +0,0 @@
import "@babel/polyfill/lib/core-js/modules/es7.string.pad-end";
import "@babel/polyfill/lib/core-js/modules/web.timers";
import "@babel/polyfill/lib/core-js/modules/web.immediate";
import "@babel/polyfill/lib/core-js/modules/web.dom.iterable";
import "@babel/polyfill/lib/core-js/modules/es6.map";
async function a() {
await 1;
}
(function () {});

View File

@@ -1,98 +0,0 @@
import "@babel/polyfill/lib/core-js/modules/es6.typed.array-buffer";
import "@babel/polyfill/lib/core-js/modules/es6.typed.data-view";
import "@babel/polyfill/lib/core-js/modules/es6.typed.int8-array";
import "@babel/polyfill/lib/core-js/modules/es6.typed.uint8-array";
import "@babel/polyfill/lib/core-js/modules/es6.typed.uint8-clamped-array";
import "@babel/polyfill/lib/core-js/modules/es6.typed.int16-array";
import "@babel/polyfill/lib/core-js/modules/es6.typed.uint16-array";
import "@babel/polyfill/lib/core-js/modules/es6.typed.int32-array";
import "@babel/polyfill/lib/core-js/modules/es6.typed.uint32-array";
import "@babel/polyfill/lib/core-js/modules/es6.typed.float32-array";
import "@babel/polyfill/lib/core-js/modules/es6.typed.float64-array";
import "@babel/polyfill/lib/core-js/modules/es6.map";
import "@babel/polyfill/lib/core-js/modules/es6.set";
import "@babel/polyfill/lib/core-js/modules/es6.weak-map";
import "@babel/polyfill/lib/core-js/modules/es6.weak-set";
import "@babel/polyfill/lib/core-js/modules/es6.reflect.apply";
import "@babel/polyfill/lib/core-js/modules/es6.reflect.construct";
import "@babel/polyfill/lib/core-js/modules/es6.reflect.define-property";
import "@babel/polyfill/lib/core-js/modules/es6.reflect.delete-property";
import "@babel/polyfill/lib/core-js/modules/es6.reflect.get";
import "@babel/polyfill/lib/core-js/modules/es6.reflect.get-own-property-descriptor";
import "@babel/polyfill/lib/core-js/modules/es6.reflect.get-prototype-of";
import "@babel/polyfill/lib/core-js/modules/es6.reflect.has";
import "@babel/polyfill/lib/core-js/modules/es6.reflect.is-extensible";
import "@babel/polyfill/lib/core-js/modules/es6.reflect.own-keys";
import "@babel/polyfill/lib/core-js/modules/es6.reflect.prevent-extensions";
import "@babel/polyfill/lib/core-js/modules/es6.reflect.set";
import "@babel/polyfill/lib/core-js/modules/es6.reflect.set-prototype-of";
import "@babel/polyfill/lib/core-js/modules/es6.promise";
import "@babel/polyfill/lib/core-js/modules/es6.symbol";
import "@babel/polyfill/lib/core-js/modules/es6.object.freeze";
import "@babel/polyfill/lib/core-js/modules/es6.object.seal";
import "@babel/polyfill/lib/core-js/modules/es6.object.prevent-extensions";
import "@babel/polyfill/lib/core-js/modules/es6.object.is-frozen";
import "@babel/polyfill/lib/core-js/modules/es6.object.is-sealed";
import "@babel/polyfill/lib/core-js/modules/es6.object.is-extensible";
import "@babel/polyfill/lib/core-js/modules/es6.object.get-own-property-descriptor";
import "@babel/polyfill/lib/core-js/modules/es6.object.get-prototype-of";
import "@babel/polyfill/lib/core-js/modules/es6.object.keys";
import "@babel/polyfill/lib/core-js/modules/es6.object.get-own-property-names";
import "@babel/polyfill/lib/core-js/modules/es6.object.assign";
import "@babel/polyfill/lib/core-js/modules/es6.object.is";
import "@babel/polyfill/lib/core-js/modules/es6.object.set-prototype-of";
import "@babel/polyfill/lib/core-js/modules/es6.function.name";
import "@babel/polyfill/lib/core-js/modules/es6.string.raw";
import "@babel/polyfill/lib/core-js/modules/es6.string.from-code-point";
import "@babel/polyfill/lib/core-js/modules/es6.string.code-point-at";
import "@babel/polyfill/lib/core-js/modules/es6.string.repeat";
import "@babel/polyfill/lib/core-js/modules/es6.string.starts-with";
import "@babel/polyfill/lib/core-js/modules/es6.string.ends-with";
import "@babel/polyfill/lib/core-js/modules/es6.string.includes";
import "@babel/polyfill/lib/core-js/modules/es6.regexp.flags";
import "@babel/polyfill/lib/core-js/modules/es6.regexp.match";
import "@babel/polyfill/lib/core-js/modules/es6.regexp.replace";
import "@babel/polyfill/lib/core-js/modules/es6.regexp.split";
import "@babel/polyfill/lib/core-js/modules/es6.regexp.search";
import "@babel/polyfill/lib/core-js/modules/es6.array.from";
import "@babel/polyfill/lib/core-js/modules/es6.array.of";
import "@babel/polyfill/lib/core-js/modules/es6.array.copy-within";
import "@babel/polyfill/lib/core-js/modules/es6.array.find";
import "@babel/polyfill/lib/core-js/modules/es6.array.find-index";
import "@babel/polyfill/lib/core-js/modules/es6.array.fill";
import "@babel/polyfill/lib/core-js/modules/es6.array.iterator";
import "@babel/polyfill/lib/core-js/modules/es6.number.is-finite";
import "@babel/polyfill/lib/core-js/modules/es6.number.is-integer";
import "@babel/polyfill/lib/core-js/modules/es6.number.is-safe-integer";
import "@babel/polyfill/lib/core-js/modules/es6.number.is-nan";
import "@babel/polyfill/lib/core-js/modules/es6.number.epsilon";
import "@babel/polyfill/lib/core-js/modules/es6.number.min-safe-integer";
import "@babel/polyfill/lib/core-js/modules/es6.number.max-safe-integer";
import "@babel/polyfill/lib/core-js/modules/es6.number.parse-float";
import "@babel/polyfill/lib/core-js/modules/es6.number.parse-int";
import "@babel/polyfill/lib/core-js/modules/es6.math.acosh";
import "@babel/polyfill/lib/core-js/modules/es6.math.asinh";
import "@babel/polyfill/lib/core-js/modules/es6.math.atanh";
import "@babel/polyfill/lib/core-js/modules/es6.math.cbrt";
import "@babel/polyfill/lib/core-js/modules/es6.math.clz32";
import "@babel/polyfill/lib/core-js/modules/es6.math.cosh";
import "@babel/polyfill/lib/core-js/modules/es6.math.expm1";
import "@babel/polyfill/lib/core-js/modules/es6.math.fround";
import "@babel/polyfill/lib/core-js/modules/es6.math.hypot";
import "@babel/polyfill/lib/core-js/modules/es6.math.imul";
import "@babel/polyfill/lib/core-js/modules/es6.math.log1p";
import "@babel/polyfill/lib/core-js/modules/es6.math.log10";
import "@babel/polyfill/lib/core-js/modules/es6.math.log2";
import "@babel/polyfill/lib/core-js/modules/es6.math.sign";
import "@babel/polyfill/lib/core-js/modules/es6.math.sinh";
import "@babel/polyfill/lib/core-js/modules/es6.math.tanh";
import "@babel/polyfill/lib/core-js/modules/es6.math.trunc";
import "@babel/polyfill/lib/core-js/modules/es7.array.includes";
import "@babel/polyfill/lib/core-js/modules/es7.object.values";
import "@babel/polyfill/lib/core-js/modules/es7.object.entries";
import "@babel/polyfill/lib/core-js/modules/es7.object.get-own-property-descriptors";
import "@babel/polyfill/lib/core-js/modules/es7.string.pad-start";
import "@babel/polyfill/lib/core-js/modules/es7.string.pad-end";
import "@babel/polyfill/lib/core-js/modules/web.timers";
import "@babel/polyfill/lib/core-js/modules/web.immediate";
import "@babel/polyfill/lib/core-js/modules/web.dom.iterable";

View File

@@ -1,3 +0,0 @@
async function a() {
await 1;
}

View File

@@ -1,97 +0,0 @@
import "@babel/polyfill/lib/core-js/modules/es6.typed.array-buffer";
import "@babel/polyfill/lib/core-js/modules/es6.typed.int8-array";
import "@babel/polyfill/lib/core-js/modules/es6.typed.uint8-array";
import "@babel/polyfill/lib/core-js/modules/es6.typed.uint8-clamped-array";
import "@babel/polyfill/lib/core-js/modules/es6.typed.int16-array";
import "@babel/polyfill/lib/core-js/modules/es6.typed.uint16-array";
import "@babel/polyfill/lib/core-js/modules/es6.typed.int32-array";
import "@babel/polyfill/lib/core-js/modules/es6.typed.uint32-array";
import "@babel/polyfill/lib/core-js/modules/es6.typed.float32-array";
import "@babel/polyfill/lib/core-js/modules/es6.typed.float64-array";
import "@babel/polyfill/lib/core-js/modules/es6.map";
import "@babel/polyfill/lib/core-js/modules/es6.set";
import "@babel/polyfill/lib/core-js/modules/es6.weak-map";
import "@babel/polyfill/lib/core-js/modules/es6.weak-set";
import "@babel/polyfill/lib/core-js/modules/es6.reflect.apply";
import "@babel/polyfill/lib/core-js/modules/es6.reflect.construct";
import "@babel/polyfill/lib/core-js/modules/es6.reflect.define-property";
import "@babel/polyfill/lib/core-js/modules/es6.reflect.delete-property";
import "@babel/polyfill/lib/core-js/modules/es6.reflect.get";
import "@babel/polyfill/lib/core-js/modules/es6.reflect.get-own-property-descriptor";
import "@babel/polyfill/lib/core-js/modules/es6.reflect.get-prototype-of";
import "@babel/polyfill/lib/core-js/modules/es6.reflect.has";
import "@babel/polyfill/lib/core-js/modules/es6.reflect.is-extensible";
import "@babel/polyfill/lib/core-js/modules/es6.reflect.own-keys";
import "@babel/polyfill/lib/core-js/modules/es6.reflect.prevent-extensions";
import "@babel/polyfill/lib/core-js/modules/es6.reflect.set";
import "@babel/polyfill/lib/core-js/modules/es6.reflect.set-prototype-of";
import "@babel/polyfill/lib/core-js/modules/es6.promise";
import "@babel/polyfill/lib/core-js/modules/es6.symbol";
import "@babel/polyfill/lib/core-js/modules/es6.object.freeze";
import "@babel/polyfill/lib/core-js/modules/es6.object.seal";
import "@babel/polyfill/lib/core-js/modules/es6.object.prevent-extensions";
import "@babel/polyfill/lib/core-js/modules/es6.object.is-frozen";
import "@babel/polyfill/lib/core-js/modules/es6.object.is-sealed";
import "@babel/polyfill/lib/core-js/modules/es6.object.is-extensible";
import "@babel/polyfill/lib/core-js/modules/es6.object.get-own-property-descriptor";
import "@babel/polyfill/lib/core-js/modules/es6.object.get-prototype-of";
import "@babel/polyfill/lib/core-js/modules/es6.object.keys";
import "@babel/polyfill/lib/core-js/modules/es6.object.get-own-property-names";
import "@babel/polyfill/lib/core-js/modules/es6.object.assign";
import "@babel/polyfill/lib/core-js/modules/es6.object.is";
import "@babel/polyfill/lib/core-js/modules/es6.function.name";
import "@babel/polyfill/lib/core-js/modules/es6.string.raw";
import "@babel/polyfill/lib/core-js/modules/es6.string.from-code-point";
import "@babel/polyfill/lib/core-js/modules/es6.string.code-point-at";
import "@babel/polyfill/lib/core-js/modules/es6.string.repeat";
import "@babel/polyfill/lib/core-js/modules/es6.string.starts-with";
import "@babel/polyfill/lib/core-js/modules/es6.string.ends-with";
import "@babel/polyfill/lib/core-js/modules/es6.string.includes";
import "@babel/polyfill/lib/core-js/modules/es6.regexp.flags";
import "@babel/polyfill/lib/core-js/modules/es6.regexp.match";
import "@babel/polyfill/lib/core-js/modules/es6.regexp.replace";
import "@babel/polyfill/lib/core-js/modules/es6.regexp.split";
import "@babel/polyfill/lib/core-js/modules/es6.regexp.search";
import "@babel/polyfill/lib/core-js/modules/es6.array.from";
import "@babel/polyfill/lib/core-js/modules/es6.array.of";
import "@babel/polyfill/lib/core-js/modules/es6.array.copy-within";
import "@babel/polyfill/lib/core-js/modules/es6.array.find";
import "@babel/polyfill/lib/core-js/modules/es6.array.find-index";
import "@babel/polyfill/lib/core-js/modules/es6.array.fill";
import "@babel/polyfill/lib/core-js/modules/es6.array.iterator";
import "@babel/polyfill/lib/core-js/modules/es6.number.is-finite";
import "@babel/polyfill/lib/core-js/modules/es6.number.is-integer";
import "@babel/polyfill/lib/core-js/modules/es6.number.is-safe-integer";
import "@babel/polyfill/lib/core-js/modules/es6.number.is-nan";
import "@babel/polyfill/lib/core-js/modules/es6.number.epsilon";
import "@babel/polyfill/lib/core-js/modules/es6.number.min-safe-integer";
import "@babel/polyfill/lib/core-js/modules/es6.number.max-safe-integer";
import "@babel/polyfill/lib/core-js/modules/es6.number.parse-float";
import "@babel/polyfill/lib/core-js/modules/es6.number.parse-int";
import "@babel/polyfill/lib/core-js/modules/es6.math.acosh";
import "@babel/polyfill/lib/core-js/modules/es6.math.asinh";
import "@babel/polyfill/lib/core-js/modules/es6.math.atanh";
import "@babel/polyfill/lib/core-js/modules/es6.math.cbrt";
import "@babel/polyfill/lib/core-js/modules/es6.math.clz32";
import "@babel/polyfill/lib/core-js/modules/es6.math.cosh";
import "@babel/polyfill/lib/core-js/modules/es6.math.expm1";
import "@babel/polyfill/lib/core-js/modules/es6.math.fround";
import "@babel/polyfill/lib/core-js/modules/es6.math.hypot";
import "@babel/polyfill/lib/core-js/modules/es6.math.imul";
import "@babel/polyfill/lib/core-js/modules/es6.math.log1p";
import "@babel/polyfill/lib/core-js/modules/es6.math.log10";
import "@babel/polyfill/lib/core-js/modules/es6.math.log2";
import "@babel/polyfill/lib/core-js/modules/es6.math.sign";
import "@babel/polyfill/lib/core-js/modules/es6.math.sinh";
import "@babel/polyfill/lib/core-js/modules/es6.math.tanh";
import "@babel/polyfill/lib/core-js/modules/es6.math.trunc";
import "@babel/polyfill/lib/core-js/modules/es7.array.includes";
import "@babel/polyfill/lib/core-js/modules/es7.object.values";
import "@babel/polyfill/lib/core-js/modules/es7.object.entries";
import "@babel/polyfill/lib/core-js/modules/es7.object.get-own-property-descriptors";
import "@babel/polyfill/lib/core-js/modules/es7.string.pad-start";
import "@babel/polyfill/lib/core-js/modules/es7.string.pad-end";
import "@babel/polyfill/lib/core-js/modules/web.timers";
import "@babel/polyfill/lib/core-js/modules/web.immediate";
import "@babel/polyfill/lib/core-js/modules/web.dom.iterable";
import "@babel/polyfill/lib/regenerator-runtime/runtime";

View File

@@ -1,7 +0,0 @@
import "@babel/polyfill/lib/core-js/modules/es7.string.pad-start";
import "@babel/polyfill/lib/core-js/modules/es7.string.pad-end";
import "@babel/polyfill/lib/core-js/modules/web.timers";
import "@babel/polyfill/lib/core-js/modules/web.immediate";
import "@babel/polyfill/lib/core-js/modules/web.dom.iterable";
import "@babel/polyfill/lib/core-js/modules/es6.map";
import "@babel/polyfill/lib/core-js/modules/es6.set";

View File

@@ -1,9 +0,0 @@
{
"presets": [
["../../../../lib", {
"targets": {},
"include": ["transform-modules-commonjs"],
"modules": false
}]
]
}

View File

@@ -1 +0,0 @@
const a = () => 1;

View File

@@ -1 +0,0 @@
import "core-js";

Some files were not shown because too many files have changed in this diff Show More