Compare commits

..

8564 Commits

Author SHA1 Message Date
Nicolò Ribaudo
97faa83953 v7.7.0 2019-11-05 11:27:14 +01:00
Nicolò Ribaudo
cdbffe3990 Remove --require-scripts from publish-ci [skip ci] 2019-11-05 11:25:29 +01:00
Huáng Jùnliàng
b114486bc1 Traverse performance (#10480)
* perf: remove this.inList assignment

* perf: convert NodePath.parentKey into accessor function

* perf: compress shouldSkip/shouldStop/removed traverse flags

* perf: lazy initialize this.skipKeys

* perf: lazily initialize NodePath.data

* add code comments before bit operations

* remove unused typeAnnotation property

# Conflicts:
#	packages/babel-traverse/src/path/index.js

* early return when visitor keys are empty
2019-11-05 11:11:58 +01:00
Nicolò Ribaudo
e9c1bce50f Add support for TS declare modifier on fields (#10545)
* [parser] Add support for TS declare modifier on fields (#10484)

* [parser] Add support for TS declare modifier on fields

* Use Object.create(null)

* Comment

* Add support for TS declare types to types and generator (#10544)

* Transform TypeScript "declare" fields (#10546)

* Transform TypeScript "declare" fields

* Remove multiple spaces

* declareFields -> allowDeclareFields

* Update after rebase
2019-11-05 10:56:57 +01:00
Nicolò Ribaudo
87feda7c2a @babel/parser error recovery (#10363)
* Add error recovery support to @babel/parser

* Update @babel/parser tests to always recover from errors

* Update this.raise usage in @babel/parser:

- expression.js
- lval.js
- statement.js
- estree.js
- flow.js
- jsx/index.js
- tokenizer/index.js

* Update @babel/parser fixtures with recovered errors

* Fix tests out of @babel/parser

* Do not use try/catch for control flow

* Update invalid fixtures

* Do not report invalid lhs in toAssignable

* Do not validate function id multiple times

* Dedupe reserved await errors

* Remove duplicate errors about strict reserved bindings

* Remove duplicated error about yield/await inside params

* Don't error twice for methods in object patterns

* Don't report invalid super() twice

* Remove dup error about reserved param for expr arrows

* Remove double escapes in migrated tests

* Dedupe errors about invalid escapes in identifiers

* Remove duplicated error about decorated constructor

* Remove duplicated error about spread in flow class

* Don't throw for invalid super usage

* Don't fail for object decorators with stage 2

* Fix flow inexact type errors

* Fix flow

* Fix errors about escapes in keywords (ref: #10455)

* Update after rebase

* Fix todo

* Remove duplicated error when using += for defaults

* Remove unnecessary throw

* Nit: use ??
2019-11-05 10:15:00 +01:00
Nicolò Ribaudo
d25262ec4b Correctly delegate .return() in async generator (#10422)
* Correctly delegate .return() in async generator

* Add catch param

* minNodeVersion

* Add another test
2019-11-05 00:35:40 +01:00
Nicolò Ribaudo
861844761f [preset-env] Don't use async-to-generator when already using re… (#9481)
* [preset-env] Don't use async-to-generator when already using regenerator

* Add tests

* Update fixtures
2019-11-04 22:53:53 +01:00
Nicolò Ribaudo
43aa7e262c Don't throw when destructuring into a var named as an import (#10628) 2019-11-04 22:50:36 +01:00
Huáng Jùnliàng
5e24016623 fix: remove ExportNamedDeclaration when the specifier is empty (#10638) 2019-11-04 21:51:24 +01:00
Nicolò Ribaudo
d023e105b7 [TS] Parse calls with type args in optional chains (#10631)
* [TS] Parse calls with type args in optional chains

* Test output
2019-11-04 13:25:15 -05:00
Nicolò Ribaudo
abce0ef49d [TS] Correctly transform computed strings and templates in enums (#10555)
* [TS] Correctly transform computed strings and templates in enums

* Typo [skip ci]
2019-11-04 13:22:49 -05:00
Chris Garrett
5c0d8a9de7 add legacy decorators support to strict class fields (#10616)
This PR allows legacy decorators to work with strict class fields, which
are now stage 3 and have shipped in a number of browsers. Allowing this will
allow users of the legacy transform (which is currently recommended by the
champions of the decorator proposal) to use the proper class field semantics
for non-decorated fields, which should help prevent breakage later on.

This change is not a breaking change, since users had to explicitly opt into
loose mode in class fields before. This just gives them the option to remove
that opt-in.
2019-11-04 13:05:42 -05:00
Nicolò Ribaudo
bea1b0d0af Add support for .cjs config files (#10599)
* Remove duplicate config loading logic and errors

* Add support for .cjs config files

* Add tests

* [tests] Fallback for fs.promises on node 6
2019-11-04 00:24:44 +01:00
Mohammad Ahmadi
58a646be59 corrected the grammar of option descriptions (#10589)
* corrected the grammar of option descriptions

* added comment
2019-11-04 00:24:00 +01:00
Martin Forsgren
c7d8b8a377 throw a TypeError if identifier validation fails (#10621)
* throw a TypeError if Identifier validation fails

* Relax identifier validation, reserved words are ok
2019-11-02 12:04:16 +01:00
Huáng Jùnliàng
d08702c9d2 inputSourceMap should work when it is in an external file (#10623)
* fix: construct comment block for fromMapFileComment

* add test

* small tweak: redundant capturing group
2019-10-31 16:12:44 -04:00
Huáng Jùnliàng
a2b5437b01 chore: remove output-file-sync dependency (#10619) 2019-10-31 11:51:36 -07:00
Linus Unnebäck
0b0edc3e3d chore: bump source-map-support to 0.5.16 (#10615) 2019-10-30 07:56:52 -04:00
Huáng Jùnliàng
e419e5fe42 chore: bump source-map-support to 0.5.14 (#10614) 2019-10-29 19:19:16 -04:00
Nicolò Ribaudo
4e6a4b08bb Create @babel/plugin-syntax-top-level-await (#10573) 2019-10-29 23:27:56 +01:00
Ivan Medina
3d2f365074 [transform-react-jsx] Add useSpread option to transform JSX (#10572)
* [transform-react-jsx] Add useSpread option to transform JSX

* Add validation for default option

* Add error when using useSpread and useBuiltIns at the same time

* Move useSpread to convertAttribute helper function

* Add useSpread option to presect-react

* Remove casting useSpread to boolean in preset-react option.

Co-Authored-By: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2019-10-29 23:02:53 +01:00
Huáng Jùnliàng
8ffca0475a Merge multiple regex transform plugin (#10447)
* feat: implement create-regexp-features-plugin

* fix: test input is not effective

* refactor: leverage create-regexp-features-plugin

* test: add more test cases

* test: update test fixture

* chore: add type annotation to features

* test: add regression test for issue 9892

* add regression test for issue 9199

* address review comments from Nicolò

* address review comments from Brian

* small tweaks

* Enable dotAllFlag when flags includes u
2019-10-29 22:58:04 +01:00
George Zahariev
ec3345bb57 Flow enums parsing (#10344)
* Flow enums parsing

* Parse exporting enums

* Enums parsing remove lookahead, other improvements

* Enums: add EnumBody and EnumMember aliases, change boolean members to use BooleaLiteral value

* Fix enum member init flow type, now that boolean members have a BooleanLiteral value

* Flow enums: use contextual utils, change members length checks to use logic operators, remove reserved word logic modification

* Flow enums: remove unnecessary code in generator, fix error message
2019-10-29 22:55:12 +01:00
Vivek Nayyar
4b3a19ea9f fixed missing errors on assignment pattern in object expression (#10607)
* 🐛 fixed missing errors on assignment pattern in object expression

* ♻️ remove a non-needed comment

* 🐛 missed adding comma in the test input

* 🐛 fixed the failing valid-property-initializer test
2019-10-29 22:32:02 +01:00
Micah Zoltu
198b4a0fbd Changes UMD callsite to be more likely to pass in the intended… (#10477)
* Changes UMD callsite to be more likely to pass in the intended object.

Fixes #10476
Note: This PR should be considered pseudocode and used as an illustration of the proposed fix.  I do not know nearly enough about this project to know if this is an appropriate solution to the problem, nor do I have the confidence to update the tests appropriately.

* Update tests
2019-10-29 22:19:49 +01:00
Nicolò Ribaudo
143d159982 Create parser plugin "topLevelAwait" (#10449)
* Create parser plugin "topLevelAwait"

* Update test262 whitelist

* Update ts typings

* Fix "sourceType: unambiguous" with TLA

* Ambiguous tokens after await

* Update await %x(0)

* typo [skip ci]

* Typo [skip ci]

Co-Authored-By: Brian Ng <bng412@gmail.com>
2019-10-29 22:18:39 +01:00
Georgii Dolzhykov
63f9a3c946 rename assertsModifier to asserts (#10613)
see https://github.com/babel/babel/pull/10543#issuecomment-547571501
2019-10-29 16:25:42 -04:00
Devon Govett
3a5e8a8dd4 Add support for babel.config.json (#10501)
* Add support for babel.config.json root config

* Throw if multiple configuration files are found

* Add tests
2019-10-29 19:37:50 +01:00
Tan Li Hau
38a3063111 add assertions signature for TypeScript (#10543)
* add asserts predicate

* fix flow

* babel-generator for typescript assertions

* babel-types for typescript assertions

* asserts modifier as boolean
2019-10-29 18:51:33 +01:00
Nicolò Ribaudo
4cd93ab5f3 [parser] Enable "exportNamespaceFrom" by default (#10521) 2019-10-29 18:44:32 +01:00
Eugene Myunster
d248e2d188 moving proposalNullishCoalescingOperator and proposalOptionalChaining to stage 3 (#10590) 2019-10-29 18:44:01 +01:00
Nicolò Ribaudo
f47fbd5f39 Nit: Use ?. in the example used by the proposal readme (#10604) 2019-10-29 18:35:15 +01:00
Bogdan Chadkin
be0fcaaf49 Make dir for babel --out-file (#8622)
* Make dir for babel --out-file

Currently there's unexpected regression after upgrade from babel 6.
On creating file with any depth like dist/index.js the error about
not existing directory is thrown.

In this diff I modified babel-cli to create deep directory for out-file
command.

I also replaced `mkdirp` with more supported `make-dir` package which
also have official promise support.

* Fix test
2019-10-29 18:29:45 +01:00
彭驰
4e5ac1fd5c Fix #8326, add back --quiet option. (#10399)
* Fix issue #8326, quiet the @babel/cli with --quiet cli option.

* --quiet and --verbose options now conflict with each other.
2019-10-29 18:28:52 +01:00
Nicolò Ribaudo
1d1fab4ea2 [parser] Add support for private fields in TypeScript (#10483)
* [parser] Add support for private fields in TypeScript

* Fix flow
2019-10-29 18:27:54 +01:00
Simen Bekkhus
f1bc6c4e18 feat: if code frame error is on a single line, highlight the w… (#10361)
* feat: if code frame error is on a single line, highlight the whole path

* flow
2019-10-29 18:23:54 +01:00
gr
b6ef9689b2 [parser] Parse only modifiers of actual methods (#10594)
* Parse only modifiers of actual methods

* Throw question token if is used before the real name
2019-10-29 17:56:05 +01:00
Huáng Jùnliàng
01927babe2 chore: update web.immediate support fixtures (#10612) 2019-10-29 16:23:59 +01:00
Mateusz Burzyński
9ada30c207 Use .find instead of .filter to get targetPath in ImportInjector (#10608) 2019-10-27 15:09:03 -04:00
ExE Boss
43065a9e24 fix(babel‑helpers/interopRequireWildcard): Avoid double nullis… (#10585)
* fix(babel‑helpers/interopRequireWildcard): Avoid double nullish check

* Update fixtures
2019-10-24 23:14:44 +02:00
Brian Ng
fce1b74105 Test node@13 on CircleCI (#10600) 2019-10-24 09:28:01 -04:00
Huáng Jùnliàng
562b6c3bbb chore: replace outdated travis-ci.org badges [ci skip] (#10593) 2019-10-22 21:35:02 -04:00
Huáng Jùnliàng
1770dace34 chore: test against Node.js 13 (#10591) 2019-10-23 00:23:20 +02:00
Matthew Whitworth
5b40845afe add test and fix for string literal case (#10578) 2019-10-21 17:39:03 +02:00
samuel kwok
fe258dec04 fix: _interopRequireWildcard should only cache objects (#10574)
* fix: [#10561] _interopRequireWildcard should cache object only

* fix: narrow down cache restriction to object/function type

* test: add interop require null module case
2019-10-19 12:01:38 +02:00
Nicolò Ribaudo
78cd63d9cf Fix invalid test layout in @babel/parser 2019-10-18 11:16:17 +02:00
Nicolò Ribaudo
43b623c1f1 [traverse] Allow skipping nodes inserted with .replaceWith() (#9777)
* Avoid regression
2019-10-18 00:16:35 +02:00
Daniel Arthur Gallagher
b5b8055cc0 docs: add homepage link to @babel/runtime package.json (#10418)
* docs: add homepage link

Adds a homepage link to populate npmjs.com.
Update the repository property syntax.

* Update the repository link

Point to the root repo plus a reference to the subdirectory.

* style: drop HTML extension
2019-10-17 23:26:14 +02:00
Jaideep Bhoosreddy
da9c9a64c2 Add master branch workflow for test262 tests (#10556)
The results of these tests will be stored in build artifacts which will be used to compare with test262 runs on PR (future work!). Robin has also done a
lot of work to ensure all babel packages are properly linked to the
test runner. Additionally, Nicolo has helped in mentorship and
contributions to babel-test262-runner which is used here.

We're no longer giving xunit output to CircleCI because once it sees failing tests it will mark babel's master as broken. As a stopgap, it will render the test results in the mocha spec format, which is human readable.

Co-Authored-By: Robin Ricard <rricard2@bloomberg.net>
Co-Authored-By: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2019-10-17 13:52:31 -04:00
Huáng Jùnliàng
8c94b3f209 Bump babel-types to ^7.6.3 (#10568)
* fix incorrect lerna bootstrap options

* chore: bump @babel/types dependencies to v7.6.3

* chore: remove ignore-engines on lerna bootstrap
2019-10-17 07:49:41 -04:00
gr
095f28a913 fix: Exclude catch clause from let identifier error (#10559)
* Exclude catch clause from let identifier error

* Disallow let binding based on parameter

* Add test

* Remove unused getter

* Update packages/babel-parser/src/parser/statement.js

Co-Authored-By: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2019-10-17 09:30:36 +02:00
Huáng Jùnliàng
487f10f84d fix: disable caching when babel could not read/write cache (#10557)
* fix: disable caching when babel could not read/write cache

* emit warning when cache folder resides in readonly fs

* fix: always register save handler

* cache: maintain old behaviour

* test: add more test case

* fix: next tick tasks are FIFO

* test: disable test on Windows
2019-10-17 09:30:01 +02:00
piotr
5800fc97b3 [parser] Exception to 8 and 9 in tagged template (#10567) 2019-10-17 00:01:22 +02:00
Nicolò Ribaudo
2254542010 Don't use deprecated "lerna publish --require-scripts" (#10558) [skip ci] 2019-10-16 22:13:21 +02:00
Brian Ng
d234ff6572 Revert "chore: introduce envinfo into environment section (#10553)" (#10564)
This reverts commit 800eccc046.
2019-10-16 10:56:35 -04:00
Huáng Jùnliàng
800eccc046 chore: introduce envinfo into environment section (#10553)
* chore: introduce envinfo into environment section [skip ci]

* Apply suggestions from code review

Co-Authored-By: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>

* Address review comments from Nicolò

* Update .github/ISSUE_TEMPLATE/Bug_report.md [skip ci]

Co-Authored-By: Brian Ng <bng412@gmail.com>

* chore: simplify issue template [skip ci]
2019-10-16 09:12:13 -05:00
Gerald
cd5d3abc32 fix: String#italics is incorrectly defined in babel-preset-env (#10563) 2019-10-16 09:23:47 -04:00
Nicolò Ribaudo
272d85d0ad Inject core-js@3 imports in Program:exit instead of on post() (#10146)
* Inject corejs3 imports in Program:exit instead of post

This allows them to be requeued and transformed by other plugins.

* Also entry

* Rebase

* Update packages/babel-preset-env/src/polyfills/corejs3/entry-plugin.js [skip ci]

Co-Authored-By: Brian Ng <bng412@gmail.com>
2019-10-15 23:46:10 +02:00
Nicolò Ribaudo
686186cabc Attemp fixing @babel/node and cli errors on Travis on Windows (#10547)
For some reason, it looks like that the rimraf call didn't properly delete
the folder:

   EEXIST: file already exists, mkdir 'C:\Users\travis\build\babel\babel\packages\babel-node\test\tmp'
      150 |   process.chdir(__dirname);
      151 |   if (fs.existsSync(tmpLoc)) rimraf.sync(tmpLoc);
    > 152 |   fs.mkdirSync(tmpLoc);
          |      ^
      153 |   process.chdir(tmpLoc);
      154 | };

Lets try to reuse the existing folder rather than deleting and recreating it
2019-10-15 23:00:23 +02:00
Alejandro Sánchez
06313a6288 Allow duplicate __proto__ keys in patterns, simple case (#6705) (#10532)
* Allow duplicate __proto__ keys in patterns, simple case (#6705)

* Update test262 whitelist

* Rename checkDuplicatedProto's parameter and adjust type

* Store first __proto__ redefinition's position
2019-10-15 00:18:33 +02:00
Huáng Jùnliàng
dcf7d89b8e fix: remove filename annotation in buildCodeFrameError (#10539) 2019-10-14 18:19:55 +02:00
Nicolò Ribaudo
1b19608a5a Update fixtures for core-js new version 2019-10-14 00:59:02 +02:00
Brian Ng
e28c8ac612 Fix generator missing parens around an arrow returning function type (#10519) 2019-10-11 21:22:42 -04:00
Nicolò Ribaudo
99035ca96e Don't use args rest/spread to hoist super method calls (#9939)
* Don't use args rest/spread to hoist super method calls

* Hoist this in hoisted super method calls

* Make the code more readable

Review by edoardocavazza
2019-10-11 10:18:54 +02:00
Babel Bot
c455d2af86 Add v7.6.4 to CHANGELOG.md [skip ci] 2019-10-10 14:30:50 +00:00
Nicolò Ribaudo
a422ea64ee v7.6.4 2019-10-10 16:25:04 +02:00
Nicolò Ribaudo
34d30e28d6 Revert "chore: Upgrade source-map to 0.6.1 (#10446)" (#10536)
This reverts commit cc080417b9.
2019-10-10 09:03:49 -05:00
Huáng Jùnliàng
3ad4c70d3a fix prepublish-build (#10530) 2019-10-09 07:40:02 +02:00
Nicolò Ribaudo
34937f13d5 Trailing comma after rest - The final fix (#10491)
* [parser] Track trailing commas in extras instead of state

* Update existing tests

* Update test262 whitelist

* Improve error message and location

* nit

* Use lookaheadCharCode
2019-10-08 23:08:50 +02:00
Babel Bot
c7add11fdc Add v7.6.3 to CHANGELOG.md [skip ci] 2019-10-08 19:33:00 +00:00
Nicolò Ribaudo
d329156ebc v7.6.3 2019-10-08 21:31:40 +02:00
Nicolò Ribaudo
25b35261ca Update test262 [skip ci] 2019-10-08 20:39:07 +02:00
Huáng Jùnliàng
563874c06c Do not remove let bindings even they are wrapped in closure (#10343)
* fix: should not remove let binding even it is wrapped in closure

Fixes #10339

* fix: remove bindings defined in blockScope when wrapped in closure

* Move test assertions to the top level to ensure that they run
2019-10-08 19:43:12 +02:00
Tan Li Hau
b0acfb24dd add scope to TSModuleDeclaration (#10119) 2019-10-08 19:35:40 +02:00
Nicolò Ribaudo
599d2ff324 Update yarn.lock [skip ci] 2019-10-08 19:16:36 +02:00
Huáng Jùnliàng
0856618ed5 perf: replace lookahead by lookaheadCharCode (#10371)
* perf: replace lookahead by lookaheadCharCode

* fix: flow ignore

* refactor: add nextTokenStart method

* refactor: duplicated isNewLine code

* refactor: remove lookahead usage from babylon core
2019-10-08 19:09:05 +02:00
Jessica Franco
bc0966a46f Add declarations for more of @babel/types exports (#10504)
This adds lots of missing declarations to the types of @babel/types,
including many utility functions useful to plugin authors.

With the typescript types, I tried to make them as useful as possible
for control flow analysis / inference, but Flow doesn't seem to
support overloads and I'm not as familiar with it anyway so it has
simpler types.
2019-10-08 19:07:57 +02:00
Nicolò Ribaudo
3498195ae2 Do not hoist jsx referencing a mutable binding (#10529) 2019-10-08 18:50:03 +02:00
Henry Zhu
fbf3cb0ac4 Misc: also lock old PRs [skip ci] (#10524) 2019-10-03 15:46:07 -05:00
Brian Ng
e6264a0992 Bump jest@24.9.0 (#10520) 2019-10-02 18:32:34 -05:00
Huáng Jùnliàng
0b37ab0362 Use make -j for parallel build (#10506)
* build: add build-babel-types task

* chore: revamp Makefile to for parallel builds

* chore: style fix

* chore: skip install step as we handle yarn in makefile

* test job execution order
2019-10-03 00:17:04 +02:00
Brian Ng
57ae306457 Bump flow@0.108.0 (#10516) 2019-10-02 12:13:58 -05:00
David J. Hamilton
fa5a40c8d5 assertNoDuplicates throw with more context (#10419)
When users see errors like

```
Duplicate plugin/preset detected.
If you'd like to use two separate instances of a plugin,
they need separate names, e.g.

  plugins: [
    ['some-plugin', {}],
    ['some-plugin', {}, 'some unique name'],
  ]
```

It can be difficult to determine the source of the conflict, especially
in a larger build system.

This commit outputs what is known about the plugins that actually
conflict, which can be helpful for users to determine the root cause of
the conflict.

Partially addresses #9778
2019-10-02 16:45:03 +02:00
Nicolò Ribaudo
a219b6de7a Disallow await inside async arrow params (#10469)
* Disallow await inside async arrow params

* Use -1 as default for awaitPos/yieldPos
2019-10-02 07:37:40 +02:00
Huáng Jùnliàng
fa5057f9fb Flow: interface identifier should be declared in the scope (#10220)
* fix: typo

* declare name for flow interface

* add test case for export overload function, typescript

* test: add test

Fixes #10044

* test: update test

* test(flow): add multiple declarations regression test

* re-enable flow test case

# Conflicts:
#	packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/def-site-variance/input.js
#	packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-declare-statements/input.js
#	packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-interfaces-module-and-script/input.js
#	packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-iterator/input.js

* test: disable two flow dupl-decl test

* fix: do not declare name for declare function until we figure out a better way

* test: duplicate declare function and function would not throw
2019-10-02 07:32:42 +02:00
Brian Ng
02f2d17e83 Revert "Try different name for used-by feature again [skip ci]" (#10515)
This reverts commit b351f29033.
2019-10-01 23:29:04 -04:00
Henry Zhu
b351f29033 Try different name for used-by feature again [skip ci] (#10513) 2019-10-01 21:36:22 +02:00
Huáng Jùnliàng
298c9a6c33 Add filename to transform error (#10511)
* polish: use “unknown” as a default filename in buildCodeFrameError

* feat: add filename to transform error

* fix: incorrect warning message

* fix: add filename to generate phrase error message

* address review comment from Nicolò
2019-10-01 17:19:29 +02:00
Nicolò Ribaudo
80d99b4d4e Do not allow member expressions to start async arrows (#10332)
* Do not allow member expressions to start async arrows

* Boolean -> boolean
2019-10-01 11:40:42 +02:00
Huáng Jùnliàng
94fcabc4e3 Update test262 whitelist 2019-09-30 11:37:09 -04:00
Huáng Jùnliàng
5f1970433d chore: only apply lazy cjs module transform on cli and core (#10443) 2019-09-27 16:53:27 -04:00
Nicolò Ribaudo
b459f6a0a4 Add windows to travis (#10249)
* Add windows to travis

* Update

* Do not use sh file on windows

* Fix whitespace

* Unify command

* ./ doesn't work on windows

* Remove all ./ usages

* Run windows test before others

* fix: normalize filename when generating sources

sources should be URL.

* fix: replace normalized path to cwd

* chore: add nodePlatform task options

* fix: normalize preset-env filename output

* chore: replace normalized path to CWD on win32 platform

* limit transform-react-source to run on linux and darwin

* test: escapeRegExp on testcases

* test: add test for babel --filename on windows

* test: double babel-node/cli test timeout

* chore: workaround windows build does not stop

* chore: remove redundant condition

* refactor: rename `nodePlatform` to `os`
2019-09-26 20:59:17 +02:00
Michael J. Currie
66062c2a8c Template literal validation (#10492)
* add template literal validation

* avoid null/undefined error when validating

* simplify validation logic and fix tests

Co-authored-by: Michael J. Currie <michaeljcurrie136@gmail.com>
2019-09-26 19:58:36 +02:00
Phoenix
8d4f95de45 Fix grammar in doc/design/monorepo.md 🤓 (#10496) [skip ci] 2019-09-26 12:37:15 +02:00
Nicolò Ribaudo
d0f093e716 Update test262 whitelist 2019-09-25 02:03:58 +02:00
Gonzalo Rodríguez
490798a26d [parser] Disallow numeric separators in legacy octal like inte… (#10493)
* Disallow numeric separators in lols

* Update whitelist

* Rename test

* Better syntax when checking
2019-09-25 01:32:50 +02:00
Nicolò Ribaudo
eaa1474541 Enable optional chaining and nullish coalescing plugins (#10494)
* Add optional chaining plugin

* Nullish coalescing
2019-09-24 23:11:56 +02:00
Nicolò Ribaudo
0e9502685a [parser] Don't crash on comment after trailing comma after eli… (#10490) 2019-09-24 17:08:58 +02:00
Huáng Jùnliàng
26be14b24d chore: add access: public where missing (#10489) [skip ci]
* @babel/types
* @babel/plugin-transform-named-capturing-groups-regex
2019-09-24 14:04:54 +02:00
Huáng Jùnliàng
6f3460c767 chore: add access: public to babel parser publish config (#10487) [skip ci] 2019-09-24 10:03:07 +02:00
Corey Farrell
cc080417b9 chore: Upgrade source-map to 0.6.1 (#10446) 2019-09-24 02:01:32 +02:00
Nicolò Ribaudo
a00f371610 Update v7.6.2 changelog [skip ci] 2019-09-23 23:27:03 +02:00
Babel Bot
af66d521bd Add v7.6.2 to CHANGELOG.md [skip ci] 2019-09-23 21:16:32 +00:00
Nicolò Ribaudo
b9cb4af953 v7.6.2 2019-09-23 23:14:37 +02:00
Gonzalo Rodríguez
69d00dc5b0 [parser] Invalid NonOctal Decimal (#10467)
* Add test

* Add nonOctalDecimal verification

* Update regex and code style

* Refactor non octal detection

* Add numeric separator test

* Disallow numeric separators in non octals

* Update whitelist

* Better test naming

* Disallow numeric separators in non oct for all numbers

* Specific error above the general error

* Add test for invalid leading zero in num separator

* Add start position to error
2019-09-23 23:07:52 +02:00
Ivan Medina
f339d2d034 [parser] Disallow numeric separator in unicode scape sequences (#10468)
* [parser] Disallow numeric separator in unicode scape sequences (#10460)

* raise error only when numeric separator plugin is set

* Adds argument for checking numeric separator

* Fix condition for readability

* Add test for hex escape sequence and rephrase error message

* Remove exposure for allowNumSeparator in readHexChar method
2019-09-23 22:47:18 +02:00
Nicolò Ribaudo
3069747a81 Leave trailing comments after handling a possible trailing com… (#10445)
* Leave trailing comments aftre handling a possible trailing comma

* perf
2019-09-23 19:14:43 +02:00
Tomer Aberbach
962015f7e7 docs: updates docs of findParent and find (#10479) [skip ci]
Makes the documentation of `findParent` and `find` consistent and documents their `null` cases.
2019-09-22 23:00:13 +02:00
Vivek Nayyar
b7333ea97a added check to disallow super.private variable access and test case added (#10472)
* 🚀 added check to disallow super.private variable access and test case added

* ♻️ change the other linting change back to how it was

* ♻️ change the other linting change back to how it was

* ♻️ added newline at the end test output.json file

* ♻️ changed the linting style to the way it was

* ♻️ updated error message, removed super private member access test cases from whitelist of flow and test 262 suite

* ♻️ added newline in output.json
2019-09-21 00:22:37 +02:00
Nicolò Ribaudo
46c70ad734 Update PULL_REQUEST_TEMPLATE.md (#10473) [skip ci] 2019-09-20 11:27:49 -04:00
Nicolò Ribaudo
3a7b6e1c22 Force update of test262-stream
v1.2.0 doesn't support Test262 v4
2019-09-20 12:54:28 +02:00
Guy Waldman
9c1ad0a9f7 [parser] Disallow static fields named constructor (#10461)
* Disallow static fields named `constructor` in a class

    - Disallowed static fields named `constructor` in a class (previously only non-static were disallowed)
    - Updated the text for the error for one consolidated warning, for both static and non-static fields
    - Added a test
    - Updated an existing test in the `flow` test suite of the parser to reflect the parse error.
  Strangely, the test used to pass and started failing when inlining the `isNonstaticConstructor` method, without any changes.
  In that test, `constructor` was a field, so in theory it should never have passed.
  Would appreciate some feedback on this, as I'm not 100% sure if this is somehow related to Flow

* Update test262 whitelist

* Add comment and fix && operator
2019-09-18 01:19:45 +02:00
Huáng Jùnliàng
87dc201411 refactor: replace regexp-tree by regexpu (#10430) 2019-09-17 17:38:15 -05:00
Nicolò Ribaudo
0ef4972295 Ignore regexp tests from test262 (#10458) 2019-09-18 00:14:27 +02:00
Nicolò Ribaudo
cb881e6b3f [parser] Report escapes in kws only if they won't be used as i… (#10455)
We can do it by tokenizing escaped keywords as normal identifiers, so that they won't
be accidentally used as real keywords.
2019-09-18 00:13:51 +02:00
Nicolò Ribaudo
45a484f0a2 Enable optional chaining in test262 (#10457) 2019-09-17 12:10:57 -05:00
Nicolò Ribaudo
99f4f6c3b0 Update Test262 (#10448) 2019-09-17 02:14:14 +02:00
Nicolò Ribaudo
e4b4831100 Update GitHub actions to v2 (#10441)
* Update GitHub actions to v2 [skip ci]

* Only run when needed for issues [skip ci]
2019-09-16 22:38:12 +02:00
Huáng Jùnliàng
256fa5aa04 chore: bump regexpu-core to version 4.6.0 (#10439)
* chore: update test fixtures

* chore: test against regexpu-core 4.6.0

* chore: bump regexpu-core dependency
2019-09-13 17:51:24 +02:00
Huáng Jùnliàng
0ee2c42b55 chore: add lint-ts rule (#10427) 2019-09-11 20:24:08 +02:00
Huáng Jùnliàng
1b352ca8a1 chore: remove tryResolve dependency (#10428) 2019-09-11 12:25:18 +02:00
Huáng Jùnliàng
53af9e8b7a fix: allow the process to exit naturally (#10400) 2019-09-11 12:24:44 +02:00
Huáng Jùnliàng
af04f40ee0 fix: pass optionLoc when validating plugin object (#10402) 2019-09-11 12:23:20 +02:00
Bryan Wain
98b14843ba Remove babel polyfill dependency of babel-node (#10429) 2019-09-11 01:57:44 +02:00
Huáng Jùnliàng
4395c22f3a Miscellaneous perf tweak (#10421)
* refactor: early return on hot path

* refactor: read next2 only when next is dot

* perf: mini refactor
2019-09-10 19:47:52 +02:00
Nicolò Ribaudo
610d6bdc62 Do not guess relative execution status for exported fns (#10417) 2019-09-10 19:47:27 +02:00
Tan Li Hau
8027dca501 fix object rest in array pattern (#10275)
* fix object rest in array pattern

* update test fixtures

* early return

* use path.stop() at the right path
2019-09-10 15:18:45 +02:00
Huáng Jùnliàng
81831032c3 chore: remove trim-right dependency (#10420) 2019-09-10 15:17:22 +02:00
FND
daf25af47c Fix typo in changelog (#10409) [skip ci]
s/compliancy/compliancy/g - seems both correct and consistent with more
recent occurrences
2019-09-09 09:22:33 +02:00
Nicolò Ribaudo
6a5cee8f27 Remove circular dependency (#10405)
* Remove circular dependency

* Move @babel/runtime test to @babel/runtime
2019-09-08 22:53:42 +02:00
Nicolò Ribaudo
2096d0cfcb Update @babel deps (#10407)
* Update @babel deps

* Add core-js to transform-named-capturing-groups-regex devDeps

* Don't use fixed deps (they were added by yarn)

* Lockfile
2019-09-08 22:53:20 +02:00
Babel Bot
a79fbe62e4 Add v7.6.1 to CHANGELOG.md [skip ci] 2019-09-06 20:55:50 +00:00
Nicolò Ribaudo
381b066bd0 v7.6.1 2019-09-06 22:50:54 +02:00
Matt Forster
15b63bc89e fix(types): correct typescript function headers (#10404)
Flow maybe types state;

> Maybe types accept the provided type as well as null or undefined. So ?number would mean number, null, or undefined.

So in this case, explicitly allow the type, null, or undefined in the
typescript definition.

Fixes #10403
2019-09-06 22:38:21 +02:00
Dword
fc8e14264c Remove process.exit(1) from babel-node (#9758)
Because it breaked graceful shutdown of the sub process.
2019-09-06 14:32:45 -04:00
Babel Bot
7e4f48139c Add v7.6.0 to CHANGELOG.md [skip ci] 2019-09-06 17:36:19 +00:00
Nicolò Ribaudo
cbd5a26e57 v7.6.0 2019-09-06 19:25:16 +02:00
Nicolò Ribaudo
42e5974fd4 Remove old uglify option
It's false by default
2019-09-06 19:24:15 +02:00
Nicolò Ribaudo
735abc0ed8 Update lerna
v3.16 includes https://github.com/lerna/lerna/pull/2185,
which fixes an issue we had in the v7.5 releases
2019-09-06 18:40:06 +02:00
Corey Farrell
aa7678f32a Remove core-js from @babel/register. (#9847)
This module doesn't use core-js at all.
2019-09-06 18:11:38 +02:00
Huáng Jùnliàng
b64cb9aaf1 fix: early return when instance is not iterable (#10396)
* fix: early return when instance is not iterable

* chore: update test fixtures

* fix: gaurd against arguments for old browsers
2019-09-06 18:09:57 +02:00
Huáng Jùnliàng
8da9d8b4b8 feat(errors): validate preset when filename is absent (#10181)
* feat(errors): validate preset when filename is absent

Closes #10154

* fix: test overrides for filename compulsory

* docs: rewrite validate error message

per https://github.com/babel/babel/pull/10181#discussion_r301607986

* polish error message
2019-09-06 18:09:19 +02:00
Tim McClure
3e4889d649 Class Private Static Accessors (#10217)
* Remove error for static private accessors

* Private static accessors strict

* Add loose mode support

* Move `value` decl for early return

* Reuse getter/setter template

* Reuse getter/setter templates

* Use `buildUndefinedNode` in accessor templates

* Extract `isAccessor` variable
2019-09-06 18:08:10 +02:00
Huáng Jùnliàng
da0af5fd99 V8intrinsic syntax plugin (#10148)
* feat: v8intrinsic syntax plugin

Implement V8 Intrinsic Syntax Extension. Here we check the execution branch inside the parseSubscript to make sure the V8IntrinsicIdentifier is immediately followed by a call expression.

* feat: disable combining placeholders and v8intrisic

per https://github.com/babel/babel/issues/10104#issuecomment-506950969

* test: add more error cases

* refactor: parse v8 intrinsic in parseExprAtom

This approach is identical to V8’s implementation. Move the test cases as the behaviour changes.

* fix: plugin-name typo

* test: add yield-expression test case

* feat: require startsExpr on modulo for v8intrinsic

* perf: skip eof and braceR check as they must return false

* Print V8IntrinsicIdentifier

* feat: add v8intrinsic to parser typings

* Add generated type helpers

* fix: incorrect type definition

* fix: allow V8IntrinsicIdentifier to be callee
2019-09-06 17:43:19 +02:00
Vivek Nayyar
b02e35c19a Fix parenthesis for nullish coalescing (#10269)
* ♻️ added condition to check for left and right of nullish coalescing operator and if any is a logical expression without a paren then throw an error

* 🐛 bugs fixed and test cases updated for babel parser

* ♻️ code comments added

* 🐛 spell error rectified

* ♻️ failing test updated

* 🐛 push tests after make build

* Skip nullish-coalescing flow precedence tests

They're now incorrect

* ♻️ error message updated, binop priority of other logical operators +1 from ?? and

* ♻️ increaed the binOp for in and instanceOf, added logic to print the brackets in an ?? && || expression, test cases added

* 🐛 failing test fixed and comments updated

* ♻️ new lines added between tests

* ♻️ basic tests for checking the binOp of instanceOf, in and relational operators to be equal added

* ♻️ new lines added in between tests
2019-09-06 17:35:44 +02:00
Nicolò Ribaudo
3e8a5c5e28 Use "validateLogs" for preset-env's debug fixtures (#10401)
* Add ability to ignore output to the test runner

* Use normal fixtures instead of custom debug-fixtures in preset-env
2019-09-06 17:32:20 +02:00
Bin Xin
8769903284 Add supports for polyfill computed methods (#10398) 2019-09-06 01:35:03 +02:00
Bin Xin
5c859b1117 Don't polyfill if evaluation is not confident (#10397) 2019-09-06 00:29:19 +02:00
Huáng Jùnliàng
2e7bea4a6a fix: transform name capturing regex once (#10395)
* fix: transform name capturing regex once

* refactor: early return when pattern contains only lookbehind

* chore: simplify test regex

* chore: run test on >=8.0.0
2019-09-05 17:35:57 +02:00
Bin Xin
29734b924a Don't allow instance properties transformation on namespace (#10372) 2019-09-05 10:32:57 -05:00
Huáng Jùnliàng
6813ee02d7 chore: update regexp-tree to version 0.1.13 (#10376) 2019-09-05 10:07:18 -05:00
Adam Ramberg
fcb77de901 [preset-env] Include / exclude module plugins properly (#10218)
* Include / exclude module plugins properly

* Use filter-items to excl / incl module plugins

* Move transform selection to getModulesPluginNames

* Remove unnecessary spread operator

Co-Authored-By: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>

* Adjust tests to changes in #10218
2019-09-05 15:58:29 +02:00
Ajay Sagar
d05bd9edc8 Bumped chokidar dependency of babel-cli to 2.1.8 (#10394) 2019-09-04 21:33:31 -04:00
Nicolò Ribaudo
27ba292774 Silence remaining test warnings (#10392) 2019-09-04 22:56:47 +02:00
Tan Li Hau
a08e856804 fix typescript for babel-types (#10098)
* fix typescript for babel-types

* fix missing typescript/flow types for babel-types

* Add cloneNode to flow.js

* Add cloneNode to typescript.js
2019-09-04 15:35:19 +02:00
Shrey Banga
c0e3fa0081 Refactor trailing comma comment adjustment (#10380)
* Refactor trailing comment adjustment

Following up from https://github.com/babel/babel/pull/10369

- Unify the logic for adjusting trailing comments into a separate
  function
- Use it for all three cases, which fixes a bug for ObjectExpressions
  and CallExpressions
- Update tests to check for the fixed bug

* Fix tests

- Only modify trailingComments if necessary
- Update snapshots of a couple of affected tests

* Drop the underscore in adjustCommentsAfterTrailingComma_

* Handle ArrayPattern

* Handle ObjectPattern

* Handle import and export declarations

These have to be handled a bit differently, because the  node is visited after the  and before the declaration. So we intercept when we are going from the last specifier to the source node.

* Remove unnecessary check
2019-09-02 20:35:15 -04:00
Dylan Kirkby
e5afa57cca Allow setting 'allowNamespaces' in typescript preset (#10382)
* Support 'allowNamespaces' in typescript preset

* Remove default for allowNamespaces
2019-09-02 20:33:01 -04:00
Thiago Arrais
e7fa566442 Includes test for #8354 (#10385) 2019-09-02 21:58:54 +02:00
Nicolò Ribaudo
7c0333e12a Move preset-env old changelog
Fixes #9730
2019-09-02 12:41:55 +02:00
Shrey Banga
8a775a32ba Retain trailing comments in array expressions (#10369)
* Retain trailing comments in array expressions

This is a proposed fix for https://github.com/babel/babel/issues/10368
with a simple test.

* Move lastElement in the block where it's used

* Test trailing comment after array expression

* Don't move comments after the array expression

* Retain trailing comment after the array expression
2019-08-28 14:03:37 -04:00
dependabot[bot]
94e47c30a9 Bump eslint-utils from 1.4.0 to 1.4.2 (#10370)
Bumps [eslint-utils](https://github.com/mysticatea/eslint-utils) from 1.4.0 to 1.4.2.
- [Release notes](https://github.com/mysticatea/eslint-utils/releases)
- [Commits](https://github.com/mysticatea/eslint-utils/compare/v1.4.0...v1.4.2)

Signed-off-by: dependabot[bot] <support@github.com>
2019-08-27 09:50:33 +02:00
Justin Ridgewell
1664cce681 Don't allow JSXNamespacedName to chain (#10366)
Eg, `namespace:foo.bar` used to parse but is invalid in the [spec](https://facebook.github.io/jsx/).

Also, allow `JSXNamespacedName` in the `JSXOpeningElement`/`JSXClosingElement` builders.
2019-08-26 13:16:22 -04:00
Nicolò Ribaudo
a2bf68981f Add TSBigIntKeyword to @babel/types (#10341) 2019-08-20 17:31:45 -05:00
Nicolò Ribaudo
15aa511b8e Do not register ambient classes to the TS scope (#10352) 2019-08-20 17:22:47 -05:00
Henry Zhu
11ed2e2bf5 readme: links/contributing updates (#10206) [skip ci]
* readme: links/contributing updates

* Update README.md
2019-08-19 09:31:37 +02:00
Even Alander
eb3767d58b Add a builder definition including name for tsTypeParameter (#10319) 2019-08-15 19:59:08 +02:00
Nicolò Ribaudo
f0c2364d01 Do not delete "fake" source map comments from strings (#9960)
Instead of using `convert-source-map`'s `removeComments` method before
parsing the file, we can first parse the file with `@babel/parser` and then
analyze the comments.
This is needed because it is not possible to reliabily detect comments in
JavaScript without fully parsing the file:
https://github.com/thlorenz/convert-source-map/issues/63
2019-08-14 17:05:55 +02:00
Huáng Jùnliàng
ee344c3e4c Revert "chore: remove FORCE_COLOR workaround" (#10336)
This reverts commit 347ee036becdca3c9e158311d44a48ed89df9a94.
2019-08-14 16:58:01 +02:00
Ziad El Khoury Hanna
64041e1669 Fix flow comments plugin issues (#10329)
* Fix issues in flow-comments to preserve comments and there order (fixes #10324)

* Add support in flow-comments for extends in class declarations (fixes #10323, #10321)

* Refactoring and cleanup of flow-comments plugin

* Fix comments preservation logic of flow-comments

* Fix flow-comments where comments are class identifier and extends keyword
2019-08-14 15:46:26 +02:00
Nicolò Ribaudo
469a5a71cd Allow testing logs with @babel/helper-transform-fixture-test-runner (#10326)
* Add support for logs to transform-fixture-test-runner

* Test some warnings

* Use stderr/stdout, and add a validateLogs test option

* Normalize CWD in logs and rename vars

* Silence preset-env tests

* Restore old methods
2019-08-14 08:03:03 +02:00
Huáng Jùnliàng
75090f10e5 fix: assign comment to ObjectProperty only when inside an ObjectExpression (#10292)
Fixes #10230
2019-08-13 13:49:16 -05:00
Huáng Jùnliàng
22df2ae244 Commit generated code (#10331)
* update prettier generated artifacts

* chore: sync babel-helpers to artifacts
2019-08-13 16:31:28 +02:00
Nicolò Ribaudo
051965052c Update @lerna/collect-updates git hash 2019-08-13 12:03:34 +02:00
Thiago Arrais
ee397ff107 Adds note about two approval policy to PR template (#10313)
* Adds note about two approval policy to PR template

* Adds qualifier to approval policy

Because, although two approvals is the general case, some PRs maybe merged with more or fewer approvals

[skip ci]
2019-08-12 17:32:31 +02:00
Huáng Jùnliàng
15535cf52c Update preset-env text fixtures (#10318)
* chore: update preset-env text fixtures

* chore: remove FORCE_COLOR workaround
2019-08-12 00:55:27 +02:00
README Bot
682d9f9f09 Add CodeTriage badge to babel/babel (#10088) [skip ci]
Adds a badge showing the number of people helping this repo on CodeTriage.

[![Open Source Helpers](https://www.codetriage.com/babel/babel/badges/users.svg)](https://www.codetriage.com/babel/babel)

## What is CodeTriage?

CodeTriage is an Open Source app that is designed to make contributing to Open Source projects easier. It works by sending subscribers a few open issues in their inbox. If subscribers get busy, there is an algorithm that backs off issue load so they do not get overwhelmed

[Read more about the CodeTriage project](https://www.codetriage.com/what).

## Why am I getting this PR?

Your project was picked by the human, @schneems. They selected it from the projects submitted to https://www.codetriage.com and hand edited the PR. How did your project get added to [CodeTriage](https://www.codetriage.com/what)? Roughly over 3 years ago, [iamsolankiamit](https://github.com/iamsolankiamit) added this project to CodeTriage in order to start contributing. Since then, 94 people have subscribed to help this repo.

## What does adding a badge accomplish?

Adding a badge invites people to help contribute to your project. It also lets developers know that others are invested in the longterm success and maintainability of the project.

You can see an example of a CodeTriage badge on these popular OSS READMEs:

- [![Email clients like GMAIL do not render SVG images](https://www.codetriage.com/rails/rails/badges/users.svg)](https://www.codetriage.com/rails/rails) https://github.com/rails/rails
- [![Email clients like GMAIL do not render SVG images](https://www.codetriage.com/crystal-lang/crystal/badges/users.svg)](https://www.codetriage.com/crystal-lang/crystal) https://github.com/crystal-lang/crystal

## Have a question or comment?

While I am a bot, this PR was manually reviewed and monitored by a human - @schneems. My job is writing commit messages and handling PR logistics.

If you have any questions, you can reply back to this PR and they will be answered by @schneems. If you do not want a badge right now, no worries, close the PR, you will not hear from me again.

Thanks for making your project Open Source! Any feedback is greatly appreciated.
2019-08-09 19:18:18 +02:00
Serge Havas
a112be2fa0 [fix] jsx helper calls order (#10307)
imitate properly react createElement calls order
2019-08-08 22:43:57 +02:00
ifsnow
9ec26a7d3e Improves the logic to import objects in helpers (#10161)
* Improves the logic to import objects in helpers

* Modified to work with more cases.

* Modified by considering exception cases

* Fixed not using bundler's polyfill

Co-Authored-By: Jordan Harband <ljharb@gmail.com>

* Updated test output files

* Changes to cache logic

* Modified to use if statement
2019-08-08 11:11:50 +02:00
Thiago Arrais
ba2c0f7adf fix: register inserted class declaration (#10302)
* Decorators legacy: register inserted declaration

For compatibility with the Typescript plugin

Fixes #10264

* Register declaration but also keep replaceWithMultiple
2019-08-08 07:14:23 +02:00
Huáng Jùnliàng
5fb4d84a33 perf: always return void 0 as undefined node (#10243) 2019-08-01 09:53:40 +02:00
Tan Li Hau
3e4a9d588b Do expressions transform for switch statements (#10070)
* lint fix

* switch inside do expression

* review comments

* review comments

* make min diff

* adding more test

* review changes

* review changes

* handle block statement and added more test cases

* fix implementation and add more test cases

* fix last swtich case

* disable block fallthrough case

* fix nitpick reviews
2019-08-01 09:36:35 +02:00
Tan Li Hau
be2cbde560 remove finally from completion record in trystatement (#10277) 2019-08-01 09:24:08 +02:00
Ashwin Ramaswami
66727632e8 fix: replace es.string.reverse with es.array.reverse (#10284) 2019-08-01 09:20:52 +02:00
Brian Donovan
ba28f462bc Fix typo "to" → "so". (#10288) 2019-07-31 16:04:53 -04:00
Huáng Jùnliàng
f08062b1de chore: fix ESLint errors (#10278) 2019-07-29 10:14:11 -05:00
Daniel Tschinder
4f0840ab88 Update dev dependencies and fix linting errors (#10228)
* chore: Uppate dev dependencies

* chore: Fix lint errors

* chore: Format options.json files

* chore: Fix stupid flow errors

* Update test262 whitelist

Seems test262-stream was updated and now these tests work.
2019-07-27 15:09:30 +02:00
Tan Li Hau
6a9d2538e0 fix capturing group for matchAll (#10136)
* fix capturing group for matchAll

* update test case

* add core-js/features/string/match-all to test
2019-07-26 18:53:22 -04:00
Letladi Sebesho
f160522ab0 updated ParsePlugin type definition (#10259)
* added 'placeholders', 'logicalAssignment', 'partialApplication' to the ParserPlugin type. closes #10186

* put the ParserPlugin names in alphabetical order
2019-07-26 10:22:23 +02:00
Serhii Muryhin
4d30379d36 Add ";" token to the end of TS construct & call signature declaration (#10258)
* Add ";" token to the end of TS construct signature declaration

* Add ";" token to the end of TS call signature declaration. Update construct signature test fixtures
2019-07-25 10:14:35 +02:00
Letladi Sebesho
4d12c8971b added flow to babel cli (#10244)
* added flow to babel cli

* added 'SourceMapGenerator' as a argument to 'fromObject'
2019-07-25 09:59:41 +02:00
Yuri Karadzhov
4506590557 Add static parameter to class property builder (#10248) 2019-07-25 09:55:03 +02:00
Brian Donovan
1e7ed5c461 Add allowUndeclaredExports option to typings. (#10263)
This should have been included in https://github.com/babel/babel/pull/9864 but was not.
2019-07-25 09:53:56 +02:00
Nicolò Ribaudo
fced5cea43 Fix tdz checks in transform-block-scoping plugin (#9498)
* Better tdz tests

- Use jest's expect.toThrow/expect.not.toThrow
- Add input/output tests

* Fix basic tdz (a = 2; let a)

Fixes #6848

* Make _guessExecutionStatusRelativeTo more robust

* Add tests

* Return less "unkown" execution status

* "function" execution status does not exist

* Fix recursive functions

* Update helper version

* "finally" blocks are always executed

* Typo
2019-07-21 06:34:43 +02:00
Nicolò Ribaudo
9bc9571381 Extract release actions to babel/actions 2019-07-20 16:43:22 +02:00
Nicolò Ribaudo
fb910e063c [gh action] Release on tag push 2019-07-20 16:39:10 +02:00
Daniel Tschinder
3b4a86aea4 Separate workflows as otherwise they interfere with eachother 2019-07-20 15:26:52 +02:00
Daniel Tschinder
94b678c949 Fix workflow 2019-07-20 15:22:21 +02:00
Daniel Tschinder
c84a4c8bfa Use latest version of filter action 2019-07-20 15:14:07 +02:00
Daniel Tschinder
dfd59c183e Add 'Needs Info' workflow 2019-07-20 15:13:29 +02:00
Nicolò Ribaudo
718017d896 Use "release" event instead of "push" 2019-07-20 14:30:33 +02:00
Daniel Tschinder
a0cb7b1ab1 Rename github action 2019-07-19 15:46:51 +02:00
Daniel Tschinder
0b886418c8 Use github actions for welcome comment 2019-07-19 14:44:40 +02:00
Babel Bot
0371979a3e Add v7.5.5 to CHANGELOG.md [skip ci] 2019-07-17 21:29:47 +00:00
Nicolò Ribaudo
0407f034f0 v7.5.5 2019-07-17 23:08:08 +02:00
Nicolò Ribaudo
d919ecd254 Move lerna fork to the babel org 2019-07-17 00:02:41 +02:00
Daniel Tschinder
d8da63c929 Use correct extension for typescript fixtures (#10014)
* Use correct extension for typescript fixtures

* Change transform fixtures

* Adjust editorconfig for ts files

* Rename new tests

Co-authored-by: Nicolò Ribaudo (nicolo.ribaudo@gmail.com)
2019-07-15 22:46:03 +02:00
Tan Li Hau
eb3230f9db fix code-frame marker with highlighting (#10211) 2019-07-15 21:16:18 +02:00
Nicolò Ribaudo
7dc5fdb390 Workaround #10179 in proposal-object-rest-spread (#10200) 2019-07-15 19:01:29 +02:00
Tan Li Hau
ee68d6d1b0 add assertShape to validate templateElement (#10198)
* add assertShape to validate templateElement

* Update packages/babel-types/src/definitions/utils.js

Co-Authored-By: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>

* templateElement optional cooked
2019-07-15 01:03:50 +02:00
Tan Li Hau
d3fe22f0e1 destructuring private fields with array pattern / object patte… (#10017)
* destructuring private fields with array pattern / object pattern

* wip: new test cases

* destrucuring and rest for private properties

* test case for loose private-loose

* add transform-desturcturing for exec

* update test case

* remove getPrototypeOf imports from get and set

* wip: destructure super assignment

* throw "Destructuring to a super field is not supported yet."

* fix tests and fix assignment pattern

* remove CallExpression from AssignmentPattern
2019-07-15 01:00:20 +02:00
James DiGioia
7f47cb65d0 Add Pipeline nodes to ast.spec [skip ci] (#10214) 2019-07-13 19:11:51 +02:00
Tan Li Hau
8b9af1be2f fix transform-flow-comments for import types (#9901)
* fix transform-flow-comments for import types

* update: dependencies
2019-07-13 16:06:42 +02:00
Tan Li Hau
f5ca0587d1 always throw when add missing helpers (#10208) 2019-07-12 12:53:55 -05:00
Sagiv ben giat
a9660cf559 resolve #10205 (#10207) 2019-07-12 11:00:25 -05:00
dependabot[bot]
8107a6faa2 Bump lodash.template from 4.4.0 to 4.5.0 (#10204)
Bumps [lodash.template](https://github.com/lodash/lodash) from 4.4.0 to 4.5.0.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.4.0...4.5.0)

Signed-off-by: dependabot[bot] <support@github.com>
2019-07-12 10:29:48 +02:00
cybai
42000b9907 Upgrade lodash to 4.17.13 (#10191) 2019-07-12 10:29:06 +02:00
Huáng Jùnliàng
5d9a786b2f perf: match ownKeys perf to the one of objectSpread (#10189) 2019-07-10 21:03:01 -05:00
Huáng Jùnliàng
e88a569e83 fix: custom instOfHandler result should be cast to boolean (#10197) 2019-07-10 23:38:46 +02:00
Babel Bot
4eab157502 Add v7.5.4 to CHANGELOG.md [skip ci] 2019-07-09 18:58:16 +00:00
Nicolò Ribaudo
a9a7f4e690 v7.5.4 2019-07-09 20:52:37 +02:00
Nicolò Ribaudo
fa5ec75c43 Fix _objectSpread2 for real (#10188)
* Fix _objectSpread2 for real

* Tests

* Test 2
2019-07-09 20:50:07 +02:00
Babel Bot
b961d39a4d Add v7.5.3 to CHANGELOG.md [skip ci] 2019-07-09 14:52:52 +00:00
Nicolò Ribaudo
759ff4d6df v7.5.3 2019-07-09 16:41:44 +02:00
Nicolò Ribaudo
9e65472377 [_objectSpread2] Do not use hoisted var from prev iteration (#10180) 2019-07-09 16:38:40 +02:00
Babel Bot
25f040caa4 Add v7.5.2 to CHANGELOG.md [skip ci] 2019-07-08 19:53:06 +00:00
Nicolò Ribaudo
0dbf99bedb v7.5.2 2019-07-08 21:46:49 +02:00
Nicolò Ribaudo
f48b47c1f7 Do not trust Scope when removing TypeScript types (#10174)
* Do not trust Scope when removing TypeScript types

* Warn

* Update warning message

Co-Authored-By: Brian Ng <bng412@gmail.com>

* Add test

* Node 6
2019-07-08 21:44:26 +02:00
Nicolò Ribaudo
406a65c894 Don't rely on getOwnPropertyDescriptors in objectSpread2 (#10171) 2019-07-07 11:24:36 +02:00
Huáng Jùnliàng
075a50242d fix: register injected importDeclaration (#10172) 2019-07-06 10:44:14 -05:00
Babel Bot
c777e81e06 Add v7.5.1 to CHANGELOG.md [skip ci] 2019-07-06 08:13:08 +00:00
Nicolò Ribaudo
d0519fa907 v7.5.1 2019-07-06 10:07:59 +02:00
Nicolò Ribaudo
019fbca3f6 Update lerna 2019-07-06 09:57:20 +02:00
Nicolò Ribaudo
24dde2e8e8 Fix objectSpread2 backward compatibility (#10170) 2019-07-06 09:48:36 +02:00
Wesley Wolfe
bff79e198a Retain typescript export-from-source (#10167) 2019-07-05 20:47:55 +02:00
Henry Zhu
106bb41d47 change pkg name back from used-by [skip ci] 2019-07-04 12:30:56 -04:00
Babel Bot
d19f053482 Add v7.5.0 to CHANGELOG.md [skip ci] 2019-07-04 13:00:18 +00:00
Nicolò Ribaudo
49da9a07c8 v7.5.0 2019-07-04 14:52:17 +02:00
Lidor Avitan
b06663320e Update babel-preset-stage (0,1,2,3) readme files (#10111) [skip ci]
* chore: update docs babel-preset-stage readme [ci skip]

* fix:  by PR request change [ci skip]
2019-07-04 12:24:42 +02:00
Tan Li Hau
d50e78d45b fix await and yield for do expression (#10072) 2019-07-03 09:54:39 -05:00
Artem Butusov
5b86353b35 Added es3 backward compatibility for react helper code (#10155)
* Added es3 backward compatibility for react helper code

* tweak comment [skip ci]
2019-07-03 16:49:20 +02:00
Tan Li Hau
f588e4ec47 BigInt type for Flow (#10091)
* flow BigIntLiteralTypeAnnotation

* numericSeparator for flow test plugins

* fix flow tuple

* fix code review
2019-07-03 16:48:46 +02:00
Brian Ng
cbb482e2f9 Bump compat-table and update preset-env mappings (#10127) 2019-07-03 09:37:06 -05:00
Sebastian Johansson
595a349174 Fix incorrect usage of $o instead of %o in debug (#10157)
It would end up printing the literal "$o" instead of the directory name.
2019-07-03 16:04:31 +02:00
Min ho Kim
0bf0ae3410 Fix typos (#10153) 2019-07-03 15:51:48 +02:00
Nicolò Ribaudo
ef3f555be9 Add proposal-dynamic-import to preset-env (#10109) 2019-06-30 13:58:50 +02:00
Nicolò Ribaudo
38f8bbac1a Create @babel/plugin-proposal-dynamic-import (#9552)
* Create @babel/plugin-proposal-dynamic-import

* Use airbnb/babel-plugin-dynamic-import-node

Do not duplicate code, which will unavoidably lead
to bugs being fixed in one plugin and not in the other.

* Update error message

* Add error callback to amd interop

* Update babel-plugin-dynamic-import-node
2019-06-30 13:21:46 +02:00
Thiago Arrais
a4170b5e32 Transform for F# Pipeline (#9984)
* Transform for F#-style await

Inludes support for optimizing single-parameter arrow functions

* Wait until optimization before pushing placeholder into scope
2019-06-30 12:53:22 +02:00
James DiGioia
6b8a37c413 Implement f# pipeline in parser (#9450) 2019-06-30 12:53:22 +02:00
Wesley Wolfe
0a98814329 Implement TypeScript namespace support (#9785)
* Add module tests for typescript namespace transform

Fixes #8244, fixes #10038
2019-06-30 12:15:09 +02:00
Nicolò Ribaudo
8bf9714d69 [legacy decorators] Allow decorating generator methods (#9912)
* [legacy decorators] Allow decorating generator methods

The old proposal used LeftHandSideExpression (instead of
AssignmentExpression) to satisfy this usecase:
e240cbc91a

* Update flow whitelist
2019-06-30 11:32:16 +02:00
Nicolò Ribaudo
ca67637da4 [@babel/parser] Add "allowUndeclaredExports" option (#9864)
Ref: https://github.com/babel/notes/blob/master/2019/04/09.md#export-changes-in-scope-pr-break-meteor-issue
2019-06-30 11:16:05 +02:00
Brian Ng
77fd7cd4c4 Allow defaults query in preset-env (#8897) 2019-06-30 11:00:43 +02:00
Tan Li Hau
1d3f9815df fix import typeof in declare module (#10132) 2019-06-26 13:37:16 -05:00
Letladi Sebesho
31fc1d06bc Babel cli test correction (#10128) 2019-06-25 15:38:32 -05:00
Bogdan Savluk
b8bb93a838 fix exportKind declaration in babel-types (#10126)
* fix exportKind types declaration for ExportNamedDeclaration and DeclareExportAllDeclaration in babel-types

* revert `let` in exportKind in babel-parser types
2019-06-25 22:29:38 +02:00
Erik Arvidsson
8f8a457798 Simplify the helpers for classPrivateField{Get,Set} (#10117)
No need to do the hash lookup twice. If the descriptor is not in the
WeakMap `get` returns `undefined`.
2019-06-22 00:23:26 +02:00
Pig Fang
11fa2461ce Disallow "let" as name at lexical bindings (#10099)
* Disallow "let" as name at lexical bindings

* Simplify

* Clean up
2019-06-18 23:17:00 +02:00
Paul Comanici
505b2cc18d Upgrade jest dependency (#10107) 2019-06-18 16:29:51 +02:00
Sven Sauleau
dcdf7c8fdd [skip ci] docs: update readmes (#10103)
Using our READMEs auto generation, two packages were updated.
2019-06-17 10:57:28 +02:00
Tan Li Hau
fdbbb743b6 flow - allow type parameter defaults in function declarations (#10084)
* flow - allow type parameter defaults in function declarations

* fix flow test

* add intern_comments option

* fix flow parser test

* remove allowdefault from flowParseTypeParameterDeclaration

* rename test cases
2019-06-15 12:31:12 +02:00
Letladi Sebesho
6852bf6415 Change duplicate tests for @babel/highlight getChalk method (#10093)
* removed duplicate tests for @babel/highlight getChalk method

* changed second 'getChalk' test case for when colors are not supported
2019-06-15 09:04:35 +02:00
Jamie Kyle
f92c2ae830 Change root package.json#name (#10021)
* Change root package.json#name

I'm pretty sure GitHub's new Dependants feature is based on this package.json. I'm updating it here so it will reflect the new name for the core package.

* Update package.json
2019-06-04 23:57:38 +02:00
Maël Nison
d7801c644c Prevents exception on PnP (#9951) 2019-06-02 00:55:44 +02:00
Mateusz Burzyński
84961ebb05 Refactor isImportTypeOnly helper function (#10047) 2019-05-31 23:54:44 +02:00
Blaine Bublitz
3144ed131a Use FUNDING.yml in babel/.github repo [ci skip] (#10032) 2019-05-30 09:52:43 +02:00
Martin Zlámal
ce4c374924 Fix printer for explicitly inexact Flow types (#10041)
Closes: https://github.com/babel/babel/issues/10040
2019-05-29 21:17:12 +02:00
Wesley Wolfe
8d492b159b Use scope for typescript export removals. Fixes #10033 (#10034)
This also fixes enum not adding the respective declaration to the scope
during the typescript visitation.

Rewrites:

2080042808 #9944

a6392bd636 #10019
2019-05-29 08:36:04 +02:00
Tan Li Hau
b4c9cb0222 Fixed computed keys for class expression (#10029)
* test case for insertBefore for jsx

* fix unshiftContainer and insertBefore

* use path.scope.push

* add test making sure computedKeys var declaration at the right block

* add comment

* nit [skip ci]
2019-05-28 23:07:55 +02:00
Kagami Sascha Rosylight
a596da2822 Retry to fix object spread helper compatibility (#9384)
This reverts commit 43b83f8ed7.

Fix objectSpread helper breaking old codes

remove tests to regenerate later

renamed output

new name

try using word

add comment as requested

revert inline name changes

add 2 for consistency

Update packages/babel-helpers/src/helpers.js

Co-Authored-By: Daniel Tschinder <daniel@tschinder.de>
2019-05-25 12:57:13 +02:00
Daniel Tschinder
1cfb92d66a Create SECURITY.md (#10018) 2019-05-25 12:46:59 +02:00
Nicolò Ribaudo
888b9f6940 Remove unused code in the TS parser plugin (#10025) 2019-05-25 08:46:01 +02:00
Tan Li Hau
b6486a22cb fix destructuring rest with template literal (#10013)
* fix destructuring rest with template literal

* update test
2019-05-24 00:03:27 +02:00
Airat Aminev
a6392bd636 fix(typescript): erase default export if exporting a TS type (#10019) 2019-05-23 16:58:24 -05:00
Henry Zhu
9dd8825eff Create funding.yml [skip ci] (#10016) 2019-05-23 21:02:16 +02:00
Nicolò Ribaudo
ecf4667305 Add "PR: Performance" label for the changelog (#10011) [skip ci] 2019-05-21 23:17:18 -04:00
Nicolò Ribaudo
87fb6c4a8b Use injectInitialization to generate ts parameter properties (#9610) 2019-05-21 22:28:55 +02:00
Brian Ng
58cf1a7d48 Bump deps (#10007) 2019-05-21 15:10:29 -05:00
Sebastian Silbermann
c96aef17e1 Add #9902 to changelog (#10010) [skip ci] 2019-05-21 21:33:27 +02:00
Babel Bot
fc38638aeb Add v7.4.5 to CHANGELOG.md [skip ci] 2019-05-21 17:49:18 +00:00
Nicolò Ribaudo
33ab4f1661 v7.4.5 2019-05-21 19:38:26 +02:00
Daniel Tschinder
54d257c105 Fix location for optional params in arrow functions (#9998)
* Fix location with optional params in arrow functions

* add test

* Ensure rollup replaces NODE_ENV and create sourcemap in dev

* Ensure finishNod*() is never called twice on a node

* Fix check for already finished nodes
2019-05-21 18:53:13 +02:00
Matthew Robertson
9c06e4ed4d avoid exceptions for control flow (#9974)
* avoid exceptions for control flow

* review feedback: remove conditional because we know it is "<"

* drop tsTryParseTypeArguments method
2019-05-21 17:23:53 +02:00
Daniel Tschinder
f5b8140580 Do not use lookahead when parsing construct signature declarations (#9995) 2019-05-20 23:27:41 -07:00
Daniel Tschinder
0430a48775 Update preset-env dependencies and fix fixtures (#10002)
* Fix fixtures after core-js update

* Update core-js, caniuse and compat-table
2019-05-20 23:27:19 -07:00
Matthew Schupack
45ca6751fa use console.warn for warning (#9992)
* use console.warn for warning

* fix tests
2019-05-18 00:36:18 +02:00
Daniel Tschinder
b1826bf0a0 Only compute Position if not already in state (#9989)
* Only compute Position if not already in state

* Prioritize start locations
2019-05-17 15:32:34 -07:00
Airat Aminev
2080042808 fix(typescript): erase type exports (#9944)
* fix(typescript): erase type exports

* use Set instead of array for tracking and checking TS type declarations

* add a test for an interface exported before its declaration
2019-05-17 07:22:52 +02:00
Daniel Tschinder
3f0590de2a Do not use lookahead when parsing jsx expression containers (#9988) 2019-05-16 17:27:07 -07:00
Daniel Tschinder
5661de5908 Do not use lookahead when parsing imports in declare module in flow (#9987) 2019-05-16 02:31:37 -07:00
Daniel Tschinder
c2d303f8be Do not use lookahead when parsing declare module or declare module.exports in flow (#9985)
* Do not use lookahead when parsing declare module or declare module.exports in flow

* Improve code
2019-05-16 02:31:21 -07:00
Daniel Tschinder
4da7a01aa9 Avoid unnecessary work during lookahead (#9982)
* Do not call pushComment when doing lookahead

* Do no updateContext when doing lookahead

* Do not clone contexts anymore
2019-05-15 17:02:12 -07:00
Daniel Tschinder
47eb1ddfe0 Do not use lookahead when parsing dynamic import or import.meta (#9983) 2019-05-15 16:34:16 -07:00
Nicolò Ribaudo
9febf63882 Fix mobile browsers support in preset-env (#9978)
* Fix mobile browsers support in preset-env

* Update fixtures

* Alias other mobile browsers, since they aren't included by compat-table
2019-05-15 14:05:37 +02:00
Daniel Tschinder
85432e2c44 Remove guardedHandlers from ASTs (#9979) 2019-05-15 03:37:22 -07:00
Nicolò Ribaudo
1969e6b6aa Update regenerator-transform (#9941) 2019-05-07 15:42:12 -04:00
Divyam Bhasin
7942dc0f07 Fixed null error in plugin opts and added a test for it (#9945)
* Fixed null error in plugin opts and added a test for it

* Remove !opts and add opts === null check to avoid confusion with false and undefined cases

Co-Authored-By: divbhasin <divbest99@gmail.com>
2019-05-07 16:23:01 +02:00
Tan Li Hau
354666aa17 fix: allow shebang directive (#9922)
* fix: allow shebang directive

* Update packages/babel-parser/src/plugins/flow.js

* chore: prettier
2019-05-07 16:22:25 +02:00
Nicolò Ribaudo
9e9b62f77a Update regexp-tree (#9940) 2019-05-06 20:11:46 +02:00
Nicolò Ribaudo
5da94bff87 [babel-node] Do not hardcode node flags (#9914) 2019-05-04 23:40:06 +02:00
Sebastian Silbermann
eae7a33316 Fix destructuring assignments being transpiled for edge 15 (#9902)
* Current behavior for preset-env destructuring and edge

* fix(preset-env): destructuring transpiled in edge 15
2019-05-03 23:35:28 +02:00
Pablo Navarro
16e17c560b Add missing space in error messages (#9909) 2019-04-29 19:52:13 +02:00
Nicolò Ribaudo
555d50a08c Generate missing test output 2019-04-26 23:57:06 +02:00
Babel Bot
18ace84b88 Add v7.4.4 to CHANGELOG.md [skip ci] 2019-04-26 21:06:49 +00:00
Nicolò Ribaudo
2c88694388 v7.4.4 2019-04-26 23:00:07 +02:00
Nicolò Ribaudo
4b8546c07d Force publish @babel/runtime-corejs3 [skip ci] 2019-04-26 22:58:38 +02:00
Nicolò Ribaudo
c5b5c83398 Disable "Publish to npm" in the Release workflow (#9911) [skip ci]
GitHub actions are too slow for this, it takes more than 15 mins.
Publishing to npm from GH actions is a cool idea, but it's a lot faster to
publish locally.

Also, I think that since when I introduced this action I
always killed it; either because it was to slow or because I had to
make some manual tweaks during the release.
2019-04-26 22:44:29 +02:00
Tan Li Hau
277a2620c6 allow directives and other comments before flow pragma (#9891) 2019-04-26 22:23:35 +02:00
Tan Li Hau
ca3c53ae0b fix flow-comments - class type paramters and implements (#9897) 2019-04-26 22:23:13 +02:00
Tan Li Hau
71013088ef fix flow-comment - object destructuring (#9893) 2019-04-26 22:22:41 +02:00
Nicolò Ribaudo
80a5a2e7dd Allow node 12 and test it (#9907) 2019-04-26 20:57:50 +02:00
Nicolò Ribaudo
8ca323e810 Disable chromeforandroid test in preset-env (#9906) 2019-04-26 20:57:13 +02:00
Nicolò Ribaudo
30d507c915 Add TS support to @babel/parser's Scope (#9766)
* [parser] Allow plugins to extend ScopeHandler

* Directly extend Scope

* Don't use new.target to get the ScopeHandler

* [parser] Add TS enum  support to the Scope

* Remove duplicated options in tests

* Fix

* Fix flow

* Rename tests

* Add tests

* Full typescript support in scope

* Remove BIND_SIMPLE_CATCH

SCOPE_SIMPLE_CATCH was used instead

* Export TS types

* Register function declarations

* Fix body-less functions and namespaces

1) Move this.scope.exit() for functions from parseFunctionBody to the callers.
    Otherwise the scope of body-less functions was never closed.
    Also, it is easier to track scope.exit() if it is near to scope.enter()
2) Register namespace ids for export

* Disallow redeclaration of enum with const enum
2019-04-26 14:19:53 +02:00
Jeff
293f3c98d2 Fix spelling of "Expressions" (#9896) 2019-04-26 11:57:32 +02:00
Nicolò Ribaudo
cf3668779c Always register global bindings as exportable (#9865) 2019-04-26 10:50:12 +02:00
Brian Ng
d7757f6d08 Fix TypeScript readonly error location (#9887) 2019-04-23 10:47:22 -04:00
Daniel Tschinder
bf17871b82 Fix flow types in traverse/path/family and enable flow (#9870) 2019-04-23 10:46:55 -04:00
Tan Li Hau
4198d91b89 Fix: remove constant context type check for TS (#9869) 2019-04-23 10:46:23 -04:00
Devon Govett
338853b5d3 Fix parsing typescript bodiless methods with the estree plugin also enabled (#9890) 2019-04-23 09:20:42 -05:00
Corey Farrell
8ca99b9f09 Fix: PrivateName Identifier should not be isReferenced. (#9861) 2019-04-15 22:05:16 -05:00
Samy Pessé
66be4aa5e3 Prevent JSX pragma detection in transform-typescript from leaking between files (#9798)
This PR fixes a bug in support of JSX pragma in Typescript (introduced in https://github.com/babel/babel/pull/9095).

We've noticed this bug while building a large codebase with webpack+babel+typescript. Some files from our projects are using `/** @jsx h*/` to use a custom function for JSX syntax; and some others are using the React syntax.

We've noticed that our react imports were being removed by babel because the plugin instance was being reused by `babel-loader` and webpack; and it was causing an error :

```
ReferenceError: React is not defined
```

This PR resets the `jsxPragma` being used to the initial value for each new file being processed.

I can't add a unit test for this bug because it requires processing 2 files (one with `/** @jsx something */` then one with the react syntax).

I've tested a build of this PR and it correctly fixes the issue for us.
2019-04-15 22:46:19 +02:00
Corey Farrell
f31c72f310 Fix handling of class property value this in module transforms. (#9857)
Prevent module transforms from rewriting `this` to `void 0` when found in the values of private class properties.  Add tests to prevent regressions.
2019-04-15 22:45:10 +02:00
Nicolò Ribaudo
e4072752bc Transpile babel-polyfill to es5, instead of targeting node 6 (#9812)
* Transpile babel-polyfill to es5, instead of targeting node 6

* Update babel.config.js
2019-04-15 20:01:16 +02:00
E. van der Valk
165ef29416 Fix typo in cloneNode. (#9832) 2019-04-08 08:59:57 -04:00
Ryo Ota
b4224ed8f3 Update homepage and issue link (#9826) [skip ci] 2019-04-05 13:55:05 +02:00
Henry Zhu
9f5f688385 update sponsors links [skip ci] (#9821) 2019-04-04 11:09:35 -04:00
Nicolò Ribaudo
3edd4e1a82 Update CHANGELOG.md [skip ci] 2019-04-02 21:59:20 +02:00
Babel Bot
f994d6f3ae Add v7.4.3 to CHANGELOG.md [skip ci] 2019-04-02 19:39:25 +00:00
Nicolò Ribaudo
508fde4009 v7.4.3 2019-04-02 21:36:09 +02:00
Nicolò Ribaudo
e82169dcab Enforce publish of previously missed packages (#9811)
* Fix versions of packages which haven’t been released.

* Do not ignore package.json
2019-04-02 21:19:59 +02:00
Denis Pushkarev
00cae77ec7 fix #9232, add some missed modules to noConflict (#9780) 2019-04-02 21:19:34 +02:00
Nicolò Ribaudo
e03eb17c08 [runtime-corejs3] Only polyfill instance methods when it might be needed (#9754) 2019-04-02 21:18:59 +02:00
Daniel Tschinder
9a8a7316ae Do not ignore package.json 2019-04-02 12:01:28 -07:00
Daniel Tschinder
557a8af3bc Fix versions of packages which haven’t been released. 2019-04-02 12:01:19 -07:00
Sven Sauleau
53e0622b54 Merge pull request #9808 from babel/fix-noconflict-babel-polyfill
refactor: unify polyfill with noConflict mode
2019-04-02 18:15:24 +02:00
Sven Sauleau
17e10509c0 refactor: unify polyfill with noConflict mode 2019-04-02 14:00:58 +02:00
Daniel Tschinder
491b0a8e33 Update test262 (#9806) 2019-04-01 21:47:07 -07:00
Daniel Tschinder
bac2781a20 Upgrade lodash to 4.17.11 as all the other packages (#9807) 2019-04-01 21:46:29 -07:00
Daniel Tschinder
c7587c016e Don't accept '\08' or '\09' in strict mode (#9769) 2019-04-01 19:41:50 -07:00
Andrew Anikin
123fdfd314 Fix lazy option of babel-plugin-transform-modules-commonjs (#9802)
* Fix lazy mode of babel-plugin-transform-modules-commonjs (#9447)

* Update output snapshots for lazy mode of babel-plugin-transform-modules-commonjs (#9447)
2019-04-01 07:59:12 +02:00
Mattias Buelens
3c11a4a930 Fix super method call in private instance method calling overridden method (#9801)
* Fix super method call in private instance method calling overridden method

* Change return value in test fixtures

* Update tests to verify that overridden method is not called
2019-03-31 18:50:29 -04:00
Denis Pushkarev
ae9b25ac69 Add to preset-env ES3 transforms for ES3 targets (#9781)
* add to preset-env ES3 transforms for ES3 targets

* add `transform-reserved-words`

* fix `transform-reserved-words` plugin in `@babel/standalone`
2019-03-30 23:25:12 +01:00
Moti Zilberman
1f5444e96a Destructuring: Fix handling of impure computed keys with object rest (#9416) 2019-03-26 19:11:44 -07:00
Moti Zilberman
f7bfc774ba Destructuring: Fix array unpacking assignments with holes on RHS (#9412)
This fixes an issue where destructuring assignments eligible for the "array unpacking" optimization would fail to compile when the array literal on the right-hand side of the expression contained holes.

Example input:
```js
[a, b] = [, 2];
; // Avoid completion record special case
```

The error message was `Property right of AssignmentExpression expected node to be of a type ["Expression"] but instead got null`.

Now the above code compiles to:
```js
a = void 0;
b = 2;
;
```

This PR also adds a couple of related test cases that were missing, to ensure the change doesn't regress them:
* Normal assignment expression with unpacking
* Declaration with unpacking and a hole on RHS
2019-03-27 01:14:21 +01:00
Grégoire Geis
72161a64b2 @babel/traverse: Fix NodePath.getData (#9415)
* @babel/traverse: Fix NodePath.getData

Currently, if the obtained value is `false`, it will be replaced by the given default value, which is invalid. This makes sure that we only set the default value when the value is `undefined`, instead of falsy.

* Add test and fix object protoype

* Allow false as default value
2019-03-26 16:58:38 -07:00
Daniel Tschinder
60d7e940e2 Fix merge error 2019-03-26 15:44:16 -07:00
Daniel Tschinder
6bc9e7ebda Correctly check for-in and for-of loop for invalid left-hand side (#9768)
* Correctly check for-in and for-of loop for invalid left-hand side

* Overwrite with env variable
2019-03-26 15:32:14 -07:00
Daniel Tschinder
7f4427432c Parse right-hand-side of for/of as an assignment expression (#9767) 2019-03-25 18:14:56 -07:00
Tan Li Hau
2867bbf195 [typescript] parsing template literal as type (#9748) 2019-03-25 23:21:11 +01:00
Daniel Tschinder
444daf9224 Optimize parseBindingAtom code to get better error messages (#9762) 2019-03-25 14:23:39 -07:00
Daniel Tschinder
d720c6cfff Explicit labels for tokenTypes (#9761)
* Explicit labels for tokenTypes

* Fix test

* Fix test
2019-03-25 14:23:16 -07:00
Daniel Tschinder
aaefc83a6c Allow HTML comments on first line (#9760) 2019-03-25 14:22:57 -07:00
pnowak
3aaafae053 proper feature call isLoose function #9424 2019-03-24 10:21:44 +01:00
Conrad Buck
ff04d3535c Allow coreJS Symbol to be type object (#9756) 2019-03-24 09:47:09 +01:00
Daniel Tschinder
a559397feb Move array reference into for head initializer (#9698)
* Move array reference into for head initializer

* Update packages/babel-plugin-transform-for-of/src/index.js

Co-Authored-By: danez <daniel@tschinder.de>

* Fix tests
2019-03-23 17:57:17 -07:00
Nicolò Ribaudo
d610289812 Set NPM_TOKEN in .npmrc when publishing (#9735) [skip ci]
* Set NPM_TOKEN in .npmrc when publishing [skip ci]

* Update .github/main.workflow
2019-03-24 01:04:44 +01:00
Denis Pushkarev
adb4701e00 Normalize core-js entry points (#9752)
* normalize `core-js` entry points names

* Update packages/babel-preset-env/src/polyfills/corejs3/entry-plugin.js

Co-Authored-By: zloirock <zloirock@zloirock.ru>

* handle windows paths
2019-03-24 01:03:25 +01:00
Daniel Tschinder
ef0722b4b2 Fix compatibility between estree and TS plugin (#9700) 2019-03-23 16:47:50 -07:00
Ludwig Magnusson
419d8052d3 Upgrade browserslist and caniuse in preset-env (#9747) 2019-03-22 12:38:19 -05:00
Maximilian Lackaw
998024e913 Fix wrong minimum dependency version (#9738) 2019-03-21 10:40:55 -07:00
Daniel Tschinder
596eedd3e7 Change babel-boot email 2019-03-21 10:31:52 -07:00
Babel Bot
e93cd9ff50 Add v7.4.2 to CHANGELOG.md [skip ci] 2019-03-21 09:57:37 +00:00
Nicolò Ribaudo
7dea0f23de v7.4.2 2019-03-21 10:55:50 +01:00
Nicolò Ribaudo
de7dd7f015 Mark the core-js warning as such (#9732) 2019-03-21 10:38:21 +01:00
Nicolò Ribaudo
f2c55d01c4 Create drafts instead of finished releases (#9729) [skip ci]
Currently, the "Trigger GitHub release" and "Publish to npm" actions
are run in parallel. Publishing to npm takes about 15 mins (it needs to
run `make bootstrap`), so everyone watching the npm repo for
releases would get the notification before that the new version is
available on npm.

This commit marks the automatically generated GitHub releases as draft,
which then need to be manually "finalized" by real people. This will also
avoid notifying people when for some reason a publish fails.
2019-03-21 08:26:10 +01:00
Nicolò Ribaudo
2201fd839b Modules might be in loose mode when checking for undecl exports (#9725) 2019-03-20 17:57:12 -07:00
Brian Ng
7f8ded9851 Tweak preset-env corejs/useBuiltIns warning and error messages (#9716) 2019-03-20 19:47:30 -05:00
Nicolò Ribaudo
bf94bb9d43 Fix typo in wrapRegExp helper (#9726) 2019-03-21 00:18:43 +01:00
Daniel Tschinder
ab41cb2cda Fix scope checks with enabled flow plugin (#9719) 2019-03-20 16:03:31 -07:00
Denis Pushkarev
92fcd31eac Handle object rest parameters in the corejs3-usage plugin (#9724)
Fixes #9713
2019-03-20 22:29:01 +01:00
Brian Ng
c259ec5408 Bump Babel deps (#9718) 2019-03-20 11:00:58 -05:00
Babel Bot
4cf7d0c828 Add v7.4.1 to CHANGELOG.md [skip ci] 2019-03-19 23:12:21 +00:00
Nicolò Ribaudo
94d1a5e8d7 v7.4.1 2019-03-20 00:10:54 +01:00
Nicolò Ribaudo
6402d8d58c Alias @babel/preset-env/data/built-ins.json.js (#9711)
Fixes vuejs/vue-cli#3671

Even if it has the `.js` extension, `require("@babel/preset-env/data/built-ins.json")` will still work.
2019-03-20 00:09:09 +01:00
Nicolò Ribaudo
c548e789bb Bring back isPluginRequired (#9709) 2019-03-19 23:35:13 +01:00
Babel Bot
8476cf692f Add v7.4.0 to CHANGELOG.md [skip ci] 2019-03-19 20:30:23 +00:00
Nicolò Ribaudo
f1328fb913 v7.4.0 2019-03-19 21:27:16 +01:00
Denis Pushkarev
3303b079c5 Update to core-js@3 (#7646)
### `@babel/runtime`
- Added `@babel/runtime-corejs3` package and `corejs: 3` options to `@babel/plugin-transform-runtime`.
- Added support of instance methods, fixes #8928.
- Added flag `proposals` (in `corejs: { version: 3, proposals: true }` format) for support all proposals polyfills from `core-js`.
- Used separate directories in runtime for `core-js` entry points with proposals and without.
- Used `get-iterator-method` helper for getting iterators, fixes #2500.
- As a cheap bonus, added support of IE8- (except some cases of `regenerator`).

### `@babel/polyfill`
- Should be deprecated in favor of separate usage required features from `core-js` and `regenerator-runtime` with an informative message.

### `@babel/preset-env`
- Uses for built-ins data from [`core-js-compat`](https://github.com/zloirock/core-js/tree/master/packages/core-js-compat) instead of `compat-table` since information from `compat-table` [is not enough](https://github.com/zloirock/core-js/tree/master/packages/core-js-compat).
- `useBuilIns` now requires direct setting of `corejs` version option, without it will be used `2` by default and shown deprecation warning.
- Added support of minor `core-js` versions for simplify updating in the future.
- For preventing some order-related problems, polyfills in the both `core-js@3` plugins added on `post` stage in the order of `core-js-compat` data.
- Divided plugins and polyfills parts of `preset-env`, instead of 2 internal plugins for adding polyfills, we have 6: usage and entry versions of plugins for `core-js@2`, ### Current state:
`core-js@3`, `regenerator-runtime`.
- Added support `samsung` target (for Samsung Internet) since `core-js-compat` and `compat-table` now contains mapping for this, fixes #6602.

#### `useBuilIns: entry` with `corejs: 3`
- No longer transforms `@babel/polyfill`.
- Transforms **all possible** `core-js` entry points to import of related modules (based on data from [`core-js-compat`](https://unpkg.com/core-js-compat@3.0.0-beta.15/entries.json)).
- Since of this, we no longer need `shippedProposals` / `proposals` flags with `useBuilIns: entry`.
- Removes `regenerator-runtime/runtime` import where it's not required.

#### `useBuilIns: usage` with `corejs: 3`
- In addition to `shippedProposals`, added flag `proposals`  (in `corejs: { version: 3, proposals: true }` format) for polyfill all proposals from `core-js`.
- Fixed list of dependencies in built-in definitions.
- Improved the way of determination method / built-in name and source of this method.
- Adds import of required polyfills on `MemberExpression`, `ObjectPattern`, `in` operator.
- Adds import of required polyfills on access to global object properties.
- Adds import of all required common iterators on all syntax features which use iterators protocol (`for-of`, destructuring, spread, `yield` delegation, etc.).
- Adds import of promises on syntax features which use promises (async functions/generators, dynamic import, etc.), fixes #9250, #7402, etc.

### `core-js@2` stuff
I didn't want to tough `core-js@2`-related stuff, however
- Fixed some serious errors in definitions which breaks `Object.getOwnPropertySymbols`, `Symbol.toStringTag` logic, `Promise#finally`, `Array#forEach`, etc.
- `Array#flatMap` and trim methods moved to stable features as a part of ES2019 and loaded by deprecated `@babel/polyfill` and `@babel/preset-env` with `corejs: 2` option.
2019-03-19 21:07:45 +01:00
Nicolò Ribaudo
7df0d16131 Update main.workflow 2019-03-19 19:02:54 +01:00
Nicolò Ribaudo
f2ee84b6a3 Publish to npm using a GitHub action (#9588) 2019-03-19 18:59:35 +01:00
Mattias Buelens
60005b35e4 Update regenerator-runtime to latest version (#9442) 2019-03-19 18:46:47 +01:00
Tim McClure
e068281e28 Fix super Method Calls in Class Private Methods (#9704)
This fixes an issue with the use of super method calls in class private methods. See https://github.com/babel/babel/issues/9580 for more info re: behavior of the bug.
2019-03-19 18:43:02 +01:00
Daniel Tschinder
48d66eb648 Correctly parse TS TypeAssertions around arrow functions (#9699) 2019-03-18 22:18:47 -07:00
Nicolò Ribaudo
c285d5409e Add %%placeholders%% support to @babel/template (#9648)
This is the last step to make https://github.com/babel/babel/pull/9364 usable in Babel. I'm sorry for opening this PR so late, but I hope to get it in v7.4.

In this PR I added a new option to `@babel/template`, `syntacticPlaceholders: ?boolean`, which toggles between `%%foo%%` placeholders (when `true`) and `FOO` placeholders. If it isn't specified, Babel tries to be "smart" to avoid breaking backward compat: if `%%foo%%` is used `syntacticPlaceholders` defaults to `true`, otherwise to `false`.

0e58e252913efe84eba926cc9c9c19fb18d5c620 commit shows how some templates we used could be simplified by using this new placeholders syntax (we can't actually do it yet because we are importing `template` from `@babel/core` which could be an older version).

NOTE: Since I wanted to keep this PR as small as possible to make it easier to review, I didn't migrate `template.ast` to internally use the new syntax. It is an implementation detail, so it will be possible to change it in a patch release.
2019-03-18 21:23:10 +01:00
Daniel Tschinder
f36a6987e4 Correctly preserve reference to array in for-of loop (#9697)
* Correctly preserve reference to array in for-of loop

* Add more tests
2019-03-17 21:41:35 -07:00
Andrew Goldis
efd2ca9040 Move abstract removal ClassDeclaration > Class. (#9693)
Usage of "@babel/plugin-proposal-decorators" with legacy
support causes "abstract" keyword to be preserved.
This fixes it by moving "abstract" node property removal
from "ClassDeclaration" visitor to "Class". Resolves #8172
2019-03-17 20:44:50 +01:00
Pelle Nielsen
a35e5a314a Fix TSFunctionType visitors definition (#9692)
When traversing a tree parsing for TypeScript syntax and hitting a `TSFunctionType` node, the `typeParameters` and `typeAnnotation` fields are correctly visited but the `parameters` field isn't. As a result visitors by default don't visit `foo` below:

```
var x: (foo) => void; // foo is never visited
```
```
module.exports = function() {
  return {
    visitor: {
      Identifier(path) {
        if (path.node.name == "foo") {
          // Never hit because it's nested within TSFunctionType.parameters
          path.node.name = "bar";
        }
      }
    }
  };
}
```

It appears to be a bug in babel-types/src/definitions/typescript.js which omits `parameters` in the visitors list for `fnOrCtr`. Fixed by adding it.
2019-03-16 09:24:23 +01:00
Tan Li Hau
cc45608423 Add readonly to TypeScript type modifier (#9529)
* add readonly to TSTypeOperator

* add more test cases for readonly
2019-03-16 06:41:51 +01:00
Tan Li Hau
25a3825a1d TypeScript Constant contexts (#9534)
* Add as const fixtures

* parse constant context

* parse constant context

* quick check for literal

* code review, better error message, check array elements

* Removed unneeded test cases
2019-03-16 06:40:39 +01:00
Amir Seljubac
0a69b45126 Remove dependency on home-or-tmp package (#9678) 2019-03-13 17:20:29 -05:00
piotr
a64bf63639 [proposal-object-rest-spread] fix templateLiteral in extractNormalizedKeys (#9628)
Added additional check in extractNormalizedKeys function to handle templates differently than string.
2019-03-13 21:39:50 +01:00
Behrang Yarahmadi
29cd27b545 Partial application plugin (#9474)
* add partial application syntax and some tests

remove unnecessary error message and hasPartial function from parseNewArguments

add types for PartialExpression

Update the tests

rename PartialExpression to Partial

move Partial from expressions to types and rename to ArgumentPlaceholder

add tests for ArgumentPlaceholder in babel-generator

rename Partial to ArgumentPlaceholder

update the tests

remove alias from the type and undo changes in generated folder

adds a nice error message

better definition for the type

auto-generated files

update the conditional for allowPlaceholder message and tests

update CallExpression definition to accept ArgumentPlaceholder

change description

clean up

indent ArgumentPlaceholder entry and revert unwanted changes

* add Partial Application Plugin

* update unwrapArguments function and add replacePlaceholders.

* update the tests

* remove unnecessary clone

* update readme and description an package.json

* put options.json one level up and add test for not assigned and chained

* add await to fix the test

* use Promise in the test instead of async await

* remove unnecessary method test [#9474]

* push sequenceExpressions to an array [#9474]
2019-03-13 12:21:10 +01:00
Brian Ng
a6cb24fa1a Merge pull request #9672 from babel/deps 2019-03-12 19:22:34 -05:00
Tim McClure
81c130ffc9 Private Static Class Methods (Stage 3) (#9446) 2019-03-13 00:11:16 +01:00
Brian Ng
db669a0c6e gulp-uglify@3.0.2 2019-03-12 17:09:54 -05:00
Brian Ng
2f9c4d0045 rollup@1.6.0 2019-03-12 17:09:14 -05:00
Brian Ng
0bf6091305 eslint@5.15.1 2019-03-12 17:05:27 -05:00
Brian Ng
ad2c969097 jest@24.5.0 2019-03-12 17:03:45 -05:00
Brian Ng
b7fb71ffe2 regexpu-core@4.5.4 2019-03-12 16:55:57 -05:00
Daniel Tschinder
cf4bd8bb8d Remove input and length from state (#9646) 2019-03-11 00:42:42 -07:00
Daniel Tschinder
ec318d01fa Switch from rollup-stream to rollup and update deps (#9640) 2019-03-11 00:42:25 -07:00
Guy Bedford
a891b73401 System modules - Hoist classes like other variables (#9639) 2019-03-10 23:33:19 +01:00
Jimmy Jia
dd2ffda387 fix: Don't transpile ES2018 symbol properties (#9650)
This is a repeat of #5195 to work around the same upstream issue.
2019-03-10 23:22:59 +01:00
Daniel Tschinder
b2b96e0b15 Add WarningsToErrorsPlugin to webpack to avoid missing build problems on CI (#9647) 2019-03-07 15:44:36 -08:00
Mathias Bynens
7c909e822f Update regexpu-core dependency (#9642)
This should resolve the issue @danez mentions here:
https://github.com/babel/babel/pull/9636#issuecomment-469870217
2019-03-07 16:40:20 +01:00
Nicolò Ribaudo
15dfce33df Add placeholders support to @babel/types and @babel/generator (#9542) 2019-03-07 11:47:39 +01:00
Daniel Tschinder
095e5c0e09 Generate plugins file 2019-03-06 19:34:08 -08:00
Daniel Tschinder
fb81e8f8b4 Make babel-standalone an ESModule and enable flow (#9025)
* Make babel-standalone an ESModule and enable flow

* autogenerate plugin list

* Make config an array
2019-03-06 14:30:43 -08:00
Daniel Tschinder
d8a5329834 Reorganize token types and use a map for them (#9645) 2019-03-06 14:30:04 -08:00
Matt Tingen
e53be4b387 [TS] Allow context type annotation on getters/setters (#9641)
* Allow context type annotation on getters/setters

* Extract getAccessorsExpectedParamCount
2019-03-06 22:54:42 +01:00
Erik Arvidsson
fba5655a44 Parenthesized expressions (#8025)
* Add parser createParenthesizedExpressions option  …

When set to `true` we create `ParenthesizedExpression` nodes instead of
setting `extra.parenthesized`.

* Also update babel-parser.d.ts
2019-03-06 22:43:36 +01:00
Mathias Bynens
28c71e88e2 Fix label name 2019-03-06 11:41:03 +01:00
Daniel Tschinder
29999007f6 Disallow escape sequences in contextual keywords (#9618)
* Disallow escape sequences in async

* Disallow escape sequences in get, set and async in class

* invalid escape tests

* Update whitelist

* tests for async in parens

* Add test for invalid newline between params and arrow

* Move canInsertSemilcolon() into shouldPArseAsyncArrow
2019-03-05 17:20:36 -08:00
Mathias Bynens
349c0d4836 Update babel-plugin-proposal-unicode-property-regex for Unicode v12 (#9636)
https://github.com/tc39/ecma262/issues/1467
https://github.com/tc39/ecma262/pull/1468


Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2019-03-05 18:06:33 +01:00
Mathias Bynens
54ba6d80c0 Update identifier parsing per Unicode v12 (#9637)
https://github.com/tc39/ecma262/issues/1467
https://github.com/tc39/ecma262/pull/1468
2019-03-05 17:05:03 +01:00
Nicolò Ribaudo
d832c0f434 Add parser support for placeholders (#9364) 2019-03-05 00:45:42 +01:00
Behrang Yarahmadi
c60c4dd375 Partial Application Syntax: Stage 1 (#9343)
* add partial application syntax and some tests

* remove unnecessary error message and hasPartial function from parseNewArguments

* add types for PartialExpression

* Update the tests

* rename PartialExpression to Partial

* move Partial from expressions to types and rename to ArgumentPlaceholder

* add tests for ArgumentPlaceholder in babel-generator

* rename Partial to ArgumentPlaceholder

* update the tests

* remove alias from the type and undo changes in generated folder

* adds a nice error message

* better definition for the type

* auto-generated files

* update the conditional for allowPlaceholder message and tests

* update CallExpression definition to accept ArgumentPlaceholder

* change description

* clean up

* indent ArgumentPlaceholder entry and revert unwanted changes
2019-03-05 00:34:02 +01:00
Daniel Tschinder
37a427f692 Update dependencies (#9624) 2019-03-04 14:26:39 -08:00
Daniel Tschinder
38ef4b7467 Add editorconfig for Makefile (#9623) 2019-03-04 14:26:22 -08:00
Nicolò Ribaudo
f195daa092 Don't add params of anonymous exported function decls to the outer scope (#9613)
* Don't add params of anonymous exported function decls to the outer scope

* Test
2019-03-01 00:09:49 +01:00
Daniel Tschinder
17f4195bcc Allow any reserved word in export {} from specifiers (#9616) 2019-02-28 15:07:20 -08:00
Nicolò Ribaudo
f13f4adcbb [TS] Disallow type casts in arrow parameters (#9612) 2019-02-28 23:58:27 +01:00
Evan Henley
d72f3aa758 [plugin-transform-typescript] Strip type imports used in Enums and object types (#9605)
* fix: strip type imports used in Enums and object types

* chore: update failing snapshot

* docs: correct TSPropertySignature comment

* fix: enum value should be considered a reference

* chore: add tests for TSPropertySignature and TSEnumMember
2019-02-28 22:03:12 +01:00
Daniel Tschinder
98ab1b6428 Refactor parsing object members (#9607)
* Refactor parsing object members

* Ensure decorators on rest don’t swallow decorators silently

* Use hasPrecedingLineBreak

* Add test for async with linebreak

* Update flow whitelist
2019-02-28 11:42:12 -08:00
Daniel Tschinder
208195f425 Disallow duplicate params in methods (#9599)
* Disallow duplicate params in methods

* Fix plugins
2019-02-27 15:54:07 -08:00
Daniel Tschinder
5cb280f986 Fix scope check for 2nd+ lexical bindings (#9600) 2019-02-27 15:53:28 -08:00
Nicolò Ribaudo
9aec606c69 Don't loose "this" in helper-call-delegate (#9601) 2019-02-28 00:34:48 +01:00
Nicolò Ribaudo
5c8cc0d536 Mark FOO in "var { x: FOO }˝ as a binding, not as a reference (#9492) 2019-02-27 00:17:11 +01:00
Daniel Tschinder
43eed1ac92 Check exported bindings are defined (#9589)
* Check exported bindings are defined

* Add tests

* Update flow whitelist

* Add tests for builtins
2019-02-26 13:28:10 -08:00
Sven Sauleau
e883ff295d Merge pull request #9597 from danez/Update-charcodes
Update charcodes
2019-02-26 22:17:59 +01:00
Daniel Tschinder
c1e51e08d3 Update charcodes 2019-02-26 12:29:10 -08:00
Justin Ridgewell
039a74a8b9 preset-env: minimally supporting version (#9596)
* preset-env: minimally supporting version

This changes the "does browser support X" algorithm to "lowest version such that all higher versions support it".

Eg, given `{ chrome70: true, chrome60: false, chrome50: true }`, the lowest version is chrome70, not chrome50.

This is done to remove Tagged Template Literal support from Safari, which introduced a bug in Safari 12 but correctly implemented the feature in Safari 11-9.

* Add tests

* Fix tests

* Fix comment
2019-02-26 15:18:52 -05:00
Nicolò Ribaudo
a029071b8f [TS] Correctly forget awaits after parsing async arrows with type args (#9593) 2019-02-26 20:35:18 +01:00
Daniel Tschinder
244e4580e9 Remove always false param allowExpressionBody (#9591) 2019-02-26 11:15:34 -08:00
Justin Ridgewell
e1ff4c47b9 preset-env: Sort versions before determining lowest (#9595)
Likely because of implicit `equals` (ie, Safari 12 support implies iOS Safari 12), the versions in the `res` hash are not always sorted in version order.

Doing a semver sort reveals some builtins have actually been supported a little longer than we thought!
2019-02-26 11:11:49 -08:00
Nicolò Ribaudo
0345c1bc1d Use for..of Object.keys instead of for..in (#9518)
In https://github.com/babel/babel/issues/9511 (and #9495 is another symptom), @PavelKastornyy reported a node crash becaue the JavaScript heap run out of memory. The problem was that their code was adding enumerable properties to `Object.prototype`: it is something that shouldn't be done, but Babel shouldn't make node crash if someone adds them.
I reduced down the problem to `for...in` loops in `@babel/traverse` that grew the memory consumption exponentially because of that unexpected properties.
2019-02-26 20:09:02 +01:00
Brian Ng
f1ab6120d2 Bump Babel deps (#9590) 2019-02-26 11:21:00 -06:00
Florian Adonis
8f26f6df83 change var name for coherence (#9579) 2019-02-26 09:05:43 -06:00
Daniel Tschinder
d0e196d210 Treat for loop body as part of loop scope (#9586) 2019-02-25 18:30:51 -08:00
Daniel Tschinder
e6c1065d19 Fix strict mode prescanning with EmptyStatement (#9585) 2019-02-25 15:20:05 -08:00
Daniel Tschinder
45c96908e9 Update test262 (#9587)
* Update test262

* Also remove unrecognized tests from the whitelist
2019-02-25 15:10:48 -08:00
Brian Ng
434fd32c90 Update esm and electron mappings in preset-env (#9573) 2019-02-25 16:51:38 -06:00
Nicolò Ribaudo
0e3968124c Remove unused file (eslint-local-rules.js) (#9583) 2019-02-25 21:51:17 +01:00
Daniel Tschinder
632552f55d Minify bundles on circle for repl (#9582) 2019-02-25 11:52:40 -08:00
Daniel Tschinder
a7391144b3 Introduce scope tracking in the parser (#9493)
* Introduce scope tracking

* Fix tests

* Add new tests

* Remove constructor-super check from transform as it is now in parser

* Correctly handle class properties and class scope

* Fix duplicate name check

* Convert scope identifier storage to array

* Enter a new scope in typescript module blocks

* Add test for duplicate declaration

* Rename error for duplicate exports

* Treat class declarations as lexical declaration

* Update whitelist

* Add tests

* Fix scope tracking for function declarations

* Migrate try-catch duplicate error

* Fix test

* More tests

* One more test

* Make scope a separate class and fix review comments

* Do not allow new.target in top scope arrow function

* Correctly enter new scope for declare module and treat type aliases as lexical declarations

* Tests for typescript scope tracking to not mark type aliases as duplicate

* Fix flow scope tracking

* Remove ident from test names as redundant

* Add test case for var and function

* Improve error messages

* Improve literal regex
2019-02-25 11:04:52 -08:00
Babel Bot
918f149a63 Add v7.3.4 to CHANGELOG.md [skip ci] 2019-02-25 18:37:14 +00:00
Nicolò Ribaudo
1f6454cc90 v7.3.4 2019-02-25 19:29:12 +01:00
Nicolò Ribaudo
4540f2653b Update CHAMGELOG.md using the "Trigger GitHub release" action (#9561)
Update CHANGELOG.md using the "Trigger GitHub release" action
2019-02-25 19:18:44 +01:00
Justin Ridgewell
fc1ea7f496 Revert "Parenthesized expressions (#8025)"
This reverts commit dd8b700a2c.
2019-02-25 19:03:00 +01:00
Barthélémy Ledoux
9f3457797f Fix TypeScript parsers missing token check (#9571) (#9572)
* Fix TypeScript parsers missing token check (#9571)

* fix unit test
2019-02-24 13:34:38 +01:00
Nicolò Ribaudo
0b01b5217b Use correct "this" in static fields (#9508) 2019-02-24 08:14:49 +01:00
Denis Pushkarev
cade33c647 Update compat-table (#9566)
fix #9465
2019-02-23 12:47:43 +01:00
Erik Arvidsson
dd8b700a2c Parenthesized expressions (#8025)
* Add parser createParenthesizedExpressions option  …

When set to `true` we create `ParenthesizedExpression` nodes instead of
setting `extra.parenthesized`.

* Also update babel-parser.d.ts
2019-02-23 02:45:25 -05:00
Ian Craig
417e72ebfd Fix flow and TS types of babel-types is* type checks to accept null | undefined (#9539)
* babel-types is* type checks accept null | undefiend as value TS type

* Use | null | undefined instead of any, make Flow type nullable

* Also change flow types of generated src
2019-02-22 01:48:27 -08:00
Nicolò Ribaudo
b8d045f5cf Update regenerator-transform (#9558) 2019-02-21 23:24:31 +01:00
Jacob Clark
879a59085b Pull in chokidar 2.0.4 to pull in patched braces (#9550)
chokidar 2.0.3 pulled in an older version of braces which is vulnerable to https://www.npmjs.com/advisories/786, this upgrades chokidar up a patch version where its dependencies have been updated resolving this vulnerability.
2019-02-20 15:07:24 +01:00
Daniel Tschinder
b32d271fee Migrate some duplicate binding tests to traverse (#9532)
* Migrate try-catch duplicate error

* Remove exception for functions and let in the same scope

* Migrate duplicate bindings tests to traverse

* Add test for subscope and let/const

* Add more test cases
2019-02-19 21:25:49 -08:00
Nicolò Ribaudo
21eb0837e8 Update CHANGELOG.md [skip ci] 2019-02-19 23:50:22 +01:00
Daniel Tschinder
b78fdc0cb1 chore: Enable eqeqeq rule in eslint (#9541) 2019-02-18 21:16:42 -08:00
Daniel Tschinder
a1ea765b95 Make tests spec compliant and avoid duplicate declarations in input files (#9522) 2019-02-18 16:14:35 -08:00
Nicolò Ribaudo
39af228ac4 Add import/no-extraneous-dependencies to ESLint (#9533) 2019-02-19 00:48:19 +01:00
Sven Sauleau
7c0549a923 Merge pull request #9536 from irohitb/patch-1
Update SONG.md
2019-02-18 20:56:59 +01:00
Tim McClure
f44b29522c Remove transform-classes from priv method tests (#9537) 2019-02-18 19:57:29 +01:00
Rohit Bhatia
682534e475 Update SONG.md 2019-02-18 23:28:26 +05:30
Tan Li Hau
bbb4d7b6d7 Fix typescript generator params (#9524)
* Fix typescript generator params

* add TSOptionalType, TSRestType, add more test
2019-02-18 08:22:22 +01:00
Tan Li Hau
5bb1bb080f Fix flow babel-generator function parantheses (#9523) 2019-02-18 00:17:52 +01:00
Daniel Tschinder
058f057426 Also check AssignmentPatterns for export name (#9521) 2019-02-15 22:55:03 -08:00
Nicolò Ribaudo
d1fe2d05f4 v7.3.3 2019-02-15 22:06:01 +01:00
Simon Adcock
b9a3806f9e Upgrade to @babel/preset-typescript to use @babel/plugin-transform-typescript@^7.3.2 (#9497) [skip ci]
Bumps to 7.3.2 the version of `@babel/plugin-transform-typescript` used by `@babel/preset-typescript`.

This allows us to use `@babel/preset-typescript` and pick up at least one useful bug fix (#9095).

A similar PR (#9181) was closed as it bumped to a version that didn't have changes. However reading the comments from that PR, I get the sense that bumping the version in this manner should not be necessary, and should be handled by Lerna. Is this correct?

Please let me know if I can make any improvements to this PR, the description or if there's anything else I can do to help.
2019-02-15 21:59:21 +01:00
Nicolò Ribaudo
b25fea49fe Create a new release after a v*.*.* commit instead of the tag (#9470)
* Create a new release after a v*.*.* commit instead of the tag

* Fix bugs

* Avoid matching things like "v2"
2019-02-15 21:42:51 +01:00
Nicolò Ribaudo
83cbc11d46 Correctly output escapes in directives (#9501) 2019-02-15 21:08:45 +01:00
Daniel Tschinder
0f685d9b42 Only allow Identifiers, Patterns and Rest in parameters of FunctionDeclarations 2019-02-15 12:49:36 +01:00
Nicolò Ribaudo
d86b831364 Add duplicate-package-checker-webpack-plugin (#9517)
We are duplicating semver. It's such a small package that I don't think that it is worth spending much time trying to understand why.
2019-02-15 12:28:00 +01:00
Nicolò Ribaudo
0050266a50 Add missing dependencies (#9516) 2019-02-15 08:50:32 +01:00
Nicolò Ribaudo
b6300a0869 Add importKind to ImportDeclaration in babel/types 2019-02-14 21:53:29 +01:00
Daniel Tschinder
4ba998c5db Add importKind to spec 2019-02-14 21:53:29 +01:00
Nicolò Ribaudo
2fb1f9aed3 Add tests for options to babel-node (#9510) 2019-02-14 13:43:30 +01:00
Alec
85ea5b0b50 Version bump of lodash (#9500)
https://tools.cisco.com/security/center/viewAlert.x?alertId=59546
2019-02-13 16:17:39 +01:00
Daniel Tschinder
d349b74a4f Better error output in parser tests (#9491) 2019-02-11 02:13:24 -08:00
Nicolò Ribaudo
3a9743fce4 Show real version instead of core/preset-env versions in standalone pkgs (#9467) 2019-02-09 17:29:45 +01:00
Daniel Tschinder
2817844e89 Fix regression with let (#9477)
* Fix corner cases with let

* Handle generators correctly

* Fix flow plugin

* Fix typescript plugin
2019-02-08 13:36:37 -08:00
Daniel Tschinder
7943a48cc3 Update flow to 0.92.1 and fix related issues (#9468)
* Update flow to 0.92.1 and fix related issues

* Change isThenable check
2019-02-08 13:27:11 -08:00
Nicolò Ribaudo
953182d44a Exclude generate @babel/types files from coverage report (#9469) 2019-02-08 22:25:19 +01:00
Rubén Norte
045d019149 Fix duplicated assertThisInitialized calls in constructors (#9458) 2019-02-07 23:01:46 +01:00
Downpooooour
d1514f57bd Typescript function destructured params (#9431)
* fix typescript funtion destructured params for array

* update type name
2019-02-07 22:59:50 +01:00
Nicolò Ribaudo
fdb65ab8b1 Update publishing command (#9466) [skip ci]
This reflects how I have been releasing the last versions (https://github.com/babel/notes/issues/78#issuecomment-449519007).

In the future, we'll only need to run `make new-version && git push --tags` and it will run `make publish` from CI/Actions.


Co-authored-by: Henry Zhu <hi@henryzoo.com>
2019-02-07 22:15:45 +01:00
Daniel Tschinder
81123fb972 Fix typo in comment 2019-02-06 15:12:35 -08:00
Ilya Lesik
738060ebfa Fix support for Flow's DeclareClass type parameters (#9459) 2019-02-06 08:18:07 -06:00
Brian Ng
07b0f22a3f Fix range for TypeScript optional parameter in arrow function (#9463) 2019-02-06 08:17:32 -06:00
Yifei Fu
e03e5ba01d Add TypeScript definitions for parser plugin options. (#9457) 2019-02-06 10:03:54 +01:00
Nicolò Ribaudo
d896ce2b53 v7.3.2 2019-02-04 23:20:05 +01:00
Nicolò Ribaudo
44d8a59361 Use a GitHub Action to generate the changelog (#9434) [skip ci]
* Use a GitHub Action to generate the changelog

* Update main.workflow [skip ci]
2019-02-04 22:15:44 +01:00
Daniel Tschinder
344d35bbe9 Simplify await and yield tracking in params (#9405) 2019-02-04 22:01:17 +01:00
Thiago Arrais
fe71154626 Support for await and yield in pipelines (#9401) 2019-02-04 21:58:46 +01:00
gverni
65cbbc1ef8 Fix duplicate definition error in private class methods (#9453) 2019-02-04 09:19:04 -06:00
Nicolò Ribaudo
d37c958637 Transform private async and generator functions (#9423) 2019-02-04 15:10:46 +01:00
Daniel Tschinder
9eb010da50 Unify reserved word checking and update error messages (#9402)
* Unify reserved word checking and update error messages

* Fix test
2019-01-31 19:02:32 -08:00
Galymzhan Abdugalimov
7e9029e337 Switched gutil.log to fancyLog due to deprecation (#9432) 2019-01-30 08:23:02 -06:00
Galymzhan Abdugalimov
00c3e3c8e0 Fixed link to @babel/parser's issues in README (#9427) 2019-01-30 08:18:43 -06:00
Nicolò Ribaudo
7192546eb8 Run prettier again 2019-01-30 11:35:42 +01:00
Nicolò Ribaudo
4c4c22a316 Run prettier 2019-01-30 11:30:31 +01:00
Rizky
56044c7851 install polyfill & runtime to dependency instead of devDependency [skip ci] (#9409) 2019-01-29 08:09:08 -06:00
Daniel Tschinder
828169e611 Fix line continuation with Unicode line terminators (#9403) 2019-01-28 13:35:35 -08:00
Moti Zilberman
1452e977a0 Destructuring: Create assignments from ForX non-declaration patterns (#9414) 2019-01-28 09:50:24 +01:00
Brian Ng
ede69eef7f Bump deps (#9417) 2019-01-26 22:49:48 -05:00
Dylan Staley
03230eaa9c Retain JSX pragma if defined as a comment (#9095) 2019-01-26 15:36:10 -06:00
Brian Ng
7dc157f9be Fix location/range on TypeScript ExportNamedDeclarations (#9406) 2019-01-24 19:44:22 -06:00
Yuri Karadzhov
854313a759 Correctly visit param decorators to prevent their imports being removed in typescript transform (#8738)
* Remove types on program exit in typescript transform

* Revert changes to typescript transform

* Correctly add visitors for param decorators

* Fix plugin for node 6
2019-01-24 15:07:56 -08:00
Daniel Tschinder
46ba5940c2 Make yield a contextual keyword (#9400) 2019-01-23 14:33:23 -08:00
Daniel Tschinder
42c5d3fc4b Correctly fail for invalid yield in for (#9398) 2019-01-23 13:39:30 -08:00
Brian Ng
d4e045ac24 Fix support for Flow's QualifiedTypeIdentifier (#9396) 2019-01-23 15:19:17 -06:00
Daniel Tschinder
8bc9f9a05f fix: Allow toplevel await when option true and correctly mark await keyword as unexpected (#9371) 2019-01-22 14:56:30 -08:00
Daniel Tschinder
93e1b5e612 Merge pull request #9375 from danez/contextual-let
Make let a contextual keyword
2019-01-22 14:55:49 -08:00
Daniel Tschinder
4f69699b71 Fix parsing in non-declaration places 2019-01-22 13:12:03 -08:00
Daniel Tschinder
f4f5ca2aaa Parse class name in strict mode
The specification defines that the whole class declaration is parsed in strict mode
2019-01-22 13:12:03 -08:00
Daniel Tschinder
8071dca9ad Disallow const let or let let 2019-01-22 13:12:02 -08:00
Daniel Tschinder
178f2d7949 Make let a contextual keyword 2019-01-22 13:12:02 -08:00
Nicolò Ribaudo
65febdd13a Refactor import and export parsing (#9326)
* [parser] Refactor import parsing

* [parser] Refactor export parsing

* Fix types
2019-01-22 19:52:56 +01:00
Brian Ng
f77c450cda Bump prettier (#9373) 2019-01-22 09:16:32 -06:00
Nicolò Ribaudo
f2af6c1170 v7.3.1 2019-01-22 08:07:23 +01:00
Daniel Tschinder
43b83f8ed7 Revert "Differentiate object spread and non-spread properties (#9341)" (#9379)
This reverts commit 3ae5e79ec8.
2019-01-21 23:03:54 -08:00
Daniel Tschinder
af88e63dff fix new keyword broken by recent refactoring (#9377) 2019-01-21 22:25:37 -08:00
Nicolò Ribaudo
f6ee26c3da v7.3.0 2019-01-21 22:22:39 +01:00
Tim McClure
e8de6fa5d4 Private Class Methods Stage 3: Private Accessors (#9101)
* Add accessor loose support

* Add private accessors spec support

* Fix private dupe name check

* Changes from code review

* Add duplicated names tests

* Add get/set-only tests

* Move accessors tests

* Split out updates tests

* Add helper change tests

* Update test output

* Update test options
2019-01-21 22:05:37 +01:00
Kagami Sascha Rosylight
3ae5e79ec8 Differentiate object spread and non-spread properties (#9341)
* add isSpread field

* use argument

* t.booleanLiteral

* fix typo

* push empty-argument object

* .object

* .value

* object field should be an expression

* lint

* update outputs

* isSpread for the second argument is redundant

* add test

* alternating spread
2019-01-21 22:04:47 +01:00
Thiago Arrais
e9331aa0c0 Transform for the smart pipeline operator proposal (#9179) 2019-01-21 22:04:14 +01:00
Henry Zhu
ba4141934f add v7 downloads [skip ci] (#9370) 2019-01-21 12:48:15 -05:00
Daniel Tschinder
96a7343142 Merge pull request #9348 from danez/perf
Parser Performance Collection
2019-01-21 02:27:42 -08:00
Armano
a2e6d8e968 Disallow usage of invalid keyword after export abstract statement in Typescript (#9336) 2019-01-19 15:48:05 -06:00
Nicolò Ribaudo
4ce37b7aca Update test262 sha (#9365) 2019-01-19 18:10:28 +01:00
Brian Ng
b92ad318f1 Add support for transform-named-capturing-groups-regex in preset-env (#9345) 2019-01-17 19:51:38 -06:00
Daniel Tschinder
2d6231fd3d Update flow whitelist 2019-01-17 16:16:32 -08:00
Daniel Tschinder
4e5e319d5b perf: remove double check for keywords in readWord
Instead of calling isKeyword we simple check directly if the keyword token is available
2019-01-17 16:16:31 -08:00
Daniel Tschinder
b66d921053 perf: Use === or Set.has instead of array.indexOf for keyword checks 2019-01-17 16:16:30 -08:00
Daniel Tschinder
f12905b531 perf: Use for loops while cloning classes 2019-01-17 16:16:29 -08:00
Daniel Tschinder
f216975378 perf: call isLineTerminator as last check 2019-01-17 16:16:28 -08:00
Daniel Tschinder
3a3d5cbe9c perf: Check for plugin only once before looping 2019-01-17 16:16:28 -08:00
Daniel Tschinder
10555c719e Build the parser also for node 6.9 and up 2019-01-17 16:16:27 -08:00
Daniel Tschinder
58768072ef perf: Ensure canInsertSemicolon is always called last
It does a lot of checks and a regex test
2019-01-17 16:16:26 -08:00
Daniel Tschinder
455e003567 perf: Optimize regex
This saves some steps, as the regex parser does not have to backtrack for character classes, but is has to for alternates
2019-01-17 16:15:07 -08:00
Daniel Tschinder
49f7bcf271 perf: Remove unnecessary check for flow plugin inside of flow plugin 2019-01-17 16:15:07 -08:00
Daniel Tschinder
c2e41588aa perf: run flow code in flow plugin 2019-01-17 16:15:05 -08:00
Daniel Tschinder
a1eac37bd2 Generate prettier comments 2019-01-17 16:15:04 -08:00
Daniel Tschinder
0370af58f1 perf: Use strict equals 2019-01-17 16:15:03 -08:00
Daniel Tschinder
8df0500f55 perf: Simplify reading of tokens.
This avoids checking isIdentifierStart for every single token
2019-01-17 16:15:01 -08:00
Daniel Tschinder
e4b8cfc768 perf: use Set instead of string indexOf 2019-01-17 16:15:00 -08:00
Daniel Tschinder
a7757ec4d0 perf: Use increment operator 2019-01-17 16:14:58 -08:00
Daniel Tschinder
25a8db2a29 perf: use normal equality check in stead of indexOf 2019-01-17 16:14:57 -08:00
Daniel Tschinder
48fd387779 perf: precalculate length 2019-01-17 16:14:56 -08:00
Daniel Tschinder
59c4bbb4ab perf: Make plugins a map instead of object
Fix plugin options
2019-01-17 16:14:55 -08:00
Daniel Tschinder
2dc1c91955 perf: Move input to state and precalculate length
This also fixes a bug with async functions
2019-01-17 16:14:54 -08:00
Daniel Tschinder
ae154c86ed perf: Minor optimizations 2019-01-17 16:14:53 -08:00
unconfident
e9588061d7 Copy "optional" property when cloning Identifier node (#9333)
Fixes #9331
2019-01-17 17:12:16 -05:00
Nicolò Ribaudo
0a88230ec4 Disallow async functions as loop bodies (#9314) 2019-01-17 17:07:48 -05:00
Nicolò Ribaudo
a27b9b4299 Add @babel/plugin-transform-named-capturing-groups-regex (#7105)
When the `runtime` flag is on (by default), this plugin adds a new helper which wraps the native `RegExp` class to provide groups support. People nees to use a polyfill (I implemented it in core-js) for browsers that don't support ES6 regexps.
2019-01-15 18:21:17 +01:00
Brian Ng
aaec2cd51d Fix handling newline with TypeScript declare and abstract classes (#9328) 2019-01-15 06:56:52 -06:00
Brian Ng
34c9890f41 Fix range on TypeScript index signature parameters (#9335) 2019-01-15 06:52:33 -06:00
Armano
e8038863c3 Fix range on TypeScript this type predicate (#9339) 2019-01-15 10:35:49 +01:00
Nicolò Ribaudo
694e3fd8cf Merge declaration and init of props in parser's state (#9312)
* Merge declaration and init of props in parser's state

* Move type def
2019-01-13 23:54:44 +01:00
Brian Ng
40ae6568a4 Add support for proposal-json-strings in preset-env (#9323) 2019-01-13 08:32:33 -06:00
Henry Zhu
4944e9e180 update sponsor link again [skip ci] 2019-01-13 08:00:46 -05:00
Nicolò Ribaudo
a24206eb96 Fix error for decorators not enabled (#9321)
* Fix error for decorators not enabled

* Update error message
2019-01-13 00:35:22 +01:00
Henry Zhu
d6b4ab75ee fix sponsor link [skip ci] 2019-01-12 10:41:49 -05:00
Nicolò Ribaudo
3e4b608a80 Parse class heritage as strict mode code (#9315) 2019-01-12 14:54:23 +01:00
Henry Zhu
28319eb07e add sponsor [skip ci] 2019-01-11 13:50:48 -05:00
Nicolò Ribaudo
5889620a6a Disallow new import(x) and import(x,) (#9313)
* Disallow "new import(...)"

* Disallow trailing comma inside dynamic import

* Rename test

* Update error message
2019-01-11 18:59:51 +01:00
Nicolò Ribaudo
9764718c32 Disallow trailing comma after rest (#9311)
* Add new tests

* Use state instead of param and disallow comma in [...a,]=[]

* Unify error messages

* Object destructuring

* Update whitelist
2019-01-11 13:08:38 +01:00
Nicolò Ribaudo
28b70e5910 Generate types for TSImportType 2019-01-11 11:46:15 +01:00
Henry Zhu
4c2f8d9337 @babel/generator: Add emit and builder for TSImportType (#9309) 2019-01-10 13:57:00 -05:00
Armano
2cc0376756 @babel/parser(ts): Add parsing of type import (#9302) 2019-01-10 11:14:48 -05:00
Nicolò Ribaudo
8e051cae46 [decorators] Set method names at compile time instead of at runtime (#9244) 2019-01-10 00:45:02 +01:00
Cameron Martin
778a61a3c2 [@babel/types] Moved generators related to babel-types into the babel-types package directory. (#9245) 2019-01-09 00:14:31 +01:00
Armano
46e3f6df1f @babel/parser: include leading character into range of generic ArrowFunctionExpression (#9295) 2019-01-08 07:19:55 -06:00
Brian Ng
03022d169e Throw error if TypeScript class has empty implements (#9292) 2019-01-07 15:27:27 -06:00
David Laban
9803253363 flow type update: babel-types.isType(?string, string): boolean (#9275) 2019-01-07 08:53:01 -06:00
Brian Ng
a55382e4ad Test262 update (#9288) 2019-01-07 08:52:36 -06:00
Sven Sauleau
b211b810d1 Use 2014-present in license (#9290) 2019-01-07 08:52:11 -06:00
James George
25e880d355 Add follow on twitter badge (#9264) [skip ci] 2019-01-07 09:49:20 -05:00
Daniel Tschinder
e43777bb5f Fix location for typescript type assertions in AST (#9284) 2019-01-06 16:39:14 -08:00
Nicolò Ribaudo
efc60a1703 Add test sources to prettierignore (#9287) [skip ci] 2019-01-06 20:59:02 +01:00
Daniel Tschinder
54f072991d Revert "Revert babel-helper-builder-react-jsx change from #4988" (#9119)
This reverts commit dbc07220ae.

# Conflicts:
#	packages/babel-helper-builder-react-jsx/src/index.js
2019-01-05 22:22:49 -08:00
Brian Ng
a58893d1e3 Ensure modifiers are included in TSParameterProperty ranges (#9276) 2019-01-04 10:02:09 -06:00
Nicolò Ribaudo
865eb93c2d [private methods] Define private methods before executing initializers (#9248) 2019-01-03 20:33:44 +01:00
Berlam Henderson
49f52bbcb3 Bump license years for 2019 (#9271) 2019-01-03 09:12:03 -06:00
Nicolò Ribaudo
9d1d0fe57a Add mixins support to the _decorate helper (#9166) 2018-12-29 22:54:30 +01:00
Brian Ng
ea1c436ea1 Fix handling scoped packages in preset-env include/exclude options (#9219) 2018-12-27 09:54:28 -06:00
David Laban
3f9a1c08cc Add tests for babel-types.isType (#9243) 2018-12-27 12:49:34 +01:00
J. S. Choi
c586d4e8ca parser, smart pipes: Add support for yield in pipeline bodies
Fixes #9178.
2018-12-23 17:09:18 +01:00
J. S. Choi
60ffe1d103 parser, smart pipes: Add test for async–await 2018-12-23 17:09:18 +01:00
Armano
b5177ce290 babel-parser: typescript: add missing bigint keyword (#9230) 2018-12-22 17:18:32 -06:00
Henry Zhu
d1aa665657 update sponsors [skip ci] 2018-12-21 21:39:06 -05:00
Nicolò Ribaudo
f130981546 v7.2.5 2018-12-21 23:32:48 +01:00
Nicolò Ribaudo
bc347bab7a Add @babel/helpers to devDependencies of runtime and runtime-corejs2 (#9222) 2018-12-21 10:08:47 +01:00
Nicolò Ribaudo
21228abfde v7.2.4 2018-12-20 13:08:41 +01:00
Nicolò Ribaudo
e417437355 Minify standalone 2018-12-20 12:50:41 +01:00
Nicolò Ribaudo
0bb720401b v7.2.3 2018-12-20 12:18:31 +01:00
Nicolò Ribaudo
d35f2ad92b Update lerna to v3.6.0
Use forked @lerna/collect-updates to prevent publishing of dependents:
this is the same as Lerna 2's --dangerously-only-publish-explicit-etc option.
2018-12-20 11:46:56 +01:00
Nicolò Ribaudo
57759cb1a1 [lerna] Don't ignore .json data files in preset-env (#9200) 2018-12-20 11:43:40 +01:00
Cameron Martin
9e95da4eaa Added type-level mapping between aliases and nodes that have that alias. (#9110) 2018-12-19 10:57:27 +01:00
Nicolò Ribaudo
911c2d0bf4 Use @babel/eslint-plugin-developement (#9206) 2018-12-18 22:59:43 +01:00
cphamlet
116ca22def Minor typo for -f flag in cli (#9201) 2018-12-17 19:29:23 -08:00
Tan Li Hau
52fb884550 Strips flow directive fully (#9197) 2018-12-17 09:27:56 +01:00
Daniel Tschinder
5cb38995c0 Allow keywords to be used in type annotations (#9184) 2018-12-15 12:51:24 -08:00
Andy Edwards
3c8e15dbc1 don't throw classNameTDZError if referenced identifier is within a TypeAnnotation (#9190)
fix #9189

Obviously this code is intended to throw an error if someone tries to reference a class before it's defined, like:
```js
class Foo {
  someField = Foo;
}
```
But there's no problem with referencing the class in a type annotation before it's defined, and this is often necessary for tree structures:
```js
class Foo {
  [someSymbol]: Foo;
}
```
2018-12-15 15:16:43 +01:00
Nicolò Ribaudo
c1499b13ac v7.2.2 2018-12-15 10:59:56 +01:00
Nicolò Ribaudo
7bcd62cfee Build standalone on prepublish 2018-12-15 10:52:23 +01:00
Daniel Tschinder
47da5cf75a Correctly transform spreads to use proper concat method (#9108)
* Correctly transform spreads to use proper concat method

* Add tests to ensure array spread clones elements
2018-12-13 23:24:43 -08:00
Vikram Rangaraj
72471aff63 Handle flow comments with leading spaces (#9168)
* check for spaces and tabs before a flow comment

* fix issue with using string index and shift interchangably

* update tests

* Use update charcodes version

* Disallow flow-comments in flow-comments and check for unterminated comments
2018-12-13 22:10:01 -08:00
Patrick Eriksson
b9340bc597 Fix package.json repository URLs (#9176) 2018-12-13 21:15:40 +01:00
Thiago Arrais
731182eee4 Types for pipeline operator (smart proposal) (#9122) 2018-12-13 06:58:58 +01:00
Daniel Tschinder
f4eec5ca79 Add new flag that indicates if a module has exports (#9171) 2018-12-12 21:24:44 -08:00
Nicolò Ribaudo
b60adce4cb Update CHANGELOG.md 2018-12-12 23:56:33 +01:00
Henry Zhu
66c4bc8f64 update list of sponsors [skip ci] 2018-12-12 16:07:49 -05:00
Daniel Tschinder
d2dc28ed2b add triage label to new issues [skip ci] (#9158) 2018-12-12 10:23:54 -08:00
Brian Ng
0514a9f903 Update v7 regression issue template link (#9157) 2018-12-10 12:00:52 -06:00
Nicolò Ribaudo
d1d3c823cc Move decorators transform to @babel/helper-create-class-features-plugin (#9059)
* Move decorators to @babel/plugin-class-features

* Minor refactoring

* Use the new helper package
2018-12-09 12:30:25 +01:00
Nicolò Ribaudo
9b005dedfd Fix --root-mode option in babel-node (#9148) 2018-12-07 22:47:56 +01:00
Rubén Norte
4fdb71151f Inherit properties in function from method in loose mode (#9135) 2018-12-07 15:57:48 +01:00
Brian Ng
f611bb016b Bump Babel deps (#9145) 2018-12-07 08:55:06 -06:00
Kagami Sascha Rosylight
4dff205dc1 Disable parameter-destructuring in Edge 18 (#9140) 2018-12-07 08:14:08 -06:00
Kagami Sascha Rosylight
72fd2d192c Add missing colon to issue template (#9143) 2018-12-07 13:32:36 +01:00
Daniel Tschinder
35815832b5 Move to travis vm based builds (#9133) 2018-12-05 15:02:37 -08:00
Daniel Tschinder
9c45b8faf7 Ensure we always use local versions of babel dependencies in tests (#9132) 2018-12-05 14:14:16 -08:00
Daniel Tschinder
ca2918ab13 Test local version of babel/types 2018-12-05 13:34:36 -08:00
Daniel Tschinder
d915f31bcb Add tests for createTypeAnnotationBasedOnTypeof 2018-12-05 13:24:55 -08:00
Daniel Tschinder
4ca35ef8b9 Fix running flow on travis and update flow (#9128)
* Fix running flow on travis and update flow

- ensure bootstrap is run before running flow as we need some generated files for correctly doing typechecks
- ensure that we only ignore the build directory inside the babel folder as currently we ignore everything because travis checks out into ‘/home/travis/build/’

* Fix all flow errors
2018-12-05 12:30:30 -08:00
Henry Zhu
4b73818c87 Update issue templates [skip ci] (#9131) 2018-12-05 13:58:53 -05:00
Joel Denning
d305419da6 Not depending on return value of super(). Fixes #9020. (#9060)
* Not depending on return value of super(). Fixes #9020.

* Feedback from nicolo-ribaudo

* Feedback -- fixing bad call to replaceWithMultiple
2018-12-04 21:50:17 +01:00
Nicolò Ribaudo
8b132c0889 v7.2.1 2018-12-04 16:21:47 +01:00
Nicolò Ribaudo
b927fb2a7e Don't use isClassPrivateMethod because is isn't supported in <7.2.0 (#9121) 2018-12-04 08:35:10 +01:00
Nicolò Ribaudo
282129ea66 v7.2.0 2018-12-03 20:00:35 +01:00
Nicolò Ribaudo
fc5d49b6f6 Add access:public to @babel/helper-create-class-features-plugin 2018-12-03 20:00:24 +01:00
Nicolò Ribaudo
6c2771c116 Add @babel/plugin-proposal-private-methods to @babel/standalone (#9115) 2018-12-03 19:40:00 +01:00
Sven Sauleau
fdc869ce16 Merge pull request #8289 from valtech-nyc/implement-smart-pipeline-in-parser
Implement Smart Pipeline proposal in @babel/parser
2018-12-03 19:28:45 +01:00
Daniel Tschinder
fa9df678ac Move tests from babylon to babel-parser and enable one test that works now 2018-12-03 00:46:54 -08:00
Daniel Tschinder
3932830535 Parse non-octals with leading zeros in non strict mode correctly (#9114)
* Parse non-octals with leading zeros in non strict mode correctly

* Better error message
2018-12-03 00:04:37 -08:00
Daniel Tschinder
07eaa3c63f Ignore empty fixture directories and fix fixtures in the parser (#9113)
* Ignore fixture directories that do not contain input or exec

* Fix parser test fixtures structures for some imported esprima tests.

* Warn on test folders that are not empty and do not contain testfiles
2018-12-02 22:55:06 -08:00
Daniel Tschinder
3530d11418 Update find-cache-dir (#9111)
Dropped support for node <6
2018-12-02 12:12:19 -08:00
Kai Cataldo
806e133473 Export @babel/parser#tokTypes in @babel/core (#8986)
* Export @babel/parser in @babel/core

* Expose tokTypes instead of parser
2018-11-30 18:41:58 -08:00
Veaceslav Cotruta
2bf8dde782 Propagates the extensions overrides provided by CLI during files walk (#8668)
* Propagates the extensions overrides provided by CLI during files walk

* Adds tests for issue #7620, PR #8668
2018-11-29 18:57:27 -08:00
Nicolò Ribaudo
4e28459a2f Make @babel/plugin-class-features a normal helper package (#9083)
* Make @babel/plugin-class-features a normal helper package

This effectively disallows using it directly.

* Rename helper

* Style

* Don't add prefix to plugin name

* Move private methods plugin
2018-11-29 16:42:45 +01:00
wtgtybhertgeghgtwtg
c4d6f6dcce Pass rootMode from @babel/node. (#9078)
* Pass `root-mode` from `@babel/node`.

* Filter `babelOptions`.
2018-11-28 21:29:38 -08:00
Tim McClure
0859535b62 Private class methods stage 3 (#8654)
* Add private method syntax support

* Add private method spec support

* Add private method loose support

* Throw error if static private method is used

* Add more isStatic & isMethod checks

* Remove `writable:false` from private method inits

`writable` is false by default.

* Add private method func obj equality check

* Throw if private accessor is used

* Add check for fields === private method loose mode

* Throw buildCodeFrameErrors instead of Errors

* Move obj destructuring inside for loop

* Remove "computed" from ClassPrivateMethod type def
2018-11-28 16:20:09 -08:00
Daniel Tschinder
6e39b58f8a Add node 11 to CI and remove node 9 (#9096) 2018-11-28 12:36:58 -08:00
Daniel Tschinder
559d649994 Skip minifying standalone (#9094)
Also remove unused dependency on uglify js. gulp-uglify uses its own version.
2018-11-28 12:36:24 -08:00
Brian Ng
3fda01b185 Update mapping for regex unicode plugin in preset-env (#9091) 2018-11-27 22:09:15 -06:00
Daniel Tschinder
4f2eacf615 chore: Fix warning when using prettier in code generators (#9093)
Also add more output to the generation
2018-11-27 19:34:11 -08:00
Gcaufy
0047ae84b3 Remove unused variable (#9089)
When I was reading the code, I see `parent` is not used in `_getComments` function.
so it make me confused why we delivery the `parent` in those functions.

If I'm wrong, please correct me.
2018-11-27 14:03:39 -08:00
Paul Happ
2bb24f996f Fix yield expression transform (#9076) 2018-11-27 09:45:06 -06:00
Nicolò Ribaudo
61f2aed5b0 Disallow await inside arrow functions (#9074)
* Disallow await inside arrow functions

* Update test262 whitelist
2018-11-26 12:43:04 +01:00
Ruben Verborgh
9308c870f5 Fix destructuring assignment in arrow functions. (#8916)
Fixes 8912.
2018-11-25 19:29:58 +01:00
wtgtybhertgeghgtwtg
1b8d664bbe Move fs-readdir-recursive and output-file-sync to devDependencies (#9079)
For `@babel/node`.
2018-11-25 18:04:03 +01:00
Justin Ridgewell
844dd33f3d Microbouji patch/8136 (#9073)
* Fix optional chaining bug regarding spread in function calls

* Revamp optional-chain to be top down

Instead of going both upwards and downwards from the first real optional expression, we can just start from the top down.

* Add more tests
2018-11-24 09:32:24 -05:00
Nicolò Ribaudo
856edbf95f [flow] Allow type casts in array patterns inside arrow parameters (#9069) 2018-11-24 12:23:49 +01:00
mAAdhaTTah
100b38784d Replace else with fall through 2018-11-21 21:07:03 -05:00
mAAdhaTTah
4cbd22a15f Hardcode "#" in error message
It's not going to be anything else...
2018-11-21 21:05:51 -05:00
Daniel Tschinder
d2971a1959 Fix compatibility between typescript and jsx plugins in interface declarations (#9058) 2018-11-21 15:58:50 -08:00
Brian Ng
4f16a12c03 Fix bug with parsing TS generic async arrow function (#9055) 2018-11-21 15:34:09 -06:00
Brian Ng
e7f0c065cf Bump some deps (#9056) 2018-11-21 15:21:36 -06:00
mAAdhaTTah
70318c9413 s/may/should 2018-11-21 16:02:34 -05:00
mAAdhaTTah
6e84352b51 PrimaryTopicReference -> PipelinePrimaryTopicReference 2018-11-21 15:54:56 -05:00
mAAdhaTTah
0eb9b2463d Move plugin check to pipeline op appearance
No need to recheck it throughout then.
2018-11-21 15:54:26 -05:00
Grigory Moroz
445b14148e Better error for disallowed trailing commas/parameters after rest elements (#9046)
* handle disordered rest parameter in function expressions

* remove spaces [lint]

* polish function parameters validation

* add test with arrow function and comma after rest parameter [babel-parser]
2018-11-21 07:49:36 +01:00
Brian Ng
61c1c77a28 Update mappings for node 10 in preset-env (#9048) 2018-11-20 15:29:45 -06:00
Nicolò Ribaudo
5979b0669b Merge class features plugins
* Create @babel/plugin-class-features

* Move class properties transformation logic to enanced-classes (#8130)
2018-11-20 21:14:35 +01:00
Daniel Tschinder
a2afb974be Fix parsing typescript function types with destructuring (#9035)
* Fix parsing typescript function types with destructuring

* Use integer instead of actual stack
2018-11-19 13:55:58 -08:00
Nicolò Ribaudo
c11cdcb6d8 Fix recursive async function expressions (#9039)
* Fix recursive async function expressions

* Update fixtures
2018-11-19 17:19:54 +01:00
Nicolò Ribaudo
8c7d4b55c9 Add plugins name (#8769)
* Add plugins name

* Add missing names found by the plugin

* Add eslint plugin
2018-11-18 23:02:58 +01:00
Sergey Rubanov
88696601e1 Add Node 11 support (#9037) 2018-11-18 08:17:06 -07:00
Logan Smyth
20a9d71016 Normalize presets before merging config with others. (#9034) 2018-11-16 21:23:23 -08:00
Daniel Tschinder
1af57e6f71 Fix test262 tests again! 2018-11-14 23:29:17 -08:00
Nicolò Ribaudo
4e1d6e7ff4 v7.1.6 2018-11-13 22:10:06 +01:00
Henry Zhu
efb71ea12b fix publish command [skip ci] (#8982) 2018-11-13 11:47:05 -08:00
Logan Smyth
cbbb3c7962 Ensure that the arrow nodes have a location before using them. (#9003) 2018-11-12 17:10:49 -08:00
Greg Bergé
4fcee1751a Fix cloneNode with typeAnnotation. (#8997)
Fixes #8996
2018-11-12 17:10:09 -08:00
Tien Pham
efa571a42c Update CHANGELOG.md (#9014) 2018-11-11 23:33:56 +01:00
Alican Çubukçuoğlu
bf8c4785f2 Fix "TypeError: comments is not iterable" (#8701) 2018-11-09 13:58:28 -08:00
Brian Ng
4f206b2416 prettier@1.15.1 (#9001) 2018-11-09 15:25:13 -06:00
Daniel Tschinder
504b331da4 Fix browser files to have the same API as the nodejs ones (#9004) 2018-11-09 13:11:46 -08:00
Daniel Tschinder
74f969b603 Update debug dependency (#8989) 2018-11-09 16:27:41 +01:00
Remi Liu
4dfd801887 [Types] fix generated TS/Flow comment types (#9007) 2018-11-09 09:03:53 -06:00
Daniel Tschinder
62233ed7c9 Update json5 to latest version (#8990) 2018-11-08 17:29:13 -08:00
ylemkimon
7b54ab620b preset-env: fix opera from esmodules target and Browserslist not used (#8555) 2018-11-08 10:29:49 -06:00
Daniel Tschinder
343f776ca5 Rename primitive types to reserved types (#8984) 2018-11-07 16:50:36 -06:00
Daniel Tschinder
756ded4d64 Remove definition of micromatch which was removed. (#8988) 2018-11-07 16:49:27 -06:00
Nicolò Ribaudo
b706e34fc8 [decorators] Correctly insert _initialize(this) after super(). (#8970)
* [decorators] Correctly insert `_initialize(this)` after `super()`.

This commit fixes to problem:
1) After `super();` statements, `_initialize(this)` was inserted without
   a trailing semicolon.
2) `(0, super())` causes an infinite recursion.

* Fix tests

* Add test
2018-11-06 21:58:09 -08:00
Daniel Tschinder
5d5cd8612f Fix several edge cases with context expression state (#8972)
* Fix several edge cases with context expression state

* Fix review comments

* Remove unused field
2018-11-06 19:37:24 -08:00
Henry Zhu
afe67a7035 v7.1.5 2018-11-06 17:21:22 -05:00
Nicolò Ribaudo
2fa1984635 Fix await in function name and parameters (#7727)
* Disallow await in function parameters

* Fix await as function name

* Update test whitelists
2018-11-06 08:30:06 +01:00
Retsam
2194842d11 Typescript: Validate tuple type element positions (#8828)
* feat: validate the positions of rest elements and optional elements in tuple types

Adds a validation step to the parser which raises syntax errors if a rest param is not at the end of a tuple, or if a mandatory param follows an optional parameter

* Fix spread after optional case; add test case
2018-11-05 23:19:34 -08:00
Daniel Tschinder
e3b2c1afff fix: Do not allow TypeCastExpressions w/o parens (#8956) 2018-11-05 15:34:24 -08:00
James Garbutt
b95cbc4a8e output aliased types in typescript declarations (#8629) 2018-11-05 23:58:57 +01:00
Nicolò Ribaudo
24c4901ff5 Remove Babylon plugins for features already merged to the ECMAScript spec (#8448)
These are now enabled by default:
- objectRestSpread (2018)
- asyncGenerators (2018)
- optionalCatchBInding (2019)
- jsonStrings (2019)

TODO (after this commit):
- [ ] Deprecate the `@babel/plugin-syntax-*` packages.
- [ ] Deprecate the `@babel/plugin-proposal-*` packages.
- [ ] Create the `@babel/plugin-transform-*` packages.
2018-11-05 23:48:06 +01:00
Daniel Tschinder
c125b1dd74 Update test262 commit, as old commit broke for some reason 2018-11-05 10:53:34 -08:00
Jordan Brown
f216a7b06f [flow] Add support for parsing _ as implicit instantiation in call/new (#8883)
* [flow] Add support for parsing  as implicit instantiation in call/new

* Update flow tests and fix underscore being a reserved type

* Rebase onto flow-test

* Fix flow commit hash
2018-11-05 10:45:40 -08:00
Logan Smyth
c6d2f45cab Resolve babel.config.js 'babelrcRoots' values relative to the config file. (#8910) 2018-11-05 08:51:27 -08:00
Daniel Tschinder
1d4d760ffc Update test262 to latest commit and enable mapping for features
Also added an automated check for new features which are not mapped or ignored
2018-11-04 18:49:53 +01:00
mAAdhaTTah
a0e94ec24d Move PipelineStyle to types.js file 2018-11-03 14:03:17 -04:00
mAAdhaTTah
b593af17a9 Replace codePointToString with ES6 method 2018-11-03 14:00:42 -04:00
mAAdhaTTah
4521204ea0 Merge branch 'master' into implement-smart-pipeline-in-parser
* master: (222 commits)
  Set correct methods name
  Use toPropertyKey in the "decorate" helper
  Allow function types in type params within arrow return types (#8954)
  Fix message when plugin of a wrong type is passed (#8950)
  rename colliding let bindings with for loop init (#8937)
  edge incomplete support for arrow destructuring (babel #8349) (#8926)
  fix single-arg async arrows when retainLines=true (#8868)
  [flow] Explicit inexact objects with `...` (#8884)
  Update preset-env data (#8898)
  Treat break inside block inside loop (#8914)
  fixed "source map" formatting in comment (#8878) [skip ci]
  fix typo in contributing guidelines (#8901) [skip ci]
  fix: Expression x === 'y' && '' should not evaluate to undefined. (#8880)
  fixed an extra word
  Fixes #8865 (#8866)
  v7.1.4
  v7.1.3
  Bump Babel deps (#8770)
  flow-bin@0.82.0 (#8832)
  Insertafter jsx fix (#8833)
  ...

# Conflicts:
#	packages/babel-parser/src/tokenizer/index.js
#	packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-numeric-literal/options.json
#	packages/babel-parser/test/fixtures/experimental/pipeline-operator/invalid-proposal/options.json
2018-11-03 14:00:12 -04:00
Nicolò Ribaudo
d35563ee1a Set correct methods name 2018-11-02 13:59:57 +01:00
Nicolò Ribaudo
38397ce11f Use toPropertyKey in the "decorate" helper
This commit also makes the "toPropertyKey" helper call @@toPrimitive
when needed.
2018-11-02 13:59:57 +01:00
Daniel Tschinder
cd81b079ee Allow function types in type params within arrow return types (#8954) 2018-11-01 09:10:46 -05:00
everdimension
e85faec47d Fix message when plugin of a wrong type is passed (#8950) 2018-10-31 14:34:26 -05:00
Byron Luk
0d9e77f559 rename colliding let bindings with for loop init (#8937)
* rename colliding let bindings with for loop init

* added complex test case to check if loop init collisions were handled correctly

* updated test files
2018-10-31 20:28:36 +01:00
Ben Mosher
c82750a48a edge incomplete support for arrow destructuring (babel #8349) (#8926) 2018-10-31 10:15:27 -05:00
Ryan Marsh
de80aefece fix single-arg async arrows when retainLines=true (#8868) 2018-10-30 06:49:11 +01:00
Jordan Brown
e4929e11f6 [flow] Explicit inexact objects with ... (#8884) 2018-10-29 15:09:17 -05:00
Brian Ng
d942d47e10 Update preset-env data (#8898) 2018-10-25 09:48:41 -05:00
Thiago Arrais
84e7884d9c Treat break inside block inside loop (#8914) 2018-10-25 09:46:36 -05:00
0xflotus
9d0dcedb2b fixed "source map" formatting in comment (#8878) [skip ci] 2018-10-20 00:51:46 +02:00
Byron Luk
b576bf4b41 fix typo in contributing guidelines (#8901) [skip ci] 2018-10-19 08:49:33 +02:00
Cyp
e541d6031a fix: Expression x === 'y' && '' should not evaluate to undefined. (#8880)
Fixes https://github.com/babel/minify/issues/908.
2018-10-16 21:25:49 +02:00
Sven Sauleau
5fa3628506 Merge pull request #8873 from vvyomjjain/patch-1
fixed an extra word
2018-10-14 18:53:17 +02:00
Vyom Jain
f71e4660d4 fixed an extra word
"visit join" doesn't sound right. Either there is a word missing or the word 'visit' may be removed.
2018-10-14 22:14:02 +05:30
Byron Luk
929567523c Fixes #8865 (#8866) 2018-10-12 09:28:15 -05:00
Henry Zhu
5080059138 v7.1.4 2018-10-11 13:32:18 -04:00
Henry Zhu
8ee857e268 v7.1.3 2018-10-11 11:52:19 -04:00
Brian Ng
6b8261bbb7 Bump Babel deps (#8770) 2018-10-10 13:55:02 -05:00
Brian Ng
ce1a6526e5 flow-bin@0.82.0 (#8832) 2018-10-10 12:29:23 -05:00
Kevin Thomas
842c164be5 Insertafter jsx fix (#8833)
* Add check for JSXElement

* Add test
2018-10-10 10:10:20 -06:00
Retsam
d2c75c2d38 fix: corrects handling of newline after async with paren-less arrow function (#8830)
If async is followed by a newline, then a paren-less arrow function should be parsed as two expressions
2018-10-09 23:25:31 +02:00
Retsam
3951acbff5 chore: add generated files for #8805 (#8826) 2018-10-08 12:29:33 -05:00
Retsam
08454ece46 Typescript - Tuples can include rest elements (#8805) 2018-10-08 11:32:31 -05:00
Tim von Oldenburg
4b8cb75b74 types: allow jsxEmptyExpression inside jsxExpressionContainer (#8791) 2018-10-07 23:31:03 -04:00
Guy Bedford
3fa4f53d0a System module format - fixes function hoisting failure case (#8820)
* failing test case

* fix function hoist bug
2018-10-07 23:30:02 -04:00
Bruno Macabeus
850bc1d3dd class private methods and properties: should not allow spaces between # and identifier (#8756) 2018-10-02 19:31:06 -07:00
Brian Ng
36d12b5969 Ensure destructuring's computed key handling matches object-rest-spread (#8793) 2018-10-02 20:46:08 -05:00
Brian Ng
2575312d1f Fix parsing of slash after class expression (#8804) 2018-10-02 20:45:53 -05:00
Retsam
a5b5ed928d Typescript - Tuple elements can be optional (#8720) 2018-10-02 11:29:51 -05:00
Nicolò Ribaudo
3c87401714 [decorators] [typescript] Parse type parameters (#8767)
* [decorators] [typescript] Parse type parameters

* Add test for invalid code
2018-10-01 22:04:19 +02:00
Matthew Robertson
07862e7272 Fix perf issue in typescript parser plugin (#8792) 2018-10-01 12:59:16 -05:00
Henry Zhu
ca89212b45 add changelog up to 7.1.2 [skip ci] 2018-09-28 18:28:43 -04:00
Henry Zhu
3f5b7554b8 v7.1.2 2018-09-28 18:19:38 -04:00
Henry Zhu
ead23d7112 v7.1.1 2018-09-28 16:02:43 -04:00
Nicolò Ribaudo
626f47982e Do not unpack array patterns that update a referenced binding (#8535)
Fixes #8528
2018-09-28 11:45:42 -04:00
Brian Ng
55faa27b93 Run test262 tests for exportNamespaceFrom (#8780) 2018-09-27 14:48:58 -05:00
Sampo Kivistö
090c364a90 Improved build performance by optimizing makeMappingKey method. (#8744) 2018-09-26 13:16:40 -07:00
Pig Fang
f38be13113 TypeScript: reserve unknown as TSUnknownKeyword (#8755) 2018-09-25 12:19:32 -05:00
Nicolò Ribaudo
889cdb8da5 Use babel-check-duplicated-nodes (#8768) 2018-09-25 10:00:48 -05:00
Nicolò Ribaudo
af694ebae1 [decorators] Support async and generator methods (#8742) 2018-09-25 10:03:03 +02:00
Brian Ng
a19b72e46d jest@23.6.0 (#8764) 2018-09-24 18:53:41 -05:00
Brian Ng
38cf318f61 Bump lint-related deps (#8765) 2018-09-24 18:09:54 -05:00
Brian Ng
be027fd36c Bump babel-related deps (#8763) 2018-09-24 17:19:01 -05:00
Nicolò Ribaudo
5150f5f500 [decorators] Fields are enumerable (#8761) 2018-09-24 23:36:32 +02:00
Brian Ng
9f407e0735 Fix some missing parens cases with OptionalMemberExpression in generator (#8751) 2018-09-23 10:54:13 -05:00
Logan Smyth
3b0f9a9f1e Delete undefined options so we handle old core versions with new CLI versions. (#8728) 2018-09-19 08:56:40 -07:00
Brian Ng
9e7c7f5683 Handle throw expressions in generator (#8727)
Fixes #8716
2018-09-18 18:10:48 -04:00
Henry Zhu
fad74959f8 v7.1.0 2018-09-17 15:29:37 -04:00
Henry Zhu
2b68181af2 add ignore files [skip ci] 2018-09-17 15:28:38 -04:00
Brian Ng
9b4b436e1f Fix parsing of newline between 'async' and 'function' (#8698) 2018-09-16 22:09:23 -05:00
Logan Smyth
aa33303112 Fix logic/Flow error with versionRange. (#8714) 2018-09-15 15:37:03 -07:00
Logan Smyth
bd0c62dc0c Allow users to choose how the configuration root is selected. (#8660) 2018-09-15 13:03:46 -07:00
Nicolò Ribaudo
aac8118b7f Update helpers version fro 7.0.1 to 7.0.2 (#8703) 2018-09-14 22:55:27 +02:00
Brian Ng
8897b67f40 Fix TSParameterProperty getting lost with transform-classes (#8682) 2018-09-14 10:30:15 -05:00
Brian Ng
380f2a0297 Fix typescript parsing typed object shorthand methods (#8677) 2018-09-14 10:20:59 -05:00
Brian Ng
402bd1cc42 Adjust TSParameterProperty handling to work with transform-parameters (#8695) 2018-09-14 10:20:43 -05:00
Brian Ng
6059637f09 babel-eslint@9.0.0 (#8680) 2018-09-14 10:20:22 -05:00
Brian Ng
880fc1f54e Fix es6.string.iterator mapping in babel-preset-env (#8693) 2018-09-14 10:20:00 -05:00
Henry Zhu
fc1a52cb75 remove force publish, temp tag [skip ci] (#8679) 2018-09-14 10:47:37 -04:00
Nicolò Ribaudo
82a0e681ab Add "decoratorsBeforeExport" to the babel-standalone presets (#8649) 2018-09-13 10:52:40 +02:00
Retsam
8f5e9e143b Fixes the link to the babel-parser output docs (#8678) [skip ci]
The babel-parser output documentation has been moved to the babeljs.io website, but the link in CONTRIBUTING.md is still pointing to the repository itself.
2018-09-12 09:18:20 +02:00
Logan Smyth
13798feefb Fix prerelease checks in .availableHelper and transform-runtime definitions. (#8659) 2018-09-10 18:25:21 -07:00
Retsam
9ad8b2bb2c Fix typescript import elision (#8666) 2018-09-10 17:42:22 -05:00
宋铄运
d2b559af59 Add issue.sh to Patreon Silver sponsors (#8647) [skip ci] 2018-09-10 08:48:44 -06:00
James Garbutt
252660f248 ts generator: allow reserved keywords in interfaces (#8627) 2018-09-10 09:22:36 -05:00
Sven Sauleau
0e7d7cfccc Merge pull request #8661 from babel/feat-run-fix-json-on-fix
Makefile: run fix json on fix
2018-09-10 09:41:55 +02:00
Sven SAULEAU
53c6c98bdb chore: fix-json new options 2018-09-10 08:04:32 +02:00
Sven SAULEAU
802fc2ac80 feat: invoke fix-json on fix target 2018-09-10 08:04:20 +02:00
Siddharth Parmar
e372129d00 Add tests for static math methods (#8626) 2018-09-09 18:08:34 -07:00
Logan Smyth
79b2af5997 Format fixture JSON with Prettier. (#8658) 2018-09-09 17:57:52 -07:00
Frederic Germain
45c28fa785 Use eslint-local-rules plugin
This allows to avoid having errors in editors that
supports eslint

cf https://github.com/eslint/eslint/issues/8769
2018-09-07 16:54:07 -07:00
Mateusz Burzyński
1e1a89ca70 Allow regular plugins/presets resolution algorithm for packages outside of the monorepo (#7582) 2018-09-07 16:37:10 -07:00
Jeff Rafter
1b03906da4 Allow users to specify a module for inline scripts (#6223) 2018-09-07 16:33:19 -07:00
Maaz Syed Adeeb
7accee9c24 [TS] Transform multiple assert and assign correctly (#7217)
* Transform multiple assert and assign correctly

* Handling nested TSAsExpressions in the transform
2018-09-07 16:23:18 -07:00
Logan Smyth
7273cf8fe5 Fix a linting error. 2018-09-07 16:09:25 -07:00
Aaron Ang
dad55ef1d6 Test babel-cli --source-maps and errors (#5377) 2018-09-07 15:30:24 -07:00
Nicolò Ribaudo
9aec4ad159 Add support for the new decorators proposal (#7976) 2018-09-07 15:58:42 +02:00
Vikram Rangaraj
29a2878973 Use jsonc to parse babelrc comments in markdown files (#8643) [skip ci]
* [skip ci] use markdown jsonc to parse comments in README files

* [skip ci] change json to jsonc type in other markdown files
2018-09-07 15:50:51 +02:00
Elian Ibaj
9eef660daa Allow patterns as argument of RestElement (#8414) 2018-09-06 22:35:37 +02:00
Nathan Shane
d9149aa2f3 Fix broken links to old changelogs (#8635) [skip ci] 2018-09-06 00:58:50 +02:00
Brian Ng
58017044a3 Bump flow to 0.80 and fix sourceType error (#8630) 2018-09-05 09:00:53 -05:00
Nicolò Ribaudo
c5279eeca4 [static private] Use explicit descriptors instead of an object (#8620)
This is similar to ec69b4bb12, which
was about private instance fields.

Private properties can be non-writable (thanks to decorators), or have
get/set accessors. If we stored this information on the `privateClass`
object, we would need to always use `Object.getOwnPropertyDescriptor`
before reading or writing a property because accessors need to be called
with the correct `this` context (it should be the actual class, not the
object hat stores the private properties). This commit simplifies that
operation a bit by removing the container object.

It also have another advantage, which instance fields already have
thanks to the use of separate weakmaps: unused private static fields
can be tree-shaken away or garbage-collected, while properties of an
object can't. Also, they can be easilier minified.
2018-09-05 15:08:40 +02:00
Logan Smyth
f6643d1804 Merge pull request #8624 from loganfsmyth/misc-fixes
Verify 'sourceMap' option with hasOwnProperty, and verify string-typed 'version'
2018-09-04 09:27:10 -07:00
Sven Sauleau
07fae82a8a fix(types): missing unambiguous sourceType (#8610) 2018-09-04 10:03:48 -05:00
Logan Smyth
fc91b94a86 Fix misplaced dependency from PR #8616 2018-09-03 23:36:34 -07:00
Nicolò Ribaudo
d4e23b5b2a [static private] Unify loose handling of static and instance props (#8614) 2018-09-04 08:10:46 +02:00
Siddharth Parmar
262787bd92 Add static Math methods to plugin-transform-runtime (#8616)
* Add static Math methods to plugin-transform-runtime

* Remove methods which are not part of TC39 standard

* Use semver to conditionally include Math module
2018-09-03 20:49:51 -07:00
Logan Smyth
9232e8b405 Validate the type of the 'version' option for transform-runtime. 2018-09-03 18:44:10 -07:00
Logan Smyth
dd985c3be3 Verify 'sourceMap' with hasOwnProperty since it can be falsy. 2018-09-03 12:22:22 -07:00
Nicolò Ribaudo
4beb977f15 [static private] Use correct min version in helpers (#8613)
* [staic private] Use correct min version in helpers

* Always use patch version
2018-09-03 11:36:26 -07:00
Adam Noakes
679e4b8f37 align regenerator runtime version (#8618) 2018-09-03 10:03:30 -07:00
Sven Sauleau
fc9becfdf2 Merge pull request #8170 from AviVahl/master
@babel/parser: expose a TypeScript definition file from package
2018-09-03 08:15:56 +02:00
Sven Sauleau
6893b7e7d2 fix: [skip ci] consistent naming 2018-09-03 08:09:26 +02:00
Bartosz Kaszubowski
ffc82374d2 Fix version badges in monorepo README (#8534)
* Fix version badges in monorepo README

Badges caching disabled by removing the maxAge parameter from image URLs to ensure that always the latest version of package is displayed.

* adjust version badges cache time to one hour
2018-09-02 21:49:01 -07:00
Logan Smyth
2921f6cdb1 Pass missing caller metadata for .babelrc files. (#8601) 2018-09-01 15:46:38 -07:00
Robin Ricard
fb66fa6f90 Private Static Fields Features: Stage 3 (#8205)
* Private Static Class Fields Implementation

* Redo testing without class transform for static private

* Add a call() test for private static

* Use Object.defineProperty in loose mode
2018-09-01 00:42:18 -04:00
Sven Sauleau
eda804da11 update COC contact (#8591) 2018-08-31 09:33:27 -05:00
Ryunosuke Sato
15f456651a Fix grammar in error message at @babel/plugin-transform-runtime (#8581) 2018-08-29 11:57:36 -07:00
Nicolò Ribaudo
9d244ae66b More helpful error message for missing decoratorsBeforeExport in parser (#8576) 2018-08-29 09:02:18 -05:00
Henry Zhu
04d09cc754 add access public to all packages [skip ci] (#8573)
If people copy paste to make an new package they might miss this and we will get a publish error later so figured we should add it to all.
2018-08-29 09:54:53 -04:00
Sebastian McKenzie
5447a40719 Remove LICENSE email and refer to other contributors (#8574) [skip ci]
Been years since I've been involved in Babel, so I feel like referencing other contributors is more appropriate now.
2018-08-29 09:48:10 -04:00
Sven Sauleau
d45ea2e5ff Merge pull request #8561 from siddhant1/master
Added pronounciation of babel
2018-08-28 07:45:22 +02:00
Henry Zhu
aeefec5f13 add link to audio [skip ci] 2018-08-28 00:32:44 -04:00
siddhant
9a3af17560 Added pronounciation of babel 2018-08-28 08:29:54 +05:30
Henry Zhu
bcec62c0ac update ourselves to 7.0 (#8558) 2018-08-27 19:22:35 -04:00
Henry Zhu
90fb82a535 v7.0.0 2018-08-27 17:41:21 -04:00
Henry Zhu
8a45fba510 testing temp tag [skip ci] 2018-08-27 17:32:28 -04:00
Logan Smyth
079780b432 Make it easier to re-run local prod builds (#8556) [skip ci] 2018-08-27 13:43:45 -04:00
Henry Zhu
4e64807afc use temp tag while having publishing issues [skip ci] 2018-08-27 13:16:39 -04:00
Henry Zhu
814c564c45 v7.0.0-rc.4 2018-08-27 12:42:00 -04:00
Henry Zhu
7a104e3e1d bump source-map-support (#8553) 2018-08-27 12:32:42 -04:00
Henry Zhu
b98799557a Lerna: remove exact [skip ci] (#8554)
We only wanted all the dependencies to be exact in the pre-release because of breaking changes. This will make it use the default `^`
2018-08-27 12:27:32 -04:00
Logan Smyth
1ac46a256d Merge pull request #8547 from loganfsmyth/runtime-cleanup
Remove nonstandard functions and fake prototype methods from babel-runtime
2018-08-26 21:25:50 -07:00
Logan Smyth
50d3c09883 Add support for asyncIterator. 2018-08-26 13:59:33 -07:00
Logan Smyth
508bfad55a Remove non-standard and prototype methods from constructor property use. 2018-08-26 13:59:33 -07:00
Logan Smyth
130814342a Enable a few disabled core-js utils now that we're reading for them in 7.x. 2018-08-26 13:52:19 -07:00
Logan Smyth
e0ee0570be Default highlightCode:true for the parser highlighting. (#8546) 2018-08-26 13:23:43 -07:00
Justin Ridgewell
edbffda091 Cleanup getLineInfo (#8540)
Removes an ignore control comment
2018-08-26 13:27:06 -04:00
Justin Ridgewell
72ee1816a4 Update to ES6 String methods (#8541) 2018-08-26 13:26:51 -04:00
tsangint
e875fc7bc1 Update url in buildUnknownError tips (#8544) 2018-08-26 15:00:32 +02:00
Justin Ridgewell
524d847763 Flatten TokenType class hierarchy (#8537)
`KeywordTokenType` and `BinopTokenType` were just meant to be factory
helpers, there's no reason for a class hierarchy.
2018-08-25 20:02:32 -04:00
Justin Ridgewell
5899940156 Update parser whitespace for clarity (#8539)
* Update parser whitespace for clarity

Has the nice benefit of not requiring a charCode to String conversion.

* Remove test262 exceptions

Per https://github.com/tc39/ecma262/pull/1218#issuecomment-395340891,
ECMA262 follows whatever the latest Unicode version specifies for Zs
Space_Separator category. MONGOLIAN VOWEL SEPARATOR was moved to the Cf
Other_Format category in Unicode 8.
2018-08-25 19:12:38 -04:00
Logan Smyth
595240f071 Add a 'whitelist' option for the external-helpers plugin to mirror the helper builder. (#8531) 2018-08-24 15:10:46 -07:00
Henry Zhu
cada040bec v7.0.0-rc.3 2018-08-24 14:06:00 -04:00
Nicolò Ribaudo
1f9b2a5c41 [_wrapNativeSuper] Don't wrap non-native constructors (#8501) 2018-08-24 19:58:49 +02:00
Logan Smyth
39fa102ee8 Use supportsStaticESM to toggle runtime module usage. (#8520) 2018-08-24 10:48:47 -07:00
Honza Javorek
e841ccca34 Upgrade slash (#8527) [skip ci]
The 1.x versions do not contain a full license text.
2018-08-24 11:31:27 -04:00
Artem Yavorsky
4249dbc8ea Add browserslist 4 support. (#8509) 2018-08-23 20:09:18 -05:00
Standa Opichal
a7cc3325cd Add LICENSE file to published npm packages [skip ci] (#8409) 2018-08-23 19:49:27 -04:00
Logan Smyth
023044c1d4 Reference the CommonJS helpers when a file is not explicitly a module. (#8518) 2018-08-23 15:09:14 -07:00
Rafael de Oleza
22bcfbe469 Fix path.scope.rename() to not change break clauses (#8478)
* Make labels on break and continue statements not referenced

* Add test for imports and labels with the same name
2018-08-23 14:20:57 -07:00
Jason Quense
47e05d70f3 Fixed issue with non-simple property paths in object-rest-spread loose mode (#8514)
* fix: object rest with default values bug

fixes #8323

* rename variable
2018-08-23 15:53:31 +02:00
Nicolò Ribaudo
c5e3b6d4bc [decorators] Don't set writable on accessors (#8513) 2018-08-23 00:54:28 +02:00
Logan Smyth
b04de1196a Rename exported functions where name conflicts with param. (#8505) 2018-08-21 13:54:29 -07:00
Henry Zhu
d07cef244e Update Babel to rc.2 (#8504) 2018-08-21 15:31:07 -05:00
dnalborczyk
6c68ca8e0a adjust supported npm versions to v3 (#8359) [skip ci] 2018-08-21 15:44:17 -04:00
Henry Zhu
f1d774b34f v7.0.0-rc.2 2018-08-21 15:22:07 -04:00
Jarda Snajdr
8874c5c481 Add missing es7.promise.finally polyfill when using useBuiltIns: usage (#8500)
Usage of a `finally` instance method should trigger import of the `es7.promise.finally` polyfill, but it doesn't. This PR adds the missing definition and a test.
2018-08-21 14:53:11 -04:00
Yi Li
b439013cd4 Fix trailingComments for FunctionExpression that is CallExpression arguments (#8488) 2018-08-21 12:29:11 -05:00
Nicolò Ribaudo
f8b0a5579f Remove File#resolveModuleSource (#8470) 2018-08-20 12:14:55 -07:00
Logan Smyth
2a4f162366 Merge pull request #8485 from loganfsmyth/caller-option
Allow preset-env to toggle module handling based on flags from the caller (like babel-loader)
2018-08-20 10:44:11 -07:00
Brian Ng
55295cc545 Add initial ES2019 and saf12/elec3 support in env (#8438) 2018-08-20 12:32:18 -05:00
Nicolò Ribaudo
59e9c6322b Remove hub.file usage from babel-core 2018-08-20 19:30:29 +02:00
Yongxu Ren
0fd3da110d Rewrite Hub as interface #5047 2018-08-20 19:30:29 +02:00
Logan Smyth
d60c5e1736 Expose caller.supportsStaticESM as a flag to change preset-env behavior. 2018-08-20 10:27:55 -07:00
Logan Smyth
90bebe7186 Pass the caller.name option in Babel's own callers. 2018-08-20 10:27:54 -07:00
Logan Smyth
8d6ed7e0aa Expose an api.caller(...) handler for presets to access caller metadata. 2018-08-20 10:27:54 -07:00
Logan Smyth
8f4bae8ea4 Expose optional caller metadata to Babel ignore/only/test/include/exclude functions. 2018-08-20 10:27:54 -07:00
Logan Smyth
2c3c12fdf7 Enforce a limited set of cache key values for plugins/presets for future caching. 2018-08-20 10:12:19 -07:00
Logan Smyth
25d2f59018 Ensure that presets properly flatten their options. 2018-08-20 10:12:19 -07:00
Logan Smyth
3a399d1eb9 Cache individual programmatic descriptors along with the overall list. (#8494) 2018-08-20 10:08:21 -07:00
Logan Smyth
c2a2e24965 Take top-level config source into consideration when processing nested env/overrides. (#8493) 2018-08-19 21:46:09 -07:00
Logan Smyth
ef68114d67 Fix typo in sourcemap filtering. 2018-08-19 16:37:29 -07:00
Logan Smyth
ca639b4262 Preserve 'false'-options for disabled plugins/presets so that callers can use that to toggle behavior. (#8474) 2018-08-19 16:22:27 -07:00
wtgtybhertgeghgtwtg
7a51d72345 Bump js-tokens in @babel/highlight. (#8490) 2018-08-19 07:35:16 -04:00
dnalborczyk
ab8555a867 Update dependencies (#8364) 2018-08-17 10:26:25 -05:00
Nicolò Ribaudo
0136a26af7 Fix conflict in tests (#8486) 2018-08-17 11:36:10 +02:00
Yeonghoon Park
c75a00bd56 Fix default descriptor setting for class properties with decorators (#7429)
(legacy decorators)
2018-08-17 10:49:03 +02:00
Logan Smyth
ffa8e6cbae Allow babel-plugin/preset to be in package names outside the prefix, when used in a scope. (#8473) 2018-08-16 15:13:52 -07:00
Nikolay Emrikh
5043ec78bc Fixes setter paratemer default value (#8479)
* Fixes setter paratemer default value

* Not changes doesn't mutate loose variable
2018-08-16 01:54:50 -04:00
Nicolò Ribaudo
3989213e37 Remove unused file (#8472) 2018-08-15 09:08:28 +02:00
Nicolò Ribaudo
d79b5eeeff Require decoratorsBeforeExport option for decorators (#8465)
* Require decoratorsBeforeExport option for syntax-decorators

* Also babylon

* Enable test
2018-08-15 09:04:52 +02:00
Logan Smyth
1e0b649485 Allow transform-runtime to insert runtime references with absolute paths. (#8435) 2018-08-14 16:11:19 -07:00
Laxman
8c65230258 Fix link to babel-parser (#8464) [skip ci] 2018-08-13 15:54:07 +02:00
Mauro Bringolf
427aff559f Fix decorators interop bug with class field tdz
Co-authored-by: Jan Buschtöns <jan@buschtoens.me>
2018-08-13 08:57:09 +02:00
James DiGioia
122906d525 Verify if MemberExpression is computed
If a property access is computed, e.g. a[b], then it's in topic style. Currently,
this isn't accounted for. Test & change ensures this doesn't parse.
2018-08-10 08:06:38 -04:00
James DiGioia
25d01460fd Fix error message for #4 case
This impact private fields as well as smart pipeline, providing a clearer
error message for both.
2018-08-10 07:52:55 -04:00
wtgtybhertgeghgtwtg
de16ac08be Remove lodash where it isn't used. (#8446) 2018-08-09 23:21:41 -04:00
James DiGioia
ba5642d4ee Add test for computer properties
This seems to parse fine. Should it?
2018-08-09 22:08:39 -04:00
James DiGioia
15e6d844ae Remove additional parser logic
These are parsable only in follow-on proposals, not in the base proposal,
so we'll introduce that in a separate PR.
2018-08-09 22:08:23 -04:00
James DiGioia
d1cae2dec2 Remove unneeded comment
This is no longer true, now that we return `tt.hash`.
2018-08-09 21:10:43 -04:00
James DiGioia
11aee13ff2 Swap Yoda condition 2018-08-09 21:04:47 -04:00
Henry Zhu
0a958861c9 v7.0.0-rc.1 2018-08-09 16:06:08 -04:00
Henry Zhu
904bcaffe3 fix peer deps [skip ci] (#8445)
Should be anything 7.x
2018-08-09 15:59:14 -04:00
宋铄运
e855987c51 update sponsor [skip ci] (#8444)
Add issue.sh sponsor from Patreon
2018-08-09 15:58:28 -04:00
Henry Zhu
8b1406127a v7.0.0-rc.0 2018-08-09 11:56:00 -04:00
Henry Zhu
c8bb450032 remove proposals polyfills from default import [skip ci] (#8440)
The default import is replaced with only polyfills that are Stage 4; this is in alignment with how we have removed the Stage presets. This also would mean we would need to add new imports when necessary, but that can be in a future release.
2018-08-09 11:43:45 -04:00
Logan Smyth
b6db036ff7 Require v1.1.0 so that correct filter params are passed. (#8436)
PR #8418 introduced some new logic that uses the third parameter of `fs-readdir-recursive`'s `filter` option, the current directory, but missed that our dependencies only required `^1.0.0`, while that parameter was actually added in `1.1.0`. This means that if some other dependency forced a downgrade in the version to satisfy some range, or the user already had 1.0.0 module installed locally, it could cause problems,
2018-08-07 23:28:36 -04:00
Sam Grace
6476a0d089 Whitelist experimental-modules flag for babel-node (#8336) [skip ci] 2018-08-06 11:45:38 -04:00
Henry Zhu
6695f5e2f7 v7.0.0-beta.56 2018-08-03 21:02:42 -04:00
Henry Zhu
86ce2e4e0d remove old deps [skip ci] 2018-08-03 20:42:45 -04:00
Henry Zhu
8cffbbae75 Split @babel/runtime into 2 modules via @babel/runtime-corejs2 (#8266)
In Babel 6, we had `@babel/runtime` which _always_ uses `core-js` in its helpers, meaning that anyone who wants to use our helpers in a centralized modular way had to also use core-js, which isn't always ideal.

Early in the Babel 7 alpha, we added a `useBuiltins: true` option that would use separate copies of the helpers that would skip loading `core-js`, but this _still_ requires users to have an indirect npm dependency on `core-js`.

This PR splits our setup into two separate runtimes:

* ```
  'plugins': [
    ['transform-runtime'],
  ]
  ```
  with `npm install --save @babel/runtime` that just includes our helpers, and relies on users to globally polyfill any APIs they need.
* ```
  'plugins': [
    ['transform-runtime', { corejs: 2 }],
  ]
  ```
  with `npm install --save @babel/runtime-corejs2` that includes everything `@babel/runtime` does, but also includes a passthrough API for `corejs@2.x` and rewrites all of the helper modules to reference `core-js`.
2018-08-03 15:13:33 -04:00
Jan Schmidle
cb51704745 Babel cli fix recursion in file mode (#8418)
* added test case

* remove unnessecary parameter

* check for type directory as well in readRecursive filter
2018-08-03 09:06:27 -07:00
Logan Smyth
a8224d40e2 Split @babel/runtime into two separate runtime modules. 2018-08-02 19:25:07 -07:00
Logan Smyth
3210a7a873 Default to non-corejs helpers. 2018-08-02 19:24:41 -07:00
Logan Smyth
9c598a8e28 Build an explicit runtime. 2018-08-02 19:23:47 -07:00
Logan Smyth
a149466001 Move build-dist script to the runtime transform. 2018-08-02 19:23:47 -07:00
Logan Smyth
ec8330870e Refactor the runtime build-dist script. 2018-08-02 19:22:23 -07:00
Logan Smyth
363c5923f0 Remove unused options.json file. 2018-08-02 19:21:40 -07:00
Logan Smyth
8173b6e694 Merge pull request #8398 from loganfsmyth/helper-whitelisting
Only reference helpers from external/runtime helpers if they are known to be available.
2018-08-02 19:20:56 -07:00
Logan Smyth
e2d64f146c Only reference helpers from external helpers or runtime helpers if they are known to be available. 2018-08-02 18:44:56 -07:00
Logan Smyth
9392783738 Remove helpersNamespace in favor of helperGenerator. 2018-08-02 18:44:56 -07:00
Logan Smyth
810b7916c2 Expose an API to check if a helper is available in a given version range. 2018-08-02 18:44:56 -07:00
Logan Smyth
eb0e999987 Expose a minimum required Babel version for each helper. 2018-08-02 18:44:56 -07:00
kalenikalexander
5c728ea609 Fix private property parsing in Flow (#8340)
* Fix private property parsing in Flow

* Flow tests updated

* Fix type error

* Appropriate name was given to test folder

* Fix

* Empty

* Correct type annotation

* Add required changes in generator package

* Add required changes in flow-strip-types
2018-08-02 08:38:58 +02:00
Leong Jia Meng
b8f9ebf638 Update Documentation[skip ci] (#8412) 2018-08-01 10:33:11 -05:00
Brian Ng
55ca90b3fc Allow TSInterfaceDeclaration to be default export (#8408)
<!--
Before making a PR, please read our contributing guidelines
https://github.com/babel/babel/blob/master/CONTRIBUTING.md

For issue references: Add a comma-separated list of a [closing word](https://help.github.com/articles/closing-issues-via-commit-messages/) followed by the ticket number fixed by the PR. (it should be underlined in the preview if done correctly)

If you are making a change that should have a docs update: submit another PR to https://github.com/babel/website
-->

| Q                        | A <!--(Can use an emoji 👍) -->
| ------------------------ | ---
| Fixed Issues?            | Fixes #7118
| Patch: Bug Fix?          | Y
| Major: Breaking Change?  | N
| Minor: New Feature?      | N
| Tests Added + Pass?      | Yes
| Documentation PR Link    | 
| Any Dependency Changes?  |
| License                  | MIT
2018-07-31 12:57:57 -05:00
Brian Ng
1a0fe993f5 Ensure esmodule targets are parsed by browserslist (#8403) 2018-07-31 07:33:02 -05:00
Logan Smyth
02760d0f70 Run transform-runtime on the standalone bundle so it stays ES5-compatible. (#8024) 2018-07-29 16:52:11 -07:00
Henry Zhu
adca165ee9 v7.0.0-beta.55 2018-07-28 18:06:42 -04:00
Henry Zhu
fa86b2ddf0 Remove our own use of stage presets (#8397)
- also update the stage preset error message/readme's to point to the new blog post
2018-07-28 11:24:53 -04:00
Logan Smyth
5eb193c61f Ensure that Identifier source mappings explicitly start and stop on the generated range (#8380)
* Add sourcemap examples for identifiers in code generator.

* Generate sourcemaps with exact mappings for identifiers, even if leading/trailing tokens also use that location.
2018-07-27 16:27:33 -04:00
Nicolò Ribaudo
ec69b4bb12 Save full descriptor instead of only value for private fields. (#8318)
* Save full descriptor instead of only value for private fields.

Decorators can make private fields non-writable, so we need to store this
information somewhere.
The descriptor can also be used to implement private accessors.
2018-07-27 16:24:57 -04:00
Brian Ng
5fdcd29ef9 Ensure preset-env doesn't clobber browserslist defaults (#8391) 2018-07-26 15:22:26 -04:00
Andy
8ee24fdfc0 TypeScript: Support type arguments on tagged templates (#7754)
| Q                        | A
| ------------------------ | ---
| Fixed Issues?            | #7747 (partly)
| Patch: Bug Fix?          | 
| Major: Breaking Change?  | 
| Minor: New Feature?      | Yes
| Tests Added + Pass?      | Yes
| Documentation PR         |
| Any Dependency Changes?  |
| License                  | MIT

@JamesHenry This changes the AST format. CC @DanielRosenwasser for review.
Supports parsing type arguments on tagged template calls.
Should wait on Microsoft/TypeScript#23430 to be merged so we're sure we have the final syntax.
2018-07-26 10:44:43 -05:00
Qix
db2a9fc96e Fix order of optional argument reordering (#8376)
Previously, if the optional `opts` parameter wasn't passed, the _intent_ was to move the function it held into the `callback` parameter and null out the `opts` param - but instead, it was nulling both.
2018-07-26 11:25:35 -04:00
Sven Sauleau
75767e9273 Merge pull request #8381 from wtgtybhertgeghgtwtg/babelrcroots-array
Allow an Array for `babelrcRoots`.
2018-07-25 11:36:57 +02:00
wtgtybhertgeghgtwtg
4346a95b88 Perform check on each member of babelrcroots. 2018-07-24 16:57:24 -07:00
Maximilian Berkmann
26cbbb569f Bumped lodash to 4.17.10 (#8377) 2018-07-24 12:57:43 -04:00
Kevin Gibbons
a811cf78e1 Correctly parse interface methods named 'static' (#8374) 2018-07-24 09:25:55 +02:00
Henry Zhu
c70a32ab9d Throw when using Stage presets (#8293)
* inline stage presets into standalone, throw error with using Stage presets
2018-07-23 22:22:52 -04:00
Thiago Arrais
6f3a800677 Do not mutate ast (#8342)
This clones the given ast prior to working on it to avoid mutating the AST given to `transformFromAST`.
2018-07-23 22:20:55 -04:00
Kevin Gibbons
d781e207c8 Docs: fix typo in path (#8372) [skip ci] 2018-07-23 20:32:44 -04:00
James DiGioia
39e7ee6e65 Switch Pipeline types to extend NodeBase
This doesn't work because the `type` values are not compatible.
2018-07-22 18:55:12 -04:00
James DiGioia
094ef31c01 Wrap callback in try/finally
This ensures we clean up always if the callback throws.
2018-07-22 18:52:07 -04:00
James DiGioia
afd0638b74 Reuse hash token instead of new primaryTopicToken
Set whether we're in a pipeline in order to determine how to parse the
hash. The error message changes as a result, since the `hash` never
enters the block.
2018-07-22 18:46:31 -04:00
James DiGioia
6e41edb90f Fix TopicContextState type in Flow 2018-07-22 17:58:51 -04:00
dnalborczyk
8b10a44fe1 remove .then from dynamic import parser exception message (#8355) 2018-07-21 08:26:17 +02:00
dnalborczyk
adae1501ac update jest (major), babel-jest (major) (#8341)
updated `jest` and `babel-jest` to `v23`

fixed breaking change in `jest`:
- https://github.com/facebook/jest/blob/master/CHANGELOG.md#2300
- https://github.com/facebook/jest/pull/5558

_edit:_
forgot to mention. test runner fix is based on: https://github.com/babel/babel/blob/master/packages/babel-parser/test/helpers/runFixtureTests.js#L11
2018-07-19 10:43:35 -04:00
dnalborczyk
c8038f69fe update prettier (#8339) 2018-07-19 09:08:45 -05:00
dnalborczyk
30ea328e97 bump flow (#8338) 2018-07-19 09:41:09 -04:00
dnalborczyk
16b1f8c427 updates eslint, babel-eslint, eslint-plugin-flowtype, eslint-plugin-prettier (#8337) 2018-07-19 09:36:52 -04:00
Henry Zhu
a582cc5bd8 update changelog for .53/.54 [skip ci] 2018-07-18 08:54:05 -04:00
Henry Zhu
84282f199b v7.0.0-beta.54 2018-07-16 13:59:43 -04:00
Logan Smyth
52a569056c Merge pull request #8327 from loganfsmyth/drop-pattern-matching
Treat string ignore/only/test/include/exclude values as paths with only basic pattern matching
2018-07-16 10:11:23 -07:00
Henry Zhu
7446d06911 also default stage 2 to decoratorsLegacy true [skip ci] 2018-07-16 13:07:17 -04:00
James DiGioia
8817fcf03e Fix stage-0/1 import of pipeline/decorators proposals (#8317)
Just default to pipeline "minimal" and true for decorators for ease of use. We are going to remove the stage presets next so it's fine since it will error when using the plugin individually later.
2018-07-16 13:02:54 -04:00
Logan Smyth
6d177ba4c5 Remove micromatch and use a simple pattern matching utility. 2018-07-16 09:57:14 -07:00
Logan Smyth
935533cff3 Ensure that the wildcard interop is used with re-export + default. (#8316) 2018-07-14 12:49:31 -07:00
Logan Smyth
c4f67bfa57 Leave it to users to clear the require cache if they want to. 2018-07-14 12:48:58 -07:00
Logan Smyth
2854a187be Remove dependency on barely-used package. 2018-07-14 12:41:36 -07:00
rugk
62ee1adc85 Add link to audio version of song (#8320) 2018-07-13 15:34:40 -05:00
Logan Smyth
fd9ebf9e1d Remove option-filtering options from the final options results. (#8315)
| Q                        | A <!--(Can use an emoji 👍) -->
| ------------------------ | ---
| Fixed Issues?            | Fixes https://github.com/babel/babel-loader/issues/642
| Patch: Bug Fix?          | Y
| Major: Breaking Change?  | N
| Minor: New Feature?      |
| Tests Added + Pass?      | Yes
| Documentation PR Link    | <!-- If only readme change, add `[skip ci]` to your commits -->
| Any Dependency Changes?  |
| License                  | MIT

Since these were getting left in, things that loaded the config, and then passed in back to Babel would get `test` and such _twice_, which could lead to either bad configuration merging, or no configuration at all if the patterns were relative to different directories, as was the case in https://github.com/babel/babel-loader/issues/642.
2018-07-13 07:01:11 -07:00
James DiGioia
7931f4c241 Rename topicContextState -> .topicContext 2018-07-12 23:11:55 -04:00
James DiGioia
b847d40842 Inline readTopicContextState method 2018-07-12 23:10:07 -04:00
James DiGioia
e91a02cc49 Reuse declared type in function return value 2018-07-12 23:08:11 -04:00
James DiGioia
cc526940ee Quote proposals in error message 2018-07-12 23:07:09 -04:00
James DiGioia
7188820151 Delete commented code 2018-07-12 22:55:01 -04:00
James DiGioia
00845709ce Add comment for number sign 2018-07-12 22:48:53 -04:00
James DiGioia
b50fdc191e Inline function checkSmartPipelineHeadEarlyErrors
It's only used once.
2018-07-12 22:47:45 -04:00
James DiGioia
ef0f723fc5 Reverse yoda conditions
If "smart" proposal is, we'll no longer say.
2018-07-12 22:46:34 -04:00
Daniel Tschinder
dca6125128 Update pirates to 4.0 (#8308) 2018-07-11 16:04:27 -04:00
Henry Zhu
093483c399 remove yearly preset folders [skip ci] 2018-07-11 11:08:33 -04:00
Henry Zhu
b89234b1a2 v7.0.0-beta.53 2018-07-11 09:39:52 -04:00
Ryan Tsao
f2fd9e982e Make env preset build-data scripts reproducible (#8299) 2018-07-10 20:43:45 -05:00
Andy
301db1b921 TypeScript: Support type arguments on JSX opening and self-closing tags (#7799) 2018-07-10 17:19:42 -05:00
J. S. Choi
fbf62b4830 Implement Smart Pipeline proposal in @babel/parser 2018-07-09 22:44:27 -04:00
James DiGioia
19a1705293 Support pipeline proposal flag in @babel/parser (#8291) 2018-07-09 16:59:56 -04:00
Henry Zhu
10910a10f5 Remove yearly presets from repo, inline in standalone (#8274)
These were already deprecated in v6, just didn't remove the folders?
2018-07-09 14:23:25 -04:00
Henry Zhu
dd6da3b3af rm extra changelog [skip ci] 2018-07-07 18:44:43 -04:00
Henry Zhu
d2d2118a44 Move v4, v5, v6 changelogs to separate files [skip ci] (#8286) 2018-07-07 18:43:34 -04:00
Mateusz Burzyński
21de1581aa Fixed fixture tests after merge (#8287) 2018-07-07 18:40:15 -04:00
Mateusz Burzyński
b5e64cb66e Remove unused bindings when excluding keys with rest in loose mode (#8264) 2018-07-07 19:54:51 +02:00
Alan Pierce
44f738bcbf Upgrade upath to avoid yarn failure on node 10 (#8283) [skip ci]
upath 1.0.4 doesn't support node 10, and this was fixed in later versions
( https://github.com/anodynos/upath/pull/15 )
2018-07-07 10:52:55 -04:00
Henry Zhu
13153ede92 add changelog for 6.23.1-3 [skip ci] 2018-07-07 10:28:01 -04:00
Mateusz Burzyński
c0c13ae30f Introduce objectWithoutPropertiesLoose helper (#8261) 2018-07-06 15:03:44 -04:00
Henry Zhu
cea562c009 Revert micromatch upgrade (regression) [skip ci] (#8281)
Original PR: https://github.com/babel/babel/pull/8038
Ref Issue: https://github.com/babel/babel/issues/8184

Windows paths are broken so wanted to get a fix out since I don't see us fixing it correctly soon enough? I think that's more important than fixing the security warnings that don't apply to us until we can actually handle the change, otherwise need a version of the code that doesn't use the old dep but doesn't change the windows behavior or just remove the matching which will take some time.
2018-07-06 14:28:02 -04:00
James DiGioia
f93fa28c90 Improve error messages around pipeline option (#8279) 2018-07-06 13:01:35 -04:00
Brian Ng
430a105ae7 Compile against beta 52 (#8282) 2018-07-06 12:12:19 -04:00
Tatsuyuki Ishi
3e71108f82 Invoke Jest main file directly (#8187) 2018-07-06 10:09:49 -04:00
Tim Kendrick
e9184ed05e [babel-types] Fix isNodesEquivalent() behavior for TemplateElements (#8165)
Fixes #8163

The `isNodesEquivalent()` algorithm incorrectly assumes that any object properties must themselves be AST nodes, which is not the case here, causing the error.
2018-07-06 08:45:25 -04:00
Henry Zhu
663c96db04 v7.0.0-beta.52 2018-07-05 20:59:03 -04:00
Rubén Norte
85b7154f91 Add visitor key for Flow typeArguments in call expressions (#8273)
| Q                        | A <!--(Can use an emoji 👍) -->
| ------------------------ | ---
| Fixed Issues?            | Fixes #8272 <!-- remove the (`) quotes to link the issues -->
| Patch: Bug Fix?          | Yes
| Major: Breaking Change?  |
| Minor: New Feature?      |
| Tests Added + Pass?      | Yes
| Documentation PR         | <!-- If so, add `[skip ci]` to your commit message to skip CI -->
| Any Dependency Changes?  |
| License                  | MIT

The visitor for `typeArguments` in function calls wasn't set in the definition, so type annotations added there weren't visited.

This is required to fix https://github.com/babel/babel-eslint/issues/644
2018-07-05 14:58:15 -05:00
Henry Zhu
f70d7c8dfe update template [skip ci]
link to babel/website
2018-07-05 14:19:15 -04:00
Justin Ridgewell
e229ebbb8a Optimize async to generator (#8267)
* Optimize async to generator

We can reuse the step function, avoiding a closure on every invocation.

* Rename step
2018-07-05 10:51:16 -04:00
dnalborczyk
db1385fb82 upgrades eslint v5 (major), babel-eslint, eslint-plugin-flowtype, eslint-plugin-prettier (#8259)
* upgrade eslint v5 (major), babel-eslint (minor), eslint-plugin-flowtype (minor), eslint-plugin-prettier (patch)

* fix makefile: remove (default) .js file extension, remove non-existing glob pattern

* fix linting errors

* add '*.js' glob back to include babel.config.js for linting
2018-07-05 09:17:01 -05:00
Logan Smyth
b6eba87daa Rename some test fixtures so they run properly. (#8265) 2018-07-04 18:33:26 -07:00
Logan Smyth
2cf2fd544b Ensure that we don't get unexpected output files for tests that throw. (#8208) 2018-07-04 16:06:58 -07:00
Logan Smyth
9bd4b46fd6 Merge pull request #8198 from loganfsmyth/sourcemap-loading
Prefer explicit object maps, and properly load relative maps.
2018-07-04 15:39:42 -07:00
Pierre-Marie Dartus
4d125c391a Typescript: Avoid stripping class properties when a decorator is set (#8238)
The `babel-plugin-transform-typescript` removes class properties without value regardless if decorators are assigned to it or not.
2018-07-04 07:44:33 -04:00
dnalborczyk
afa1207224 upgrade flow to v0.75.0 (#8256) 2018-07-03 11:23:32 -05:00
Rodolfo Rodriguez
c6a4108e57 Update READMEs for yarn (#8215) [skip ci]
Closes https://github.com/babel/babel/pull/8255
2018-07-03 09:03:18 -04:00
John Buffington
236bd9309c remove emojis from cli output (#8243) (#8250) 2018-07-02 09:34:55 +02:00
James DiGioia
eac4c5bc17 Add proposal flag to pipeline plugin (#8196)
This is going to be required so we can add support for other proposals,
as well as later set the accepted proposal as the default.

Update stage-0 and stage-1 presets with `pipelineProposal` to thread down to
the plugin.
2018-06-28 01:19:40 +02:00
Mateusz Burzyński
e1662759ed Remove regenerator hacks in checkDuplicatedNodes (#8220) 2018-06-24 15:40:47 +02:00
Ben Newman
12c75cc08c Update regenerator-{runtime,transform} to latest versions. (#8219)
https://github.com/facebook/regenerator/pull/347
https://github.com/facebook/regenerator/pull/349
https://github.com/facebook/regenerator/pull/350
2018-06-24 10:19:21 +02:00
Sven Sauleau
9283efaeb7 Merge pull request #8197 from loganfsmyth/babel-plugin-allowed
Allow @foo/babel-plugin as an unexpanded plugin name, and @foo as a shorthand for it.
2018-06-20 16:36:03 +02:00
Logan Smyth
532c25c8db Ensure that file-path sourcemaps load relative to the file containing the comment. 2018-06-18 22:06:08 -07:00
Logan Smyth
3c90baaf6c Prefer object sourcemaps over file-inlined sourcemaps. 2018-06-18 21:49:23 -07:00
Logan Smyth
add5f8d0fe Allow @foo/babel-plugin as an unexpanded plugin name, and @foo as a shorthand for it. 2018-06-18 21:36:02 -07:00
Soumya Himanish Mohapatra
cb79473499 remove regression to support output of full directory hierarchy with --out-dir (#8189)
* remove regression to support output of full directory hierarchy with --out-dir

* add mkdirp to package.json
2018-06-18 21:19:46 -07:00
Brian Ng
d383659ca6 Compile against beta 51 (#8158) 2018-06-15 10:28:15 -04:00
Ger Hobbelt
e86d1e0d6a babel/parser: test helpers: write expected throw message to options.json ~ complete jest -u functionality (#8178) [skip ci]
* babel/parser: test helpers: when test fails with an exception and both reference output file and options.json file do not exist, write a simple options.json with the error message to expect when such a file doesn't exist yet. This completes the `jest -u` capability for new tests which are expected to *fail*.
2018-06-15 10:27:19 -04:00
Ger Hobbelt
a2cd264211 jest binary is a bash shell script, not a nodeJS file. (#8179) [skip ci] 2018-06-15 10:18:14 -04:00
Sven Sauleau
8f8b4e8e82 Switch new website in READMEs (#8181) [skip ci] 2018-06-15 10:13:20 -04:00
Ger Hobbelt
07c88e6f0b Use charCodes at more places in the parser (#8176) 2018-06-15 13:21:32 +02:00
Ger Hobbelt
ba98cf782a Removed constant condition in parser (#8177) 2018-06-15 13:14:14 +02:00
kenju
bc64e02bf8 fix issue number of link for #3508 in CHANGELOG (#8175) [skip ci] 2018-06-15 12:12:21 +02:00
Avi Vahl
0e8830f3a8 Fix unneeded uppercasing in comment 2018-06-15 02:46:02 +03:00
Avi Vahl
4cdfee768b Add jsdocs to parse() and parseExpression()
also change parameter name to match docs
2018-06-15 02:42:32 +03:00
Avi Vahl
adbf2a15f9 Clearer naming of interfaces 2018-06-15 01:12:58 +03:00
Avi Vahl
ca65781132 @babel/parser: expose a TypeScript definition file from package
This allows the new parser package to be used in TypeScript projects, with static type checking and auto-completions. IDEs like VSCode will use this to show auto completions even in JavaScript projects, which is a huge benefit to users wanting to use the parser directly.

This PR follows the auto-generated .d.ts that was added to @babel/types in #7101

- took outdated DefinitelyTyped babylon .d.ts and updated it using new site's documentation.
- added "typings" folder to package, with the new .d.ts
- connected new .d.ts via package.json's "types" field. also adjusted "files" so folder will be published.
- definition file uses TypeScript 2.9's new `import('package').Type` syntax.
2018-06-15 01:04:49 +03:00
dnalborczyk
814fce946d bump flow to v0.74.0 (#8162) 2018-06-13 15:00:09 -04:00
dnalborczyk
6894465df8 fix flow typeof refinement (#8161) [skip ci] 2018-06-13 14:59:57 -04:00
Ben Newman
60c4f30c71 Update regenerator-transform to latest version (0.13.0). (#8154)
| Q                        | A <!--(Can use an emoji 👍) -->
| ------------------------ | ---
| Fixed Issues?            | None
| Patch: Bug Fix?          | No
| Major: Breaking Change?  | No
| Minor: New Feature?      | No
| Tests Added + Pass?      | Existing tests pass
| Documentation PR         | No
| Any Dependency Changes?  | `regenerator-transform` in `@babel/plugin-transform-regenerator`
| License                  | MIT

I recently updated `regenerator`, `regenerator-transform`, and `regenerator-preset` to fix a number of vulnerabilities surfaced by `npm audit`. There was no need to update `regenerator-runtime`, as it does not have any dependencies of its own. I'm happy to report the latest versions of these packages have zero vulnerability warnings according to `npm audit`.

While I was at it, I also updated all dependencies of these packages to their Babel 7 equivalents, so there should hopefully be fewer legacy package dependencies installed because of Regenerator.
2018-06-13 09:36:27 -05:00
Henry Zhu
c313b267f7 v7.0.0-beta.51 2018-06-12 17:18:28 -04:00
Henry Zhu
eb54adb755 use a semver range for core peerDep [skip ci] 2018-06-12 17:10:15 -04:00
Henry Zhu
e0ef50c00f Use older semver range since lerna update does not change peerDeps on publish [skip ci] (#8152) 2018-06-12 16:45:10 -04:00
Henry Zhu
3af623678f v7.0.0-beta.50 2018-06-12 15:46:05 -04:00
Henry Zhu
96528d36df keep lerna version 2018-06-12 15:22:34 -04:00
Henry Zhu
5de12c26f6 update to latest 2.x lerna 2018-06-12 15:02:56 -04:00
Henry Zhu
4b5a55d937 fix merge issue again 2018-06-12 13:59:43 -04:00
Guy Bedford
036c429ce1 system hoisting and export refinements (#8104) 2018-06-12 13:45:53 -04:00
Nicolò Ribaudo
3c46e75b8f Don't split an exported class when renaming an inner binding (#8051) 2018-06-12 13:45:21 -04:00
晏兵兵
106907e605 fix: import Parser as type (#8146) [skip ci] 2018-06-12 13:42:10 -04:00
Nicolò Ribaudo
387cda8fbb isConstantExpression should return true for immuable bindings (#8122)
* isConstantExpression should return true for immuable bindings

* New test

* Don't return undefined
2018-06-12 13:40:52 -04:00
Henry Zhu
86c10ff4f3 fix merge issue 2018-06-12 13:33:07 -04:00
Miguel Albernaz
6d5392554f Adds JSXFragment to plugin-transform-typescript check for the presence of jsx (#7996) 2018-06-12 13:17:25 -04:00
Alexey Zaslavsky
0b25e3327c Fix 'Missing class properties transform' error when parsing class properties with Typescript syntax (#8007) 2018-06-12 13:13:30 -04:00
Brian Ng
b6455c611b Allow ts modifier names to be used as function argument names (#8030) 2018-06-12 08:38:38 -05:00
Yuri Karadzhov
313960e601 Remove preset-env outdated test (#8149) 2018-06-12 08:51:11 -04:00
Yuri Karadzhov
9e4c56f990 Fix Safari TP and regular versions comparison (#8132) 2018-06-11 14:36:45 -04:00
Nicolò Ribaudo
119db23ee3 Don't regenerate babel-types docs in the readme (#8142) 2018-06-11 14:35:21 -04:00
Vincent Chan
3432792568 add jsesc options support (#8143) 2018-06-11 14:34:41 -04:00
Brian Ng
cc4ee350e4 Ensure regex-dot-all runs before unicode-regex in preset-env (#8138)
<!--
Before making a PR please make sure to read our contributing guidelines
https://github.com/babel/babel/blob/master/CONTRIBUTING.md

For issue references: Add a comma-separated list of a [closing word](https://help.github.com/articles/closing-issues-via-commit-messages/) followed by the ticket number fixed by the PR. It should be underlined in the preview if done correctly.
-->

| Q                        | A <!--(Can use an emoji 👍) -->
| ------------------------ | ---
| Fixed Issues?            | --
| Patch: Bug Fix?          |
| Major: Breaking Change?  |
| Minor: New Feature?      |
| Tests Added + Pass?      | Yes
| Documentation PR         | <!-- If so, add `[skip ci]` to your commit message to skip CI -->
| Any Dependency Changes?  |
| License                  | MIT

Good ol' plugin ordering 🙃

Ref: https://github.com/babel/babel/pull/7065#issuecomment-395959112
2018-06-11 08:09:44 -05:00
Sven Sauleau
5bd79c70a5 Merge pull request #8144 from BeniCheni/add-labels-to-readmes
Add Labels to READMEs Generator & Update README's w. Links To Open Issues (for some pkg's)
2018-06-11 07:32:34 +02:00
BeniCheni
01f6f4c66d Revert babel-types README to "master" 2018-06-11 01:19:18 -04:00
BeniCheni
000fa83b9e For selective packages, update READMES w. links for open issues
babel-generator; babel-node; babel-standalone; babel-template
2018-06-11 00:16:48 -04:00
BeniCheni
efb34aa7dc For selective packages, add items for labels mapping of pkg => labels & update READMES w. links for open issues
babel-generator; babel-node; babel-standalone; babel-template
2018-06-10 23:41:55 -04:00
Brian Ng
ab928713af Bump test262-stream and update test262 tests (#8139) 2018-06-10 10:55:40 +02:00
Serhii Nanovskyi
3de053cc6c Validate @babel/preset-env options (#8031) 2018-06-09 18:38:14 -05:00
Sven Sauleau
110779e9f3 Merge pull request #8133 from alexzherdev/8131-open-issues-link
Link to open issues in READMEs [skip ci]
2018-06-09 15:03:49 +02:00
Alex Zherdev
8070a2204d Link to open issues in READMEs [skip ci] 2018-06-08 20:54:44 -07:00
Nicolò Ribaudo
9f4e2f81d8 [class-properties] Remove unnecessary return and temp variable (#8123)
* Remove unnecessary temp variable

* Update tests
2018-06-08 07:02:36 +02:00
Mathias Bynens
415d79bdfe Update plugin-proposal-unicode-property-regex for Unicode v11 (#8127)
Ref. https://github.com/tc39/ecma262/pulls/1218.
Ref. https://github.com/tc39/ecma262/issues/1219.
2018-06-07 21:54:44 +02:00
Mathias Bynens
62eb32677c ECMAScript follows the latest version of the Unicode Standard. Earlier this week, Unicode v11 was officially released. This patch updates babel-parser to support the new identifier characters. (#8125)
Ref. https://github.com/tc39/ecma262/issues/1219.
2018-06-07 21:54:12 +02:00
Guy Bedford
7da7e760a6 support import.meta in system transform 2018-06-07 13:24:19 -05:00
hassanAli321
bd44902024 update fixture 2018-06-07 13:22:45 -05:00
hassanAli321
6480ae4a9f fix flow-double-nullable-type-cant-be-parsed 2018-06-07 13:22:45 -05:00
Marco Massarotto
80b3362fcc update micromatch to ^3.1.10 (#8038) 2018-06-06 12:44:02 +02:00
Sven SAULEAU
8bc0182489 Merge pull request #8119 from palashmon/fix-package-readmes
fix(typo): in readmes package label
2018-06-05 19:24:25 +02:00
Palash Mondal
e9d861537f [skip ci] updated babel-register readme 2018-06-05 22:43:46 +05:30
Palash Mondal
153ad4c6f3 fix(typo): in readmes package label
"babel-regiser" to "babel-register" and "pkg: regiser" to "pkg: register"
2018-06-05 21:19:51 +05:30
Sven SAULEAU
218d69007e Merge pull request #8112 from babel/feat-add-issues-link-in-readmes
Feat add issues link in readmes
2018-06-05 07:39:41 +02:00
Nicolò Ribaudo
f838a7e9f1 Test on node 10 (#7908)
* Use node 10 on circle an node 9 on travis

* Update v8flag
2018-06-04 22:22:30 +02:00
Nicolò Ribaudo
6349118bed Change decoratorsBeforeExport default to false (#8113) 2018-06-04 21:12:01 +02:00
Sven SAULEAU
8bbb10c021 chore: [skip ci] regen READMEs 2018-06-04 17:33:21 +02:00
Sven SAULEAU
f614809002 feat: [skip ci] add link to issues in READMEs 2018-06-04 17:33:16 +02:00
Sven SAULEAU
b445b79734 Refactor move docs (#8108)
* feat: [skip] generate readme script

* docs: [skip ci] update READMEs

* docs: [skip ci] fix code block type

* chore: [skip ci] move generator script
2018-06-04 10:32:39 -04:00
Sven SAULEAU
b6eaaa2496 Merge pull request #8107 from babel/xtuc-patch-3
docs: [skip ci] update polyfill README
2018-06-04 08:46:51 +02:00
Sven SAULEAU
e2471337f4 docs: [skip ci] update polyfill README 2018-06-04 08:46:08 +02:00
Sven SAULEAU
826edd0bd5 Merge pull request #8106 from babel/xtuc-patch-3
update runtime README
2018-06-04 08:43:15 +02:00
Sven SAULEAU
f434a50829 docs: update runtime README 2018-06-04 08:42:48 +02:00
Brian Ng
5895277b32 Bump prettier to v1.13.2 2018-06-03 07:54:39 -05:00
Brian Ng
62114b807b Remove unneeded prettier call in make fix 2018-06-03 07:54:39 -05:00
chocolateboy
2abd7839e1 Fix ReferenceError in the wrapNativeSuper helper (#8100)
Fix a ReferenceError caused by a typo (`_construct` instead of
`construct`) in the external `wrapNativeSuper` helper. (The typo
doesn't usually cause an error in inline helpers because `_construct`
happens to be the default name given to the `construct` helper
function.)
2018-06-02 18:00:02 +02:00
Nicolò Ribaudo
b8dcd6f593 Remove parser support for decorators optional parentheses (#8037)
* Remove parser support for decorators optional parentheses

* Update fixtures
2018-06-02 13:07:15 +02:00
dnalborczyk
fe556c502d fix folder name (#8074) 2018-06-01 17:58:37 +02:00
Peter Leonov
ab62a94399 make isReferenced() recognise ObjectTypeProperty (#8060)
fixes #8057
2018-05-31 00:07:56 +02:00
Nicolò Ribaudo
d83d141e00 Move tests from babylon/ to babel-parserr/ 2018-05-30 22:12:33 +02:00
Nicolò Ribaudo
cb17f07ac9 Update syntax-decorators options (#7938)
* Add decoratorsBeforeExport to the syntax plugin
* Require legacy: true, like in the transform plugin
2018-05-30 22:00:18 +02:00
Logan Smyth
21b9b2e42d Avoid a race condition in CLI directory creation. (#8082) 2018-05-30 10:35:08 -07:00
Erik Arvidsson
2a8ebbe7ae Remove parenthesizedArgument (#7981)
The extra field parenthesizedArgument was never set to true. It was
always set to false and the code that read this was incorrectly
checking if extra was present.

Fixes #7957
2018-05-29 13:58:21 -07:00
Brian Ng
9add6d88f5 Update regenerator version and test retain lines fixture (#8072) 2018-05-29 10:46:05 -07:00
ilya
2d2f37fa6c Update core-js to v2.5.7 (#8064) 2018-05-29 09:47:15 -05:00
Erik Arvidsson
7846eaebaa Do not quote JSX attribute keys for IdentifierName (#8045)
Given the following

```js
a = <F new/>
```

We used to generate:

```js
a = React.createElement(F, {"new": true})
```

but now we generate

```js
a = React.createElement(F, {new: true})
```

If you need to quote these (ie for ES3 you can use
transform-property-literals)
2018-05-27 12:48:18 -04:00
Nicolò Ribaudo
d45ee5e025 Add "decoratorsBeforeExport" option to @babel/generator (#7948)
* Add "decoratorsBeforeExport" option to @babel/generator

* Docs
2018-05-27 08:50:26 +02:00
Brian Ng
f699f1bbbf flow@0.73.0 (#8032) 2018-05-25 16:53:23 -05:00
Sam Goldman
f0283572a5 Support Flow's proto modifier syntax for declared classes (#7978)
<!--
Before making a PR please make sure to read our contributing guidelines
https://github.com/babel/babel/blob/master/CONTRIBUTING.md

For issue references: Add a comma-separated list of a [closing word](https://help.github.com/articles/closing-issues-via-commit-messages/) followed by the ticket number fixed by the PR. It should be underlined in the preview if done correctly.
-->

| Q                        | A <!--(Can use an emoji 👍) -->
| ------------------------ | ---
| Fixed Issues?            | <!-- remove the (`) quotes to link the issues -->
| Patch: Bug Fix?          |
| Major: Breaking Change?  | No
| Minor: New Feature?      | Yes
| Tests Added + Pass?      | Yes
| Documentation PR         | <!-- If so, add `[skip ci]` to your commit message to skip CI -->
| Any Dependency Changes?  |
| License                  | MIT

See eb815be907 for more information about this feature.
    
The proto modifier indicates that a property declared using `x: T` syntax is actually present on the prototype object of the class, rather than an own property.
    
The proto and static modifiers are mutually exclusive, as class declarations don't simultaneously define the static prototype object, as they do the instance prototype.
    
This syntax is only supported on declared classes, not object types, interfaces, or runtime class declarations, and as such should only appear in library definitions.
2018-05-25 15:40:56 -05:00
Logan Smyth
90566103a6 v7.0.0-beta.49 2018-05-25 09:00:02 -07:00
Logan Smyth
cf8058e5b6 Handle kebab-case args in babel-node. (#8046) 2018-05-25 08:40:52 -07:00
Nicolò Ribaudo
90a174e7c4 Transform decorated classes from the export visitor (#8047)
Fixes gh-8041

<!--
Before making a PR please make sure to read our contributing guidelines
https://github.com/babel/babel/blob/master/CONTRIBUTING.md

For issue references: Add a comma-separated list of a [closing word](https://help.github.com/articles/closing-issues-via-commit-messages/) followed by the ticket number fixed by the PR. It should be underlined in the preview if done correctly.
-->

| Q                        | A <!--(Can use an emoji 👍) -->
| ------------------------ | ---
| Fixed Issues?            | #8041
| Patch: Bug Fix?          |👍
| Major: Breaking Change?  |
| Minor: New Feature?      |
| Tests Added + Pass?      | Yes
| Documentation PR         | <!-- If so, add `[skip ci]` to your commit message to skip CI -->
| Any Dependency Changes?  |
| License                  | MIT

<!-- Describe your changes below in as much detail as possible -->
2018-05-25 08:36:30 -07:00
Logan Smyth
9c707f9670 Update docs 2018-05-24 20:57:44 -07:00
Logan Smyth
53e4d74ebe Treat all filenames as absolute paths. (#8044) 2018-05-24 20:56:19 -07:00
Logan Smyth
98ff2ce877 Merge pull request #8023 from loganfsmyth/sync-async
Add a promise-returning *Async version of the transform and parse fns
2018-05-24 19:04:38 -07:00
Henry Zhu
0ffc8ed209 Compile against beta 48 (#8036) 2018-05-24 16:25:39 -07:00
Henry Zhu
e6d198eef5 v7.0.0-beta.48 2018-05-24 15:20:31 -04:00
Logan Smyth
86aacad2bc Disallow coverage on bundles. 2018-05-24 09:15:44 -07:00
Nicolò Ribaudo
6eab6f5863 [Babylon] Take the first set of options for plugins (#7994)
* [Babylon] Take the first set of options for plugins

* Fix test

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

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

This reverts commit f8ab9466d3.

* Only use getPrototypeOf if setPrototypeOf is implemented

* Update fixtures

* Helpers updates

* Update fixtures

* Fall back to getPrototypeOf

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

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

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

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

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

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

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

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

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

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

* Move to Stage 3

* Break diretive parsing

* Update README

* Handle multi-escape sequences

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

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

* Private properties!

* Fixes

* Tests

* Update helper name

* Fix privates that reference other privates

* Don't extend a builtin

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

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

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

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

* Fix babel-generator
2018-05-18 08:11:27 -05:00
Sam Goldman
a40f54f847 Add support for explicit type arguments in new and call expressions (#7934)
* Add all option to babel-plugin-syntax-flow

The Flow parser has some conditional logic based on whether types should
be parsed or not, which is based on either (a) the @flow pragma in the
docblock of the file of (b) the `all` configuration, provided via
command line or .flowconfig.

This commit adds the ability to provide the `all` configuration to
Babel as well, via the syntax-flow plugin. This should be set to `true`
if the project uses all=true.

* Parse @flow pragma

The Flow parser has some conditional logic based on whether types should
be parsed or not, which is based on either (a) the @flow pragma in the
docblock of the file of (b) the `all` configuration, provided via
command line or .flowconfig.

This commit parses the @flow (or @noflow) pragma from the first comment
in the source file. Directives are allowed to appear before the comment.

* WIP: add tests for explicit type arguments

This commit includes tests which have unexpected output, but will change
to the expected output as later commits add parsing support for various
features.

* Parse type arguments in new expressions

* Parse type arguments in call expressions

* Parse optional call expressions with explicit type args

* Add explicit type arguments to babel-types

Flow calls these typeArguments instead of typeParameters, which clearly
separates formal/actual parameters, and mirrors the existing arguments
key.

The existing definitions to support TypeScript also included Flow's
TypeParameterInstantiation node type, which I've moved to the the new
field.

* Add support for explicit type arguments to babel-generator

* Add test for explicit type args to transform-flow-strip-types plugin

* Oops. Forgot to regenerate the babel-types README.

* Fix Flow parser shouldParseTypes() function

I was looking at `options.all`, but the correct property ws
`options.flowAll`. Oops!

* Remove typeapp_call from whitelist of expected failures

Now that Babylon parses this syntax extension, we can remove the
typeapp_call tests from the list of expected differences.

Note that I am using the `flowAll` option, mirroring the behavior of the
Flow tests, which assume types without requiring the `@flow` pragma.

* Use Babylon plugin options instead of parser options

* Parse optional call expressions type arguments unambiguously
2018-05-18 08:05:16 -05:00
Nicolò Ribaudo
6226c52f43 Add "legacy" prefix to legacy decorators tests (#7975) 2018-05-18 14:46:07 +02:00
Lars Willighagen
25153359f7 helper-plugin-utils: Move README [skip ci] (#7972)
Move README from src to package root, as in other packages.

Closes #7971
2018-05-18 10:00:25 +02:00
Nicolò Ribaudo
2351a638b5 Fix bugs in the _wrapNativeSuper helper (#7533)
* Remove second wrapper from _wrapNativeSuper

* Fix tests on node 4

I DON'T KNOW WHY IT WORKS.

* Update fixtures

* Use Reflect.construct

* Parens

* Fix things

* Fix things

* Undo changes

* Fix with sham

* Typo
2018-05-18 00:04:12 +02:00
Rubén Norte
bc6f0f989d Re-add support for local Flow bindings (TypeAlias, OpaqueTypeAlias and Interface) (#7900) 2018-05-17 10:54:14 -07:00
Sam Goldman
af7ab71486 Allow flow internal slot properties to be optional (#7959)
See 23d1b1c5f2
2018-05-17 19:01:03 +02:00
Logan Smyth
ac13c302f7 Merge pull request #7929 from loganfsmyth/cli-refactoring
Refactor babel-cli to use async functions for async handling, and centralize option loading
2018-05-16 20:58:46 -07:00
Sam Goldman
b396cdcbe5 Internal slot properties (#7947)
* Support internalSlots to babel-types and babel-generator

* Parsing support for internal slot properties

* Print internal slots in babel-generator

* Add whitespace before first internal slot property
2018-05-16 22:48:12 -05:00
Michal Artazov
8dcfabd0d7 update core-js to 2.5.6 (#7950) 2018-05-16 10:08:19 -07:00
Nicolò Ribaudo
e45d5c3b65 Add an option to Babylon to have decorators before export (#7869)
* Add support for plugin options in Babylon

They work similarly to how they work in Babel. e.g.
  babylon.parse({
    options: [
      "plugin1",
      ["plugin2", { option: true }]
    ]
  });

The inernal api to get an option is
  this.getPluginOption("pluginName", "option")
If the plugin isn't defined, it returns undefined.

* Add Babylon option decorators.secoratorsBeforeExport

* Nit
2018-05-15 11:39:53 -05:00
Logan Smyth
8ff675ad69 Refactor CLI to use promises/async fns. 2018-05-14 23:07:50 -07:00
Logan Smyth
a955efa3e3 Ensure that calling register fully resets the state. (#7930) 2018-05-14 23:04:56 -07:00
Logan Smyth
51db3e9a5d Bug fixing for Node 10 (#7931) 2018-05-14 23:02:01 -07:00
Logan Smyth
41ca312545 Define a clear separation between Babel and CLI options. 2018-05-14 22:03:47 -07:00
Logan Smyth
a192f8beb4 Limit node version to current LTS. 2018-05-14 21:54:16 -07:00
Henry Zhu
f03adbadf4 v7.0.0-beta.47 2018-05-14 17:15:44 -07:00
Henry Zhu
97145ad01e add publishConfig for new packages [skip ci] 2018-05-14 17:12:13 -07:00
Caleb Eby
25810d2609 Fix handling of different JSX pragmas in Typescript (#7878)
Fixes #7631

Before, if a JSX pragma was imported, the import was removed because
it did not think it was used as a value. This changes it so it knows
that the import is being used as a JSX pragma
2018-05-14 15:01:45 -07:00
pravdomil
5f58117790 update @babel/preset-latest docs (#7854) [skip ci] 2018-05-14 14:59:21 -07:00
Logan Smyth
dca2631ef0 Merge pull request #7911 from loganfsmyth/config-babelrcroots
Allow 'babelrc' and 'babelrcRoots' in config files (but not .babelrc/extends)
2018-05-14 10:41:22 -07:00
Nicolò Ribaudo
ba11d9fa7c Update test262 and flow tests (#7925) 2018-05-14 12:26:28 -05:00
Stian Håklev
e06cf20d2e Update babel/core README.md (#7913) [skip ci] 2018-05-14 10:25:53 -07:00
Logan Smyth
df1afa3160 Fix watch bug with output-dir paths. (#7875) 2018-05-13 08:54:04 -05:00
Karl Alnebratt
cec93c01ce Babel-cli update dependencie chokidar (#7853) 2018-05-13 10:58:33 +02:00
Nicolò Ribaudo
0a8367c979 Use the correct Babylon plugins for Test262 tests (#7916) 2018-05-13 10:52:19 +02:00
Mathias Bynens
ac5d2ba984 Update regexpu-core to v4.1.4 (#7917)
Fixes #7891.
2018-05-12 18:46:11 -07:00
Dennis Czombera
040ba2bf53 Remove no longer needed #__PURE__ annotations for taggedTemplateLiteral helper (#7914)
* Remove pure comment annotation

* Update outputs
2018-05-12 15:19:33 +02:00
Logan Smyth
98f0808a22 Ensure the the config file isn't re-processed when users load a partial config and then pass it back to Babel. 2018-05-11 17:49:12 -07:00
Logan Smyth
bdcfb697a6 Use 'babelrc' and 'babelrcRoots' from config file, if not specified. 2018-05-11 17:49:11 -07:00
Logan Smyth
0341d299c8 Validate different file types with different rules. 2018-05-11 16:51:43 -07:00
Logan Smyth
1a7765712e Validate the file before loading chain. 2018-05-11 15:29:28 -07:00
Nicolò Ribaudo
b87c43d894 Update @babel/plugin-codemod-object-assign-to-object-spread version (#7906) 2018-05-11 13:14:17 -04:00
Brian Ng
02c4a28608 Fix typescript decorator test (#7904) 2018-05-10 17:31:38 -05:00
Dennis Czombera
4260ffd7ec Lazy load tagged template literal strings (#7855)
* Lazy load tagged template literal strings

* Update snapshots to reflect lazy loading

* Use pure annotation and remove unnecessary parenthesized expression

* Update snapshots

* Optimize lazy loading by doing assignment within logical expression

* Update snapshots to reflect optimization

* Use re-define function pattern to avoid hitting function size deopts

* Update snapshots to reflect the usage of the redefining function pattern
2018-05-10 14:54:10 -04:00
Nicolò Ribaudo
25c3f0d689 Rename decorators&decorators2 plugins to decorators-legacy&decorators. (#7821)
Reasons:
1) Naming consistency with Babel plugins
2) Sooner or later the decorators2 plugin should become decorators anyway
2018-05-10 20:01:35 +02:00
Brian Ng
21b03c35d3 Fix lint and yarn.lock 2018-05-10 09:22:45 -05:00
Brian Ng
ee1ee0e7ae Clean up and add some additional polyfill mappings in preset-env (#7809) 2018-05-10 09:09:38 -05:00
Willa Wang
73f8059ea0 Fix typo in rewrite-live-references.js (#7896) [skip ci] 2018-05-09 20:30:02 -04:00
Daniel Taveras
70e3454d7a Fix a typo in a babylon flow plugin comment [skip ci] (#7898) 2018-05-09 20:29:22 -04:00
Rocky Meza
9dab691302 Fix typo [skip-ci] (#7897)
Thanks!
2018-05-09 20:28:34 -04:00
Carlos Villavicencio
95fc38cecf Bumped lodash version (#7895)
* Bumped lodash version

* Fixed typo

* Fixed typos

* Revert "Fixed typo"

This reverts commit 06cfe9d4edba0b99257cbffc6dc08ae2f3460d78.

* Revert "Fixed typos"

This reverts commit ec3975c7392df9a0a42682ee4f32eadd2615c69c.

* Fixed json typos
2018-05-09 15:47:52 -07:00
Michael Mantel
84e76e2d49 TypeScript: Allow non-null and type assertions as lvalues. (Fixes #7638) (#7888) 2018-05-09 16:45:50 -05:00
Sven SAULEAU
0d9eef4750 Merge pull request #7893 from aaronabramov/patch-1
fix typo in a comment
2018-05-09 18:30:59 +02:00
Sven SAULEAU
d2ed7bbc8d Update output.js 2018-05-09 18:21:14 +02:00
Aaron Abramov
5b5ac1f366 fix typo in a comment
as title
2018-05-09 12:09:45 -04:00
Tim Seckinger
fa1547d8f8 fix(transform-typescript): do not elide injected imports (#7833) 2018-05-09 10:05:29 -05:00
Brian Ng
b42b21f25c Fix bug with handling minor versions when parsing compat-data (#7884) 2018-05-08 10:52:44 -05:00
Brian Ng
6dca0ff9bf Improve useBuiltIns: usage mappins in preset-env (#7810) 2018-05-07 11:45:09 -05:00
Henry Zhu
3e9b59c0f1 reorg lock yml [skip ci] 2018-05-07 11:28:25 -04:00
Henry Zhu
3f6c475aae update patreon sponsors [skip ci] 2018-05-07 11:04:05 -04:00
Henry Zhu
5c31e501d7 update issue templates [skip ci] 2018-05-04 09:40:18 -07:00
Henry Zhu
ed6b4e0e40 fix line endings [skip ci] 2018-05-04 09:37:42 -07:00
Henry Zhu
8615b6fe57 Support issue template [skip ci] (#7863) 2018-05-03 16:45:00 -07:00
Henry Zhu
95fa5a66b1 issue templates [skip ci] (#7862) 2018-05-03 15:09:25 -07:00
Henry Zhu
c94355c1c9 update issue templates [skip ci] (#7861) 2018-05-03 15:00:33 -07:00
Henry Zhu
839bf68d1f [skip ci] 2018-05-03 14:44:19 -07:00
Henry Zhu
8198b1b334 lock old issues only (temporary) [skip ci] 2018-05-03 14:26:58 -07:00
Brian Ng
d608535719 Allow parsing of decorators with TypeScript abstract classes (#7850)
* Allow parsing of decorators with TypeScript abstract classes

* avoid lookahead
2018-05-02 13:49:46 -05:00
Brian Ng
0353ce9ed5 Disallow flow type parameter defaults in some cases 2018-05-02 08:56:54 -05:00
Brian Ng
65ca968f8b Allow static? as identifier in ObjectTypeProperty 2018-05-02 08:56:54 -05:00
Brian Ng
77445cb044 Enable dynamicImport plugin for flow tests 2018-05-02 08:56:54 -05:00
Brian Ng
7c4509e280 Retry flow tests in script mode only if it is supposed to succeed 2018-05-02 08:56:54 -05:00
Henry Zhu
87ae286bc3 changed to 3 months of no-activity on a closed issue [skip ci] 2018-05-01 22:33:37 -07:00
Henry Zhu
9c1b3e8dc1 Add support/regression issue templates [skip ci] (#7851) 2018-05-01 22:06:11 -07:00
Henry Zhu
39d07638cf remove custom [skip ci] 2018-05-01 20:48:55 -07:00
Henry Zhu
e887eecda4 Update issue templates [skip ci] 2018-05-01 20:47:02 -07:00
Logan Smyth
a3e622ad15 Fix inputSourcemapMerge when no JS content is output. 2018-05-01 20:31:29 -07:00
Hana Shiro
494a56df5f Unify main property in package.json [skip ci] (#7825) 2018-05-01 09:15:02 -07:00
Michael Mantel
8060ae5dae Improve README's for several plugins. [skip ci] (#7844) 2018-05-01 10:24:53 -05:00
Henry Zhu
bd4ebc11c1 add a label when locking old issues [skip ci] 2018-05-01 07:16:26 -07:00
Henry Zhu
80cefaff2f add lock bot for old closed issues [skip ci] (#7839) 2018-04-30 22:28:23 -07:00
Brian Ng
e9d5073af1 Remove duplicate text in browserslist rec inside preset-env [skip ci] 2018-04-30 17:01:34 -05:00
Andrey Sitnik
c8fb48ffd6 Change babel-preset-env docs according Browserslist best practices (#7835) 2018-04-30 16:25:32 -05:00
jugglinmike
55ef39eb87 Correct typo [skip ci] (#7834) 2018-04-28 15:48:53 -07:00
Andrey Sitnik
91e1e1728c Use queries according Browserslist Best Practices (#7828) [skip ci] 2018-04-27 18:50:26 -04:00
Logan Smyth
acf509bab5 Upgrade Babel to self-host with beta.46 (#7784) 2018-04-27 15:04:37 -07:00
James DiGioia
4f312f5739 Add syntax error test for arrow w/ paren'd args 2018-04-27 23:15:21 +02:00
James DiGioia
696f84468e Add test for params w/ parens around them 2018-04-27 23:15:21 +02:00
James DiGioia
71fd37067e Avoid lookahead when parsing pipeline
The error message is worse, but it is much more performant.
2018-04-27 23:15:21 +02:00
James DiGioia
7142a79eb9 Bring pipelineOperator flag in line with minimal
The minimal proposal requires parentheses around arrow functions
and bans await from the pipeline.
2018-04-27 23:15:21 +02:00
Renée Kooi
1a6855eff2 Fix default sourceFileName. (#7764)
* Fix default sourceFileName.

This deals with a problem mentioned in [babel/babelify#255][0]. I'm not
super sure about the implications, but it seems this may have been a
regression from Babel 6.

In babel@6, the default `sourceFileName` was the basename of the input
file:

```js
require('babel-core').transform('var a = 10', {
  filename: __filename,
  sourceMaps: true
}).map
// { version: 3,
//   sources: [ 'index.js' ],
//   names: [ 'a' ],
//   mappings: 'AAAA,IAAIA,IAAI,EAAR',
//   file: 'index.js',
//   sourcesContent: [ 'var a = 10' ] } }
```

Currently however, the full file path is used:

```js
require('@babel/core').transformSync('var a = 10', {
  filename: __filename,
  sourceMaps: true
}).map
// { version: 3,
//   sources: [ '/home/goto-bus-stop/Code/babel/repro-babelify-255/index.js' ],
//   names: [ 'a' ],
//   mappings: 'AAAA,IAAIA,IAAI,EAAR',
//   file: '/home/goto-bus-stop/Code/babel/repro-babelify-255/index.js',
//   sourcesContent: [ 'var a = 10' ] } }
```

This patch adds the `path.basename()` call that [Babel 6 used][1] to
@babel/core's default options, so it's the same as back then.

```js
require('../babel/packages/babel-core').transform('var a = 10', {
  filename: __filename,
  sourceMaps: true
}).map
// { version: 3,
//   sources: [ 'index.js' ],
//   names: [ 'a' ],
//   mappings: 'AAAA,IAAIA,IAAI,EAAR',
//   sourcesContent: [ 'var a = 10' ] }
```

This is the desired behaviour for browserify at least, as it expects
relative paths in the source maps and rebases them to a root directory
when generating the final source map.

[0]: https://github.com/babel/babelify/pull/255
[1]: 6689d2d23c/packages/babel-core/src/transformation/file/index.js (L163-L172)

* Use cwd-relative path for sourceFileName.

* Revert sourceMap `file` property change.

* fixup! Revert sourceMap `file` property change.

* Fix whitespace change from merge conflict

* Revert to using basename in source map outputs.
2018-04-27 13:28:23 -07:00
Michael Mantel
1de36948ac Expand README for plugin-transform-instanceof [skip ci] (#7827) 2018-04-27 15:21:09 -05:00
Hana Shiro
b28ffedead Fix configuration of lerna-changelog (#7803) [skip ci] 2018-04-26 22:52:02 -04:00
Michael McGlynn
a5edab7393 Change const to var inside helper 2018-04-26 23:33:12 +02:00
Justin Ridgewell
725e6a01c0 Don't fold class property calls (#7814)
This undoes the property call folding from #6656.

It complicates the private property transforms, since they boil down to `map.set(this, vlaue)` and we definitely don't want the next call define a property on the map.

/cc @Andarist
2018-04-26 15:06:18 -05:00
Evan You
224ce38882 fix(preset-stage-3): pass along loose flag to proposal-object-rest-spread (#7819) 2018-04-26 11:04:34 -05:00
Justin Ridgewell
8c46fd159f Class Props: Don't rename constructor collisions with static props (#7813)
Static props aren't evaluated inside the constructor, so there can't be a collision.
2018-04-25 23:45:52 -04:00
Brian Ng
47201db61e Bump compat-table for preset-env (#7808) 2018-04-25 16:23:49 -05:00
Logan Smyth
138d60922c Merge pull request #7761 from loganfsmyth/bad-map-merge
Reimplement input sourcemap merging using range matching instead of closest-position matching
2018-04-25 12:29:19 -07:00
Logan Smyth
cfb386ff03 Reimplement input sourcemap merging. 2018-04-25 12:02:05 -07:00
Logan Smyth
9e7fe0ab49 Add type definitions for source-map library. 2018-04-25 12:02:05 -07:00
Logan Smyth
e31e907d5f Split sourcemap merging logic into its own file. 2018-04-25 12:02:05 -07:00
Logan Smyth
4da4728bf5 Add an example of an extremely bad sourcemap merge. 2018-04-25 12:02:05 -07:00
Brian Ng
0112479ba9 Upgrade to gulp@4 (#7811) 2018-04-25 15:01:35 -04:00
Brian Ng
408124438a Update shippedProposals in preset-env docs [skip ci] (#7807) 2018-04-25 09:16:03 -05:00
chocolateboy
eab4c0e93e Fix typo [skip ci] (#7805) 2018-04-25 09:06:12 -05:00
Lars Willighagen
d06bf993db Change SO link to HTTPS
Since SO supports HTTPS now.
2018-04-25 11:53:15 +02:00
Henry Zhu
1076018c4c Internal: compile with loose to object rest/spread (#7794) 2018-04-24 10:41:05 -04:00
Henry Zhu
07ff8f30f5 preset-env update targets recommendation [skip ci] (#7790) 2018-04-24 10:33:52 -04:00
Hana Shiro
e6ba0ab82c Fix indent in .travis.yml (#7792) 2018-04-24 08:47:20 -05:00
Justin Ridgewell
2afe9404fe Use Object Spread Syntax (#7777)
* Use Object Spread Syntax

* Nits
2018-04-23 21:44:27 -04:00
Henry Zhu
037fee8ffb Target Node 6 in production (#7782) 2018-04-23 17:20:48 -04:00
Logan Smyth
3a2aa9b862 v7.0.0-beta.46 2018-04-22 21:29:42 -07:00
Logan Smyth
c8b57f777a Ensure that the internal plugin load does not read the user's config. (#7783) 2018-04-22 20:32:52 -07:00
Henry Zhu
b414387bb1 v7.0.0-beta.45 2018-04-22 21:55:16 -04:00
Evan Scott
0bb71caad3 Add noConflict entry mode to @babel/polyfill + change error to warning (#6371)
* feat: add noConflict polyfill entry
* use a warning
2018-04-22 19:11:50 -04:00
Logan Smyth
d6dcbdad48 Merge pull request #7358 from loganfsmyth/babelrc-resolution-changes
Allow more flexible file-based configuration while preventing .babelrcs from breaking things
2018-04-22 13:28:05 -07:00
Logan Smyth
8606b76438 Split babelrc option into babelrcRoots. 2018-04-22 13:00:28 -07:00
Justin Ridgewell
34d73ebef0 Correct update expression Number coercion (#7766)
* Correct update expression Number coercion

You have to `ToNumber` whatever the `UpdateExpression` argument is.

* Fix systemjs update expression
2018-04-22 13:50:11 -04:00
Justin Ridgewell
890a45216f Update super property get/set/call in loose mode (#7774)
* Update super property get/set/call in loose mode

Follows the plan laid out in https://github.com/babel/babel/pull/7553#issuecomment-381434519.

With #7691, this closes #7553, closes #4312.

* Post #7772

* Memoized property
2018-04-22 13:49:19 -04:00
Justin Ridgewell
0a257e8972 Move more class state out of replaceSupers (#7750)
Yes, the output is uglier. But, this is necessary for me to refactor
`replaceSupers` for #7733, which is necessary for both #7555 and
https://github.com/babel/babel/pull/7553#issuecomment-381434519.

I'm still in the middle of cleaning up all this code. Don't expect
`transformClass` to survive much longer as it's written currently.
2018-04-21 22:56:14 -04:00
Justin Ridgewell
3616137864 Memoize computed super properties (#7776)
Fixes #7775.
2018-04-21 22:15:02 -04:00
Justin Ridgewell
f8ab9466d3 Move subclass inheritance to end (#7772)
We were using `Object.create` to setup the prototype chain at the start of the class definition, which lead to #7771.

I was a bit worried about a speed hit, but it seems everyone optimizes the two patterns the same way.
https://jsbench.github.io/#f9fca52407643d96458a35763b201215

Fixes #7771.
2018-04-21 17:31:44 -04:00
Justin Ridgewell
8f24f91166 Implement MemberExpressionToFunctions helper (#7763)
* Implement MemberExpressionToFunctions helper

Fixes #7733.

This will also be used to simplify the Private Fields transform, which had [almost the same code](ccd941057a/packages/babel-plugin-proposal-class-properties/src/index.js (L114-L217)) hand written.

* Cleanup

* Little more comment cleanup

* Use unary plus

This can't be redefined, unlike the `Number` identifier.

* Review comments

* Remove unused deps
2018-04-21 13:13:42 -04:00
Henry Zhu
dbdce0e4e4 add overwrite for tests [skip ci] 2018-04-21 11:46:15 -04:00
Vinh Le
4595c7fdfd Correct test running command (#7768) [skip ci]
* Correct test running command

* Also refine test/index.js content
2018-04-21 11:35:48 -04:00
Yosuke Kurami
1f97b91655 fix: don't write ': ' token when name is null (#7769) 2018-04-21 11:34:24 -04:00
Christopher Hiller
b0e1e84471 drop support for Node.js v4 (#7755)
* drop support for Node.js v4; closes #7753

- remove version 4 from Travis build matrix
- update environment support doc
- update `CONTRIBUTING.md`
- update `engines` field of root `package.json`

Signed-off-by: Christopher Hiller <boneskull@boneskull.com>

* update engines for babylon

Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
2018-04-21 01:09:10 -04:00
Logan Smyth
f7c26bf2bf Add some docs for config searching. 2018-04-20 17:00:54 -07:00
Logan Smyth
a67eb25547 Only search for .babelrc files in the 'root' package by default. 2018-04-20 17:00:53 -07:00
Logan Smyth
485e37fcb0 Support a babel.config.fs file in a 'root' directory. 2018-04-20 17:00:53 -07:00
Logan Smyth
f013dab5fb Restrict .babelrc resolution to within a given package. 2018-04-20 17:00:53 -07:00
Brian Ng
e45b58dcb1 Fix small typo with decorators legacy option [skip ci] (#7762) 2018-04-19 20:26:54 -05:00
Henry Zhu
339dfddca5 Merge pull request #7734 from nicolo-ribaudo/decorators-legacy-option
Decorators legacy option
2018-04-19 14:36:18 -04:00
Brian Ng
0cd868a5f2 fixup tests 2018-04-19 09:17:33 -05:00
Nicolò Ribaudo
29db23ed87 Remove old comment 2018-04-19 09:08:15 -05:00
Nicolò Ribaudo
2679d6775c Add "decoratorsLegacy" to presets 2018-04-19 09:08:15 -05:00
Nicolò Ribaudo
96316dcf88 Add legacy option to plugin-proposal-decorators. 2018-04-19 09:08:14 -05:00
Logan Smyth
42244123e1 Update the docs to correctly reflect default value changed in #7436. [skip ci] 2018-04-18 23:33:34 -07:00
Andy
4b97e837ea Fix type error (#7752) 2018-04-18 15:31:15 -04:00
Brian Ng
3299086955 Add support for flow implements (#7741) 2018-04-18 08:54:30 -05:00
Jason Quense
2bded404f3 Improve asyncIterator error (#7745)
* Improve asyncIterator error

When an object is has neither asyncIterator or iterator defined, throw the "not an async iterable" error

* Correct logic

* reduce access

* Update helpers.js
2018-04-17 21:02:53 -05:00
Justin Ridgewell
21c7ff3f37 Classes cleanup (#7737)
* Cleanup

* Move verifyConstructorVisitor out of closure
2018-04-17 17:52:43 -04:00
Nicolò Ribaudo
341bdab90c Update decorators parsing (#7719)
* Update decorators parsing

This commit introduces three changes:
1) Class properties can be decorated
2) Decorators can contain arbitrary expressions, using @(...)
3) The Decorator node type has a new property, "arguments". This
    makes it possible do distinguish @dec() and @(dec()), which have
    different behaviors because @(dec()) is equivalent to @(dec())().

* Rename Decorator#expression to Decorator#callee

* Add test for @dec()()
2018-04-17 16:22:03 -05:00
Brian Ng
81149a5cc9 Add initial support for ES2018 in preset-env (#7658) 2018-04-17 16:16:33 -05:00
Mateusz Burzyński
5166eef103 Optimize class properties output (#6656) 2018-04-15 01:03:47 -04:00
Justin Ridgewell
0ee9a4e612 Fix default class super inheritance (#7732)
Fixes #7683.
2018-04-14 15:15:40 -04:00
Henry Zhu
858a2c74e7 update readme [skip ci] 2018-04-14 15:13:31 -04:00
Justin Ridgewell
668358c4d0 Fix class properties after nested class' bare super (#7671)
* Fix class properties after nested class' bare super

Fixes #7371.

* Fix node 4 test

* This damn node 4 test

* All of the ClassBody, but not the methods or field inits

* tmp

* tmp

* Use common class environment visitor

* Tests

* Use skipKey to avoid recursive traversal

* Remove old state

* Use jest expect
2018-04-14 13:48:38 -04:00
Justin Ridgewell
39b05598a0 Drop Chai from packages (#7729) 2018-04-14 09:01:38 -04:00
Justin Ridgewell
29eafbbf44 Remove tagged template literal global caching (#7722)
* Remove tagged template literal global caching

Fixes #7350.

* Review comments

* assert output
2018-04-13 11:51:00 -04:00
Henry Zhu
7a106025ea Merge pull request #7720 from devenbansod/migrate_to_jest_expect-3
Migrate more packages' tests to use jest expect assertions
2018-04-13 11:04:44 -04:00
Deven Bansod
4f1473da3d Remove global chai.assert in fixture runner's test context 2018-04-13 19:14:30 +05:30
Deven Bansod
c62b202e6a Migrate remaining test assertions to jest-expect 2018-04-13 19:14:03 +05:30
Deven Bansod
a084339a15 Migrate -computed-properties and -jscript tests to use jest expect assertions 2018-04-13 16:30:06 +05:30
Deven Bansod
d7987fbbd2 Migrate -transform-object-super tests to use jest expect assertions 2018-04-13 14:21:02 +05:30
Deven Bansod
8a31eabf5e Migrate -transform-classes tests to use jest expect assertions 2018-04-13 14:20:51 +05:30
Deven Bansod
80428dec47 Migrate -optional-catch-binding, -block-scoping to use jest expect assertions 2018-04-13 14:19:49 +05:30
Dennis Czombera
61ec5ce957 Provide better error message for invalid default export declaration (#7717) 2018-04-12 17:07:41 -05:00
Alexander Pepper
1e41f613bb [babel-preset-typescript] Fixed link of plugin-transform-typescript. (#7700) [skip ci] 2018-04-12 16:44:43 -04:00
Nicolò Ribaudo
a86d14de61 Disallow super() in class properties 2018-04-12 22:41:28 +02:00
Nicolò Ribaudo
a62cfe9045 Disallow arguments in class properties 2018-04-12 22:41:28 +02:00
Nicolò Ribaudo
f797454a18 Disallow super in functions in class properties 2018-04-12 22:41:28 +02:00
Justin Ridgewell
ec882be44d Uncomment super increment expression set tests (#7721)
This was failing because of the bugs fixed by #7687.
2018-04-12 13:24:07 -04:00
Justin Ridgewell
ecbf0dd53c Fix super nested class bugs (#7691)
* Properly traverse nested class for supers

* Add object nested in class cases

* Add object nested object cases

* Test class properties

* Undo changes to lerna.json

* Add tests arournd prefix/postfix super increment

* tmp

* Use sets
2018-04-12 13:02:26 -04:00
Nicolò Ribaudo
af3d6526e7 Add slack links to CONTRIBUTING.md (#7713) 2018-04-11 21:56:45 -05:00
Deven Bansod
95894397eb Migrate babel-cli and babel-generator tests to use jest-expect (#7549) 2018-04-11 13:12:56 -05:00
Justin Ridgewell
b1c9af3f05 Use new isInStrictMode (#7714) 2018-04-11 12:17:01 -04:00
Justin Ridgewell
ec3722b3f9 Get set helpers (#7687)
* Improve get/set helper

* fixtures

* Edge cases

* Add loose edge cases

* Spec compliant

* Add issue case

* Even more edge cases!

* Final updates

* Fix name

* Use Reflect.{get, set} when available

* Avoid block scoping in loose

* Remove semicolon

* Do not redefine a non-enumerable

* Get strictness from call site, not helpers

* Add called assertions

* Classes are always strict

* Update test fixture
2018-04-11 11:56:59 -04:00
Justin Ridgewell
7ae724f553 Add Path#isInStrictMode (#7712)
* Add Path#isInStrictMode

* Fix undefined directives

* Explicitly return for arrow expressions
2018-04-11 09:13:38 -04:00
Markus Török
6597a472b3 Add "use strict" directive (#7411)
* #7349
- Add "use strict" directive to transformed class bodies

* Update tests (#7349)

* Add test for program with use strict directive (#7349)

* Update tests (#7349)

* Update source mapping (#7349)

* Add test for parent blockStatement with use strict directive (#7349)

* Update tests (#7349)

* Update tests (#7349)

* Update tests (#7349)

* Add test for constructor-only class (#7349)

* Constructor only classes are strict, too

But constructor only that use non-simple parameters must use a strict function wrapper.

* Fix test

* Wrapper not needed if class is already strict

* Revert change to lerna.json
2018-04-10 17:33:38 -04:00
Hendrik Niemann
fdd0789936 Fix literal type annotation argument number (#7706)
Added the value argument to the visitors of flow literal type
annotations.
Literal type annotations need a value since they work very much like
primitive literals in normal JavaScript.

Fixes #7697
2018-04-10 09:38:20 -04:00
Guy Bedford
5b1332457c arrayWithHoles internal function name consistency (#7709) [skip ci] 2018-04-10 09:33:54 -04:00
Justin Ridgewell
3177f05904 ESLint: Ignore lerna.json and .git (#7708)
* Ignore lerna.json

* Oh, and ignore .git
2018-04-10 08:47:50 -04:00
Sven SAULEAU
9dc178df9a Merge pull request #7704 from babel/use-circle-yarn
Use yarn provided by circle
2018-04-10 07:38:41 +02:00
Brian Ng
75bc9422b8 Use yarn provided by circle 2018-04-09 22:11:17 -05:00
Axel Nyffenegger
bd98041321 Fix function name computation for literal values (#7435)
* Fix name computation for literal values

* Add more computed literal test cases

* Always return a string in getNameFromLiteralId

- Also concatenate quasis id for regex literal

* Add a test clarifying function name for template literals

* Remove useless else ifs
2018-04-09 21:00:55 -04:00
Devon Govett
6a8c4ab433 Make babel-types type checking functions 36% faster (#7685)
* Precompile 25% faster type checking functions

* Pre-fetch type-check function when generating NodePath methods

Additional ~11% speed improvement.

* Slightly faster assert calls
2018-04-09 15:11:04 -04:00
Justin Ridgewell
637bfe76b1 Cleanup object super traversal (#7681) 2018-04-06 20:39:57 +01:00
Justin Ridgewell
3f72f1d637 Add option to overwrite failing output fixtures (#7679) 2018-04-06 12:13:10 -05:00
Henry Zhu
20de23f895 update sponsors, move up [skip ci] (#7676) 2018-04-06 10:02:30 -05:00
Justin Ridgewell
d17adf40df Use construct helper in New Spread (#7677)
* Use construct helper in New Spread

* CircleCI
2018-04-06 10:40:38 +01:00
Justin Ridgewell
450a1678f2 Use getProto and setProto helpers (#7675)
Depends on #7674.
2018-04-06 02:54:08 +01:00
Justin Ridgewell
e9ed0f5f21 Split _wrapNativeSuper into helpers (#7674)
These can be reused in a few transforms.
2018-04-06 01:18:44 +01:00
Justin Ridgewell
29d249e3b7 Cleanup isReferenced a bit (#7669)
* Cleanup isReferenced a bit

* Optimize isReferenced inside Functions

* Group return falses
2018-04-05 19:09:58 +01:00
Justin Ridgewell
6f9b0546ef Class Properties Tests (#7670)
* Round out class properties tests

* Rename in preperation for private tests

* Fix options
2018-04-05 17:49:34 +01:00
Nicolò Ribaudo
fa2c6c5164 Never extract class fields into an initializer function. (#7659)
It was needed to avoid collision of identifiers used in fields
initializers with variables declared in the constructor, but it
broke `this` handling.
This commit removes that behavior and instead renames the
colliding variables.
2018-04-05 16:20:47 +01:00
Justin Ridgewell
43040a4181 Private Properties phase 1 (#7666)
* Private Properties phase 1

Co-authored-by: CodingItWrong

* Private fields are optional

* Docs update
2018-04-05 11:17:34 +01:00
Justin Ridgewell
01f4c2368e OptionalMemberExpression properties are not referenced (#7668)
Fixes #7642.
2018-04-05 02:44:32 +01:00
hirochachacha
56cb4baf46 Add missing exponential operators to ast spec (#7663) [skip ci] 2018-04-04 14:27:19 -04:00
hirochachacha
b051243a63 Fix typo in ast spec (#7662) [skip ci] 2018-04-04 14:26:06 -04:00
Henry Zhu
e808b63c15 Bump to babel@7.0.0-beta.44 (#7656) 2018-04-02 19:47:25 -05:00
Henry Zhu
a6df92f245 v7.0.0-beta.44 2018-04-02 18:19:30 -04:00
Logan Smyth
f4b81ab101 Merge pull request #7655 from babel/babel-env-make
Remove setting BABEL_ENV to test by default in makefile
2018-04-02 13:57:47 -07:00
Brian Ng
360b632881 Remove setting BABEL_ENV to test by default in makefile 2018-04-02 15:18:50 -05:00
Henry Zhu
bdfeeb38c6 v7.0.0-beta.43 2018-04-02 12:47:55 -04:00
Henry Zhu
47ada5ab3a revert prev pr to temp fix osx (#7652) 2018-04-02 12:40:03 -04:00
John-David Dalton
59ba3959dc Add options.allowAwaitOutsideFunction. (#7637) 2018-03-29 10:41:14 -04:00
unconfident
0200e6256a Allow StringLiteral to be used as ObjectTypeProperty.key (#7639) 2018-03-28 09:20:46 -05:00
Henry Zhu
9a26c2b07a Merge pull request #7471 from yakotika/master
added support Node's --require and -r flags in babel-node
2018-03-27 14:44:35 -04:00
Henry Zhu
901571d72f Merge pull request #7579 from devenbansod/migrate-to-jest-expect-2
Migrate a few packages' tests to use Jest Expect (see below)
2018-03-27 14:43:44 -04:00
Deven Bansod
b09c729675 Use expect's instanceOf and toHaveProperty methods 2018-03-27 22:34:25 +05:30
Sven SAULEAU
a36525be45 Merge pull request #7615 from babel/fix-clean-makefile
clean makefile a bit
2018-03-27 08:36:16 +02:00
Logan Smyth
a10c91790f Merge pull request #7588 from loganfsmyth/register-cycle-fixes
Have @babel/core lazy-load all dependencies and make @babel/register not explode because of that
2018-03-25 15:24:00 -07:00
Justin Ridgewell
ab7d1231ad Fix flow errors with Logical Assignment Operators (#7629)
* Fix flow errors with logical assignment

* Fix column numbers
2018-03-25 22:47:48 +01:00
Logan Smyth
a5df709bc3 Lazy-load @babel/core's dependencies to decrease up-front load times. 2018-03-25 14:22:32 -07:00
Logan Smyth
1dbed5f458 Have @babel/register explicitly skip re-entrant plugins/presets. 2018-03-25 14:22:32 -07:00
Logan Smyth
40e38646e4 Include stdout in error messages to aid debugging. 2018-03-25 12:50:35 -07:00
Logan Smyth
9e4dd861ee Ensure that sourceMapSupport is installed in all branches. 2018-03-25 12:50:35 -07:00
Justin Ridgewell
a7bddc02ba Add ??= to Logical Assignment Operators (#7623)
`??=` is being merged into the Logical Assignment Operator proposal, and the overall proposal will wait until nullish coalescing is finalized.
2018-03-25 18:58:51 +01:00
Justin Ridgewell
023f8bd1cb Move Logical Assignment Ops to Stage 1 (#7625) 2018-03-25 17:49:21 +01:00
Deven Bansod
c9b99af5a6 Remove assert.* from commented out assertions 2018-03-24 16:22:20 +05:30
Deven Bansod
c8d82d6483 Migrate all remaining fixtures to jest expect 2018-03-24 16:22:20 +05:30
Deven Bansod
db42a5d70f Migrate babel-preset-es2015 and -next-target tests to use jest expect 2018-03-24 16:22:19 +05:30
Deven Bansod
0856f89882 Migrate -transform-block-scoping and -transform-classes to jest expect 2018-03-24 16:22:18 +05:30
Deven Bansod
921702ef8c Migrate babel-plugin-proposal-do-expressions tests to jest-expect 2018-03-24 16:22:18 +05:30
Deven Bansod
8b57a3e3b9 Migrate a few packages' tests to use Jest Expect (see below)
* Migrate the following packages' tests:
    * babel-helper-annotate-as-pure
    * babel-helper-module-imports
    * babel-helper-transform-fixture-test-runner
    * babel-highlight
    * babel-node
    * babel-plugin-transform-modules-commonjs
    * babel-preset-env-standalone
    * babel-preset-env
    * babel-preset-es2015
    * babel-preset-react
    * babel-standalone
    * babel-template
    * babel-traverse
    * babel-types
2018-03-24 16:22:10 +05:30
Logan Smyth
21309cc8d4 Make these tests re-throw the same error to keep the trace. 2018-03-23 21:26:50 -07:00
Andy
19708e0154 TypeScript: support mapped type modifiers syntax (#7383) 2018-03-23 14:34:15 -04:00
Mateusz Burzyński
f98dff9189 Allow placeholders in JSXElements when parsing templates (#7583) 2018-03-23 09:27:51 +01:00
Brian Ng
840ba187a7 Prevent duplicate regex flags (#7617) 2018-03-22 10:25:26 -05:00
Sven SAULEAU
de00d939f0 fix: clean makefile 2018-03-22 10:29:25 +01:00
Brian Ng
e80488f1d5 Update to beta.42 (#7609) 2018-03-21 10:39:46 -05:00
Michał Pierzchała
81c1b49f6a Disable flow on transformClass, fix preset-env errors (#7605) 2018-03-20 18:42:11 -05:00
Justin Ridgewell
55bf55398a Logical Assignment: ensure computed key isn't recomputed (#7604)
* Logical Assignment: ensure computed key isn't recomputed

* More tests
2018-03-20 23:06:09 +00:00
Daniel Tschinder
f0d681a238 Remove obsolete max-len eslint rule and reformat some stuff to fit (#7602) 2018-03-20 08:51:47 -05:00
Logan Smyth
6d6fe844fd Centralize Babel's own compilation config to make it easier to follow. (#7599) 2018-03-19 21:49:17 -07:00
Logan Smyth
edb0a70e14 Run prettier to format all JSON. 2018-03-19 18:26:55 -07:00
Brian Ng
669f6b97b2 Tweak es2015-related plugin order in preset-env (#7586) 2018-03-19 14:19:42 -05:00
Michał Pierzchała
e2c5f25e97 Refactored quirky inheritance in babel-plugin-transform-classes (#7444)
* chore(plugin-transform-classes): refactor inheritance

* path some flow types

* remove unused export

* get rid of class

* temporarily rename to vanilla for diff readability

* more setState with minor adjustments

* rename 'private' methods

* explicit null check

* adjust import ordering

* Rename createConstructor -> maybeCreateConstructor

* Rename vanilla.js -> transformClass.js
2018-03-19 16:37:59 +01:00
Amin Marashi
8eee435cd6 Add RegExp support to include/exclude preset-env options (#7242)
* Add support for RegExp includes/excludes

* Keep the plugin order

* Detect invalid modules in regexp

* Add more tests for regexp

* Cover builtins, and unnormalized in the RegExp tests

* Remove babel-plugin- in all positions

* Change babel-plugin- prefix to string

* Add a test for the same module in include/exclude

* Handle partial matches explicitly

* Remove extra valid regexp check

* Optimise validation of plugins

* Optimise selecting the plugins

* Fix undefined include/exclude option

* Update documentation to reflect the new include matching

* Fix typo

* Apply reviews

Use regexp.test instead of string.match (slower)

Define flatten helper

Do not normalize babel-plugin anywhere in the string
2018-03-18 15:54:43 +01:00
Henry Zhu
d260bfaec4 v7.0.0-beta.42 2018-03-15 16:50:03 -04:00
Logan Smyth
c662c2ada2 Use strict namespace behavior for mjs files. (#7545) 2018-03-15 13:27:01 -07:00
Ben Wiley
b6e54800b4 Remove outdated spec deviation note [skip ci] (#7571)
`JSXText` was added to the JSX spec [here](https://github.com/facebook/jsx/pull/80).
2018-03-15 16:20:14 -04:00
Henry Zhu
ae210a46d1 Merge pull request #7562 from babel/pr/7534
Use helper-module-import inside preset-env
2018-03-15 16:19:03 -04:00
Logan Smyth
017d0e7078 Ensure that the backward-compat logic for plugin-utils copies over the version API properly. (#7580) 2018-03-15 11:45:53 -07:00
Josh Justice
b8d1d221f8 Rename actual/expected test files to input/output (#7578)
These files appear to have been missed in the update of test file naming from actual/expected.js to input/output.js. As a result, they were silently not being run. I've confirmed that they were not running, updated the names, then confirmed that they are running now.
2018-03-15 19:02:41 +01:00
Brian Ng
fed530f6bf Use helper-module-import inside entry plugin too 2018-03-15 09:21:20 -05:00
Gaël Gillard
29d44193cd Use helper-module-imports instead of custom import (#7457) 2018-03-15 09:21:19 -05:00
Melvin Groenhoff
82994ce087 Fix "Module build failed: Error: Cannot find module '@babel/types'" (#7575)
* @babel/template and @babel/types are dependencies instead of devDependencies (fixes #7573).

* Use @babel/types and @babel/template via @babel/core
2018-03-15 14:45:26 +01:00
Mateusz Burzyński
586d3b5929 Wrap wrapNativeSuper helpers in redefining functions for better tree-shakeability (#7188) 2018-03-14 23:48:33 +01:00
Mateusz Burzyński
d682e32529 Favour extends helper over objectWithoutProperties when whole object gets copied anyway (#7390) 2018-03-14 22:59:02 +01:00
Simon Kjellberg
07ab02f6b2 Fix incorrect value of _cache in _wrapNativeSuper (#7570)
The boolean expressions returns false in environments where Map is missing.
This change explicitly sets _cache to undefined in such cases, to ensure the cache methods will be ignored.
2018-03-14 16:37:51 -04:00
Nicolò Ribaudo
91a114f74a [transform-classes] Fix typo in _wrapNativeSuper helper 2018-03-14 19:23:10 +01:00
Nicolò Ribaudo
6d9887fc0f [typeof-symbol] Guard against undefined built-in globals 2018-03-14 19:23:10 +01:00
Henry Zhu
d2a3a8151e update to beta.41 (#7568) 2018-03-14 12:40:59 -05:00
Henry Zhu
270ea17fed v7.0.0-beta.41 2018-03-14 12:25:26 -04:00
Daniel Tschinder
da2aea31f5 Fix —require 2018-03-14 13:26:07 +01:00
Daniel Tschinder
1d69cd41ca Fix import of type ConfigItem (#7561)
It is also exported as type
2018-03-13 13:31:32 -05:00
Daniel Tschinder
a7ec312cfe Run node 9 on circleci and remove from travis (#7560) 2018-03-13 09:53:37 -04:00
Sven SAULEAU
6ff91cfdae docs: [skip ci] fix proposal link text 2018-03-13 13:21:34 +01:00
Yael Hermon
dfb3795a97 update preset-env after build-data (#7543) 2018-03-12 20:49:52 -05:00
Logan Smyth
353d3199c2 Re-add TEST_ONLY and use Jest's -t for TEST_GREP. (#7556) 2018-03-12 15:12:39 -07:00
Haroen Viaene
bdd70c37e0 docs(babel-standalone): remove bower mention (#6588)
* docs(babel-standalone): remove bower mention

Since the package won't be downloadable as `@babel/standalone` it's best to just remove it, since it's pretty much deprecated as is. I left the other mention of babel-standalone-bower since I guess that's just the name and still useful in other cases

cc @daniel15 

reported in https://github.com/babel/babel/pull/6495#pullrequestreview-70980926

* Update README.md
2018-03-12 19:10:24 +01:00
Daniel Tschinder
9d2d499760 Replace lodash/map with array equivalent (#7550)
* Replace lodash/map with array equivalent

* Fix review comments
2018-03-12 11:03:03 +01:00
Yael Hermon
29807837bb preset-env - add Symbol.asyncIterator to shippedProposals builtIns (#7548)
* preset-env - add Symbol.asyncIterator to shippedProposals builtins

* fix typo
2018-03-11 16:29:22 -05:00
ngohoangthang
c14a6a7735 Fix "ran" to "run" for monorepo.md (#7547) [skip ci] 2018-03-11 13:12:34 +01:00
Daniel Tschinder
3a7881379a jest: ToEqual -> toBe 2018-03-10 11:48:09 +01:00
Deven Bansod
f3f0197890 Migrate babel-core tests to use jest-expect (#7513)
* Used codemods at: https://gist.github.com/devenbansod/03c5cff857661e076cbec72fcb2e7eb3 along with some manual intervention and review
2018-03-10 11:40:28 +01:00
Logan Smyth
8e030e28b3 Merge pull request #7538 from loganfsmyth/unambiguous-import-meta
Make 'sourceType:unambiguous' use 'module' when import.meta is used.
2018-03-09 15:00:13 -08:00
Logan Smyth
3c8e9acd4a Make the unambiguous grammar select module when import.meta is used. 2018-03-09 14:44:06 -08:00
Logan Smyth
958551fd89 Refactor unambiguous to track state during parsing. 2018-03-09 14:35:55 -08:00
Logan Smyth
b5e6536f26 Remove the sourceMapTarget option from core and implement it in babel-cli. (#7500) 2018-03-09 14:14:25 -08:00
Will Monk
0389035e15 Add exact Param To ObjectTypeAnnotations (#7535) 2018-03-09 19:22:01 +01:00
Brian Ng
4f4dd3d4a6 Assign another temp var when parsing assignment patterns in destructuring (#7333) 2018-03-09 09:39:25 +01:00
Logan Smyth
4da3f3bc64 Update helpers from #7491. (#7532) 2018-03-08 17:06:43 -08:00
Logan Smyth
7901e7d1b9 Fix flowtype errors introduced in #7503. (#7531) 2018-03-08 16:02:28 -08:00
Logan Smyth
4b6c7ac0f6 Run build-no-bundle in the watcher to get right files. (#7530) 2018-03-08 13:48:32 -08:00
Daniel Tschinder
24a07fc790 Use jest workers on travis-ci and circleCI (#7510) 2018-03-08 22:15:54 +01:00
Logan Smyth
1c9b0ff49e Merge pull request #7491 from loganfsmyth/require-array-rest-spread-iterable
Explicitly throw if the array rest/spread items are not iterable.
2018-03-08 12:39:53 -08:00
Logan Smyth
828e9a8538 Skip minification of large bundles during CI builds. (#7528) 2018-03-08 12:36:47 -08:00
Brian Ng
f97d4313c9 Update test262 test script and a few keyword escape fixes (#7503)
* Update test262 and whitelist

* Use test262-stream

* Check escapes in contextual keywords

* Check escapes when parsing new.target

* Check escapes for getters/setters

* Check escapes for static class methods

* Check escapes on async arrow and functions
2018-03-08 09:10:00 -06:00
Brian Ng
2a0071028d Add Number.parseFloat/parseInt mappins for preset-env 'usage' (#7421) 2018-03-08 09:08:43 -06:00
Sven SAULEAU
2c0d492674 Merge pull request #7515 from abouthiroppy/feature/modify-readme-of-babel-plugin-transform-block-scoped-functions
Update README.md and add test
2018-03-08 12:06:58 +01:00
Logan Smyth
e42cbb40a4 Merge pull request #7472 from loganfsmyth/expose-partial-config
Expose the partial Babel config for callers to load and mutate.
2018-03-07 18:23:27 -08:00
Logan Smyth
74ab2798e2 Tweaks around PR comments. 2018-03-07 18:02:38 -08:00
Logan Smyth
fef5c7e523 Expose the partial Babel config for people to load and mutate. 2018-03-07 16:33:25 -08:00
Logan Smyth
53825f8152 Show a more useful diff when comparing fixture files. (#7520) 2018-03-07 12:27:10 -08:00
Rory O’Kane
40819f112c Fix link to proposal in do expressions plugin README (#7519)
The old link, http://wiki.ecmascript.org/doku.php?id=strawman:do_expressions, fails to load for me.

[skip ci]
2018-03-07 15:01:39 -05:00
Yuta Hiroto
2d36549541 Update README.md and add test 2018-03-07 23:49:56 +09:00
Brian Ng
7e423de911 Restore passing SIGINT signals to spawned child processes (#7511) 2018-03-07 14:10:11 +01:00
Abu Shamsutdinov
8317f8ab14 added support Node's --require and -r flags in babel-node 2018-03-07 12:38:57 +03:00
Daniel Tschinder
65dcc4eabe Fix makefile indentation 2018-03-06 11:57:26 +01:00
Daniel Tschinder
c8992e4155 Enforce Prettier defaults + also format .babelrc and .json (#7499)
* .prettierrc: full configuration for Prettier

This way, contributors using different-from-default settings will still
use the correct prettier settings

* Makefile: also lint .babelrc.js

* Makefile: also prettify .json files

* Exclude package.json files and correct build dir

* Add more default options to prettierrc and load it in cli

This avoids prettier looking up the config for each file

* Format json

* Update prettier and eslint and reformat codebase

* Remove obsolete file

* Add comment
2018-03-06 11:40:36 +01:00
Raja Sekar
50b9fbb570 empty src dir error fix - fixes #7375 2018-03-05 17:46:38 -08:00
Daniel Tschinder
5d615dd198 Disallow setters to have RestElement (#7498) 2018-03-05 18:03:59 -06:00
Daniel Tschinder
eb2a0b0fcd Raise minimum version for debug to only allow secure version. (#7495) 2018-03-05 20:12:56 +01:00
Logan Smyth
eaa31b6ec3 Explicitly throw if the rest/spread items are not iterable. 2018-03-05 09:32:40 -08:00
Logan Smyth
4d76d5dddc Refactor Babel's helpers into smaller functions. 2018-03-05 09:32:39 -08:00
Nicolò Ribaudo
a86d311986 Reuse the assertThisInitialized helper in possibleConstructorReturn (#7493) 2018-03-05 08:11:16 -08:00
Daniel Tschinder
a340a2614f Fix reseting modules in jest and config (#7494)
* Fix reseting modules in jest and config

we have lib folders inside the source folders which should not be ignored.

* Add codemods lib folder

* Support mjs

* improve ignore pattern
2018-03-05 16:04:29 +01:00
Daniel Tschinder
f9857ca6ba Docs: Use namespace packages in all links (#7496)
preset-env and babylon were still linking to spearate repos
2018-03-05 08:49:27 -06:00
Daniel Tschinder
f43bf7fcd5 Enable babel-register tests again (#7487) 2018-03-05 10:47:00 +01:00
Gvozd
653318b7e4 Always transform for-await in async functions. (#7446)
for-await was transformed in @babel/helper-remap-async-to-generator, which was
called by @babel/plugin-transform-async-to-generator and
@babel/plugin-proposal-async-generator-functions. This prevented for-await
statements in async functions to be transpiled if the
transform-async-to-generator plugin was't enabled.
2018-03-05 09:30:25 +01:00
K Sashi Kumar
d187c26748 Spec Violation: Fix var initializer in for-in loop (#7392) 2018-03-04 16:18:32 -08:00
Kevin Ji
fc64ab5725 eslint: Rename to .json, mark as root config - fixes #7433 2018-03-04 16:00:41 -08:00
Nicolò Ribaudo
5cd8b5b7f0 Add eslint plugin to disallow t.clone and t.cloneDeep (#7191)
* Add eslint plugin to disallow `t.clone` and `t.cloneDeep`

* Make it better and add flow

* Other cases

* Superpowers

* Fix
2018-03-04 15:47:11 -08:00
Nicolò Ribaudo
a328b6ad1a Arrow functions and methods' params are binding identifiers (#6770) 2018-03-04 15:19:48 -08:00
Logan Smyth
15a80f0df8 Merge pull request #7490 from loganfsmyth/sourcetype-helpful-errors
Give helpful errors if the wrong sourceType is detected
2018-03-04 15:03:49 -08:00
Logan Smyth
a4795408b4 Allow plugins to assert that a specific babel version has loaded the plugin. (#7450) 2018-03-04 14:36:54 -08:00
Logan Smyth
5f6e3122a0 Give users helpful feedback if they are detected as using the wrong sourceType. 2018-03-04 14:12:37 -08:00
Logan Smyth
7f8f4e86dc Merge pull request #7484 from loganfsmyth/test-input-mjs
Require tests to use input.mjs for modules, and output.js/.mjs based on active transforms
2018-03-04 14:06:07 -08:00
Logan Smyth
5c3092d86f Expand .raise() to allow more options. 2018-03-04 13:38:12 -08:00
Logan Smyth
7cc00cce0d Require output fixture extension to match sourceType output. 2018-03-04 13:31:33 -08:00
Logan Smyth
beb99dfda1 Rename test fixtures using module syntax to .mjs files. 2018-03-04 13:31:32 -08:00
Logan Smyth
5f9539e9cc Rework the testrunner to pass the input filename only. 2018-03-04 13:28:25 -08:00
Logan Smyth
aa669ef902 Fix an issue with new update-expression tests. 2018-03-04 13:25:31 -08:00
Marvin Hagemeister
c92e8be612 Generating correct assignments for live bindings updated with UpdateExpressions (#7489)
Fixes #7488
2018-03-04 20:46:33 +01:00
K Sashi Kumar
ab1e295c74 [Doc] Remove build-babylon from contributing (#7474) [skip ci] 2018-03-04 19:55:25 +01:00
K Sashi Kumar
ae0df86340 Remove broken check in checkFunctionNameAndParams (#7473) 2018-03-04 16:34:16 +01:00
Deven Bansod
41bf66bca2 Migrate babel-code-frame tests to use expect (#7485)
* Replace `assert.equal` calls with appropriate `expect` calls
* Work-in-progress: Currently targeting only `babel-code-frame` tests
2018-03-04 11:39:12 +01:00
Logan Smyth
212058148c Require users to pass a filename, or specify --no-babelrc when using CLI with stdin. (#7461) 2018-03-03 12:29:11 -08:00
Daniel Tschinder
785131d8e6 Also run coverage with node: current (#7479) 2018-03-03 18:45:34 +01:00
Mauro Bringolf
81532103da Contributing docs: Add caveat about direct subdirectories and exec tests (#7482) [skip Ci]
* Add caveat about direct subdirectories and exec tests

* Fix _only_ typo
2018-03-03 18:01:29 +01:00
Michał Pierzchała
cc6e739f15 Add a brief summary to CLI's build output (#7439)
* feat(babel-cli): add a brief summary to build output

* address feedback

* further adjustments

* Use quiet output as default, add --verbose

* fix tests

* remove verbose alias
2018-03-03 13:29:26 +01:00
Daniel Tschinder
3e95830646 Migrate to jest (#7455) 2018-03-03 10:58:19 +01:00
Orta
53208d6998 Another iteration on the TS plugin readme (#7469) 2018-03-02 22:39:18 -06:00
Orta
fdfbd9a6f7 Update README for Babel TypeScript Plugin (#7443) 2018-03-01 08:46:54 -06:00
Daniel Tschinder
007f8d19b3 Remove unused dependencies (#7454)
Replace util.promisify with node internal version
2018-02-28 10:59:28 -05:00
Daniel Tschinder
586ba35950 Update to circleci v2 (#7451) 2018-02-28 10:58:47 -05:00
Daniel Tschinder
1a454f666c Install peerDependencies and remove unused async dependency (#7453) 2018-02-28 10:58:33 -05:00
Logan Smyth
a07f96ce3f Merge pull request #7449 from loganfsmyth/env-enhancement
Centralize the plugin/preset and config APIs into one place
2018-02-28 01:03:35 -08:00
Logan Smyth
2c3eb3096f Expand the '.env()' API call with more flexibility. 2018-02-27 18:48:24 -08:00
Logan Smyth
148e6dfc26 Centralize the plugin/configuration API object. 2018-02-27 18:48:24 -08:00
Logan Smyth
ddd40bf5c7 Rely entirely on sourceType for module vs script differentiation. (#7417) 2018-02-27 18:11:13 -08:00
Logan Smyth
bf8b25289b Merge pull request #7436 from loganfsmyth/less-upfront-work
Default to `ast:false` and do less work when loading core
2018-02-27 18:03:53 -08:00
Logan Smyth
b19b7fd2cf Fix PR comments. 2018-02-27 17:46:17 -08:00
Guy Bedford
f004972625 Ensure babel-preset-env targets input object is not mutated (#7438) 2018-02-27 08:46:24 -06:00
Yuta Hiroto
5459c75d64 Fix CONTRIBUTING.md (#7441) 2018-02-27 08:45:28 -06:00
Logan Smyth
8e3e6e0a88 Require AST output to be opt-in, rather than opt-out. 2018-02-26 18:44:59 -08:00
Logan Smyth
d4a8c7672c Avoid using lodash during config loading, for require() performance. 2018-02-26 18:44:58 -08:00
Logan Smyth
600106b9cb Lazy-initialize external helper template. 2018-02-26 18:44:57 -08:00
Logan Smyth
dffcef785a Lazy-initialize helper templates. 2018-02-26 18:18:57 -08:00
Logan Smyth
cb4f4f4d5f Ensure that typechecking artifacts are built up front for watch. 2018-02-25 21:38:11 -08:00
Logan Smyth
7ff4a73916 Upgrade flow to 0.66 and fix a few minor errors. (#7431) 2018-02-25 19:22:23 -08:00
Brian Ng
8823e4247e Fix up flow errors (#7227)
* charcodes@0.1.0

* Add hasFlowComment to tokenizer/state

* Fix babel-types flow errors

* Add isIterator to tokenizer/state

* Remove unnecessary argument from flow/readToken

* Add annotation to tokenizer/isIterator

* Fix reference to generated index.js.flow

* Add workaround in babel-template expression formatter

* Fix tsEatThenParseType return type

* Fix inconsistency with ParseSubscript state

* Add workaround for flow handling error with tagged template in optional chain

* Add flow workaround in expectPlugin inside tokenizer
2018-02-25 18:12:33 -08:00
Andy
6f3be3a543 typescript: Support definite assignment assertion (#7159) 2018-02-24 16:26:07 -06:00
Andy
6f6c8dabba TypeScript: Support conditional types syntax (#7404)
Microsoft/TypeScript#21316 and Microsoft/TypeScript#21496
2018-02-24 14:56:14 +01:00
Alasdair McLeay
960fa66c9e Reinstate --inspect-brk, lost when making babel-node standalone (#7423) [skip ci] 2018-02-23 15:18:13 -05:00
Logan Smyth
df50cddd63 Replace instead of merging babel-register options, and resolve cwd up front (#7416)
Replace instead of merging babel-register options, and resolve cwd up front
2018-02-23 08:51:42 -08:00
Brian Ng
455c04e60a Bump compat-table and regen preset-env data (#7401) 2018-02-23 08:46:14 -06:00
Brian Ng
182fe7b04e Add missing promise polyfill deps for preset-env's useBuiltIns: usage (#7400) 2018-02-23 08:45:22 -06:00
Brian Ng
959865b48d Update babel to beta.40 (#7413) 2018-02-23 08:44:45 -06:00
Logan Smyth
62c1046249 Avoid re-traversing inserted references to the namespace binding. (#7418) 2018-02-22 23:54:29 -08:00
Henry Zhu
70627ac92c we can use emojis 😊[skip ci] 2018-02-22 22:01:02 -05:00
Logan Smyth
a99e9614a6 Resolve the babel-register working directory up front. 2018-02-22 18:48:36 -08:00
Logan Smyth
cfb830b5bd Overwrite instead of merging babel-register options. 2018-02-22 18:43:47 -08:00
Mike S
84de90e572 Better error message for invalid plugin/preset (#7238)
- Error for invalid plugin/preset now includes file path
2018-02-22 18:30:01 -08:00
Mateusz Burzyński
d283324f8a Mark hoisted react constant elements as #__PURE__ (#7372) 2018-02-21 18:58:56 +01:00
Brian Ng
d75a6b8468 Remove istanbul hacks (#7403) 2018-02-21 09:56:30 -06:00
Deepak Pai
dad05ed503 Solves Tagged template literal size optimization (#7379)
* Tagged template literal size optimization
solves #7352

* Incorporates review changes
2018-02-20 15:39:22 -05:00
Justin Ridgewell
7e90d56024 Proposal: Logical Assignment Operators (#7385)
* Proposal: Logical Assignment Operators

https://github.com/jridgewell/proposal-logical-assignment

I'm bringing it [back](https://github.com/babel/babel/pull/516). 😉

* Use expectPlugin

* Add to stage 0 preset

* Add logicalAssignment missing plugin log stuff
2018-02-18 13:56:29 -05:00
Nicolò Ribaudo
3d49766f6b Don't extract rest elements from nested expressions (#7364)
* Don't extract rest elements from nested expressions

* Node 4
2018-02-17 16:22:38 +01:00
Brian Ng
4d17a96d50 Minor object-rest-spread README tweaks [skip ci] 2018-02-16 20:56:21 -06:00
James Reggio
6cbc585cf4 Fix over-zealous traversal by object-rest-spread (#7388)
Prior to this change, we'd conduct an open-ended traversal on the 'id'
of any VariableDeclarator to find a RestElement. The 'id' of
a VariableDeclarator can contain an AssignmentPattern (to supply
a default value), and if the right-hand side of the AssignmentPattern
contained a RestElement, we'd transform it.

The problem here is that the right-hand side of an AssignmentPattern can
be *any* Expression. If the right-hand side is a function body, we'd
traverse the entire function body, and if a RestElement occurred
anywhere in that function body, we'd transform it and emit the
transformations wherever we began the traversal (at least one scope
outside its usage).

The fix is to stop the inner traversal if we encounter an
AssignmentPattern. The outer traversal will still visit the
AssignmentPattern, so RestElements within the right-hand side of an
AssignmentPattern will be properly transformed at that time.
2018-02-16 21:19:09 -05:00
Andrea Puddu
ee6dfd1580 Fix object spread according to spec (#7034) 2018-02-16 20:06:17 -05:00
Logan Smyth
e732ee0c5b Preserve import binding locations during module rewriting (#7378)
* Only wrap import references that need it.

* Preserve the import binding location for sourcemaps.

* Add tests.
2018-02-14 10:17:27 -08:00
Justin Falcone
128fc6864e Link generator readme to Babylon AST spec [skip ci] (#7380) 2018-02-14 11:40:39 -05:00
Raja Sekar
6aed8e944f updated node debugger usage command in test (#7376) [skip ci] 2018-02-13 11:17:19 -05:00
Mateusz Burzyński
4d164bd8e6 Added babel-helper-split-export-declaration (#7313) 2018-02-13 16:44:05 +01:00
Henry Zhu
ea3f2d9299 v7.0.0-beta.40 2018-02-12 11:41:13 -05:00
Vojtěch Štěpančík
88a0f52230 Fix CLI compilation callback calling (#7366) 2018-02-12 08:10:35 -05:00
Yeonghoon Park
4a2e1dbbc3 Fix stage-3 name in README.md (#7363)
[skip-ci] Fix a typo in preset-env doc: `@babel/preset-stage-3` package name.
2018-02-11 14:04:31 +02:00
Clar Roʒe
2979dd99ac Update browserslist for babel-preset-env. (#7365) 2018-02-11 09:57:50 +02:00
Suchipi Izumi
534ee4734c Extract @babel/highlight package from @babel/code-frame
This creates a new package called @babel/highlight which syntax highlights
JavaScript code for terminal output. This functionality was already
present in @babel/code-frame, but exposing it as a separate package lets
other projects leverage it. @babel/code-frame has been refactored
slightly so that it uses @babel/highlight to do its syntax highlighting.
2018-02-09 09:31:37 +01:00
Steven Hargrove
a01007a3d3 Allow falsey, yet valid options for codeFrameColumns() (#7341)
Allow for overriding default linesAbove/linesBelow values.
2018-02-08 16:52:12 -05:00
Logan Smyth
493996e02a Merge pull request #7345 from loganfsmyth/small-bug-fixes
Small tweaks to prep for coming .babelrc lookup work
2018-02-08 13:30:49 -08:00
Justin Ridgewell
c03a34e509 Typo in nullish-coalescing-operator README.md 2018-02-08 14:34:41 -05:00
Naveen jain
92580e750d Fixes issues regarding super in optionalChain (#7356) 2018-02-08 14:31:47 -05:00
Logan Smyth
213805f21e Avoid duplicating types in index-browser. 2018-02-08 09:19:16 -08:00
Logan Smyth
28d13cb09b Fix small bug in the new .parse function. 2018-02-08 00:22:50 -08:00
Logan Smyth
9a8ba76e1f Merge .babelrc and .babelignore searching into a single pass. 2018-02-08 00:22:49 -08:00
Logan Smyth
d88173b9f8 Ensure that tests don't leave mutated global state in the environment. 2018-02-08 00:22:49 -08:00
Logan Smyth
85174b6ce1 Remove unneeded param from buildRootConfig. 2018-02-07 23:23:19 -08:00
Logan Smyth
ec2e0b664a Properly allow undefined ignore patterns for test/include/exclude. 2018-02-07 23:23:19 -08:00
Naveen jain
a3ad518ce1 [BugFix] : OptionalChaining Bug fixes (#7288)
* Added optionalExpression types to babylon and babel-types

* OptionalChain transforms bug fix

* Added OptionalExpressions to babel-generator. Fixed OptionalChain Bugs

* Removed 'optionalChain' from newExpression and added test cases

* Added test cases for optionalChain

* Update index.js
2018-02-07 19:42:14 -05:00
Nicolò Ribaudo
dd0337cc85 Fix failing test (#7344) 2018-02-06 17:42:55 -06:00
Nicolò Ribaudo
4887d81929 Remove bindings of removed paths from scope 2018-02-06 23:59:12 +01:00
Ben Newman
22555cd15d Failing test involving object rest/spread and clearScope().
This failing test case demonstrates a regression between 7.0.0-beta.38 and
7.0.0-beta.39 in the @babel/plugin-proposal-object-rest-spread package.

I distilled this test case from a larger configuration of plugins in my
application, one of which calls api.traverse.cache.clearScope(). Although
calling clearScope() is an uncommon thing for a plugin to do, it was a
reliable way to reproduce the problem. If I can find other reliable
reproductions, I'll push some additional failing tests to this PR.
Regardless of how common it is, clearing the scope cache should be a safe
operation that only slows down the transform (because scopes have to be
recreated and re-crawled). Crashing due to a spurious duplicate
declaration seems like a bug worth fixing.

My hunch is that [these two lines](eb38ea2b10/packages/babel-plugin-proposal-object-rest-spread/src/index.js (L75-L76))
(which were changed in `7.0.0-beta.39`) are not actually removing the
original rest element as a binding from the enclosing `Scope`, in certain
circumstances, so the new variable declaration ends up colliding with the
old (removed) binding.

Possibly related: #7304 (reported by @julien-f)
2018-02-06 23:59:12 +01:00
Daniel Tschinder
593c1a0861 Add core-js as valid polyfill source (#7315) 2018-02-04 17:53:54 -06:00
Kai Cataldo
7234442fde Add location information to parsing errors (#7314) 2018-02-04 13:00:03 -06:00
Justin Ridgewell
5ea1bfe780 Do not optimize away async/gen arrow functions (#7319)
* Do not optimize away async/gen arrow functions

* Node version 8
2018-02-03 17:08:12 -05:00
Tauyekel Kunzhol
2254ed45d2 [Bug fix] Reaching maximum calls stack when copying large number of non-js files in babel-cli (#7320)
Maximum call stack occurs when you try to copy large number of non-js files using `babel-cli@7.0.0-beta.38` or `babel-cli@7.0.0-beta.39`
2018-02-02 20:56:57 -08:00
Logan Smyth
278cd5e572 Preserve identifier location information when mapping this and arguments. (#7312) 2018-02-01 18:54:15 -08:00
Mathias Bynens
96c0415c86 Remove outdated sentence from README (#7311)
Unicode property escapes are now part of ECMAScript proper.

[skip ci]
2018-02-01 14:27:13 -08:00
K Sashi Kumar
ed98d2491e [Typescript] - Fix SyntaxError in async arrow functions with rest params (#7297)
* Fix: [Typescript] - SyntaxError in async arrow functions with rest params

* Fix optional params and add test code in flow
2018-01-31 21:05:24 +01:00
Henry Zhu
eb38ea2b10 Update babel to beta.39 (#7302) 2018-01-30 22:59:00 -05:00
Nicolò Ribaudo
f19d559ff3 Compile Babylon with Gulp (#7240) 2018-01-30 23:13:40 +01:00
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
Henry Zhu
f76ac0b197 v7.0.0-beta.31 2017-11-03 16:03:01 -04:00
Henry Zhu
f5b6e69214 Change version to beta.30 since babylon was already at that version [skip ci] 2017-11-03 15:56:41 -04:00
Henry Zhu
efdc32fec5 Run with loose, exclude typeof in standalone (#6736) 2017-11-03 15:42:37 -04:00
Henry Zhu
1196ec1e38 add loose/useBuiltIns option to stage presets, use it, opt babylon build (#6733)
* add loose, useBuiltIns options to presets + use loose class properties

* whitelist helpers for babylon

* use transform-for-of-as-array in babylon
2017-11-03 14:22:06 -04:00
Artem Yavorsky
9cf017b2ca Fix global reference for use-built-ins plugin (#6478)
* Consider instance type for polyfills.

* Add test cases for evaluated objects.

* preset-env fixtures: babel-polyfill -> @babel/polyfill

* Split up fixtures with evaluated variables.
2017-11-03 11:22:11 -04:00
Clement Hoang
1a7194a22f Add JSX Fragment syntax support (#6552)
* Add JSX Fragments to babel-types

* Support JSX fragments in the transform-react-jsx plugin

* Add tests JSX fragments

* Update helper-builder and transform plugin documentations for jsx fragment

* Add generator for jsx fragments

* Add test for jsx fragment generator

* Split jsx transform example into normal and fragment examples

* Remove unnecessary fields from ElementState in babel-helper-builder-react-jsx

* inline [skip ci]
2017-11-03 10:43:48 -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
Logan Smyth
9e2828322e Merge pull request #6556 from loganfsmyth/early-validation
Strictly validate Babel's options to centralize Flow refinement of datatype
2017-11-02 16:24:36 -07:00
Sven SAULEAU
8b206b2c3b feat: generate charCodes
Vim 🖤
2017-11-02 20:13:44 +01:00
MICHAEL JACKSON
ce53c7668a Fix unpkg link (#6730) [skip ci] 2017-11-02 13:36:05 -04: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
Raja Sekar
2d0211a085 Fix parsing arrow with existential return type (#6726) 2017-11-02 10:56:27 -05: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
Daniel Tschinder
3b540e3f5a Integrate babylon into babel workflow 2017-11-01 23:26:51 +01:00
Daniel Tschinder
52537410ef Merge histories of babylon and babel 2017-11-01 16:17:41 +01:00
Daniel Tschinder
2d378d076e Move babylon into monorepo 2017-11-01 16:16:48 +01:00
Daniel Tschinder
1b612148bf "yield" parsing inside function name and parameters (#689)
* Use parseFunctionParams to parse method parameters

* [funct] Set this.state.inGenerator before parsing the function name/params

This allows "yield" inside generator parameters to be actually
parsed as a yield expression

* [funct] Disallow yield in function parameters

* [arrow] "yield" can start an arrow function (e.g. "yield => {}")

* [arrow] Disallow YieldExpressions inside arrow parameters.

* [err msg] Disallow yield as fn name in strict mode using checkReservedWord.

So Babylon throws "yield is a reserved word" instead of
a custom "Binding yield in strict mode"

* [err msg] "X is reserved in strict mode" should have precedence over "X is reserved", since it is more specific.

This was observable if "checkKeywords" is true and the word is both a keyword and a reserved
word in strict mode

* Disallow "yield" as an identifier inside generators

* [tests] Add tests, update wrong esprima tests and enable disabled esprima tests

* [tests] Move uncategorized tests to es2015/yield

* [tests] Update test262 whitelist

* Fix regression introduced by 8c77073

* [tests] Update flow whitelist

* Fix flow errors
2017-11-01 16:05:18 +01:00
Logan Smyth
0b3182911a Avoid node duplication to fix spread bug with import. (#6657) 2017-10-31 20:37:16 -07:00
Henry Zhu
dbff057b8c update lockfile [skip ci] 2017-10-31 21:26:54 -04:00
Logan Smyth
d31c2c1470 Merge pull request #6655 from loganfsmyth/more-peerdeps
Use peerDeps in register and babel-node, add missing peerDependencies, and declare devDependencies
2017-10-31 18:10:55 -07:00
Logan Smyth
2d7685bdeb Explicitly declare devDependency to satisfy peerDep on babel-core. 2017-10-31 17:00:55 -07:00
Logan Smyth
ffad34e1a6 Remove unused @babel/types dependency. 2017-10-31 17:00:45 -07:00
Logan Smyth
8c95145c14 Use peerDependency for @babel register/node/cli. 2017-10-31 17:00:41 -07:00
Logan Smyth
948f741067 Add missing peerDependencies. 2017-10-31 16:57:56 -07:00
Henry Zhu
0e2a249746 Update to beta.5 with scoped packages 👻 (#6654)
* Update to beta.5 with scoped packages

* update to released version

* allow node 9 [skip ci]
2017-10-31 19:55:54 -04:00
Brian Ng
29a4aea27b Update parsing flow type/typeof imports (#773)
* Remove extranneous backticks from type/typeof error message

* Add isLookaheadContextual util

* Update parsing flow type/typeof imports
2017-10-31 17:09:39 +01:00
Nicolò Ribaudo
cd050e1405 Parse parameters inside function's env (#652)
* Parse parameters inside function context

* Add test for new.target inside parameters
2017-10-31 16:31:35 +01:00
M Behzad
fee7de2c1d white lists getter and setter acceseors for having stage-2 decorators (#766)
- adds `get` and `set` kind in addition to `method` to the list of allowed class members for having a decorator,
- adds tests for this two cases (decorator + set and decorator + get)
2017-10-31 16:13:04 +01:00
Henry Zhu
690d6465d8 v7.0.0-beta.5 2017-10-30 16:55:46 -04:00
Henry Zhu
bede73122d fixup places that aren not scoped [skip ci] (#6646) 2017-10-30 16:47:13 -04:00
Mateusz Burzyński
a1c7449a92 Fixed incorrect static class field initialization order (#6530) 2017-10-30 16:32:45 -04:00
Henry Zhu
624f00f23c Fix peerDep to ^ for beta only (#6644) 2017-10-30 16:24:42 -04:00
Henry Zhu
38f984f956 v7.0.0-beta.4 2017-10-30 14:33:56 -04:00
Henry Zhu
acfe99a4bc remove deprecated lerna command [skip ci] 2017-10-30 14:27:41 -04:00
Henry Zhu
96c380899b update types [skip ci] 2017-10-30 12:35:08 -04:00
Henry Zhu
397953c32d update lock [skip ci] 2017-10-30 12:21:20 -04:00
Benedikt Meurer
00342452e2 Fix OOB string character access in Printer#_maybeAddParen. (#6589)
* Fix OOB string character access in Printer#_maybeAddParen.

The `_maybeAddParen` method of the `Printer` class does

```js
const chaPost = str[i + 1]
```

without checking that `i + 1` is still within the bounds of `str`. It
seems like this triggers fairly often that the `str[i + 1]` access is
out of bounds. The first out of bounds access will turn the KeyedLoadIC
(in case of V8) into *MEGAMORPHIC* state, which is significantly slower
for strings (there's a fix in flight for V8 to mitigate the cost a bit
in that case). Even worse than that, the out of bounds access also
pollutes the later comparisons, namely

```js
chaPost === "/"
```

and

```js
chaPost === "*"
```

which are now no longer monomorphic on strings, since `chaPost` was
sometimes `undefined`.

This is a non-breaking performance fix, which improves babel execution
on the [web-tooling-benchmark](github.com/v8/web-tooling-benchmark)
workload by around 6-9%.

* Restructure and optimize the code a bit.
2017-10-30 09:16:44 -04:00
Daniel Tschinder
86abc16b37 Fix decorators2 to support export @decorator class A {} (#767)
* Fix decorators2 to support `export @decorator class A {}`

* change to better error message

Also ensure that null/undefined options get default value
2017-10-29 12:20:15 +01:00
Jakub Beneš
04d2c030be Add a 'throwIfNamespace' option for JSX transform (#6563)
* Added tests for ifThrowNamespace flag

* JSX transformator could work with XMLNamespaces (ifThrowNamespace flag)

* Use template literal instead

* Attempt to reword the message

* Added docs

* Reworded docs

* Reworded docs

* Fixed missing space in error message
2017-10-28 20:44:15 -04:00
Henry Zhu
9ac326b075 remove es20xx prefixes from plugins and rename folders (#6575) 2017-10-28 20:43:15 -04:00
Henry Zhu
92a3caeb9c remove warning (still applies but don't need it there) [skip ci] (#6579) 2017-10-28 20:17:16 -04:00
Benedikt Meurer
ffe4301fe2 Fix property lookup on booleans in needsWhitespace. (#6584)
The code

```js
linesInfo && linesInfo[type]
```

performs a lot of dynamic lookups on the `Boolean.prototype`, as the
*ToBoolean* operation let's `true` pass for `linesInfo` (which might
itself be concerning that this can be a boolean). Instead of the
coercion, the code should properly check for valid objects via `typeof`
and strict equality with `null` comparison.

This is a non-breaking performance fix.
2017-10-28 20:16:48 -04:00
Benedikt Meurer
5baa36109e Fix access to "-1" property on nodesOut array. (#6582)
Similar to the fixes in https://github.com/babel/babel/pull/6580 and
https://github.com/babel/babel/pull/6581, accesses of the form

```js
nodesOut[nodesOut.length - 1]
```

where `nodesOut` can be an empty array, are bad for performance in Node.
In this particular case it's easy to restructure the code a bit to not
require the array access at all, but just track the current `tail` as we
go.

This is a non-breaking performance fix.
2017-10-28 20:16:04 -04:00
Henry Zhu
962128c0f0 Update to babylon v7 beta.30 (#6587) 2017-10-28 20:01:52 -04:00
Henry Zhu
8f8ea04b62 7.0.0-beta.30 2017-10-28 19:40:53 -04:00
Henry Zhu
c6d369b32b fix flow unused supressing comment [skip ci] 2017-10-28 19:40:31 -04:00
Benedikt Meurer
f9e0643460 Fix path.popContext() to not try to load "-1" from contexts array. (#6580)
* Fix path.popContext() to not try to load "-1" from contexts array.

The current implement of popContext does

```js
this.setContext(this.contexts[this.contexts.length - 1]);
```

even if `this.contexts` can be empty, which causes it to lookup the
property `"-1"`, which is not found on the array itself and obviously
also not in the `Object.prototype` and the `Array.prototype`. However
since `"-1"` is not a valid array index, but has a valid integer
representation, this is a very expensive lookup in V8 (and probably
other engines too, but that is probably less relevant, since Babel
most often runs on Node nowadays).

* Make zero check explicit (for readability).
2017-10-28 16:17:05 -04:00
Benedikt Meurer
df0d9d05a3 Fix hasRest to not try to load "-1" from params array. (#6581)
Similar in spirit to https://github.com/babel/babel/pull/6580, the
current implementation did

```js
node.params[node.params.length - 1]
```

where `node.params` can also be empty, which causes it to lookup the
property `"-1"`, which is not found on the array itself and obviously
also not in the `Object.prototype` and the `Array.prototype`. However
since `"-1"` is not a valid array index, but has a valid integer
representation, this is a very expensive lookup in V8 (and probably
other engines too, but that is probably less relevant, since Babel
most often runs on Node nowadays). In V8 this causes a call to
the `%SetProperty` runtime function for each of these `"-1"`
property lookups, and in addition sends the whole `KeyedLoadIC`
to `MEGAMORPHIC` state, which also penalizes other accesses
on this line.

This is a small non-breaking performance fix.
2017-10-28 16:16:05 -04:00
Clement Hoang
a1125b26ce Add JSX fragment syntax support (#755) 2017-10-28 16:12:14 -04:00
Benedikt Meurer
55d5545614 Fix "-1" array accesses in CommentsParser. (#777)
Similar to the fixes in https://github.com/babel/babel/pull/6580 and
https://github.com/babel/babel/pull/6581, accesses of the form

```js
stack[stack.length - 1];
```

when `stack` can be an empty array are pretty bad for performance.
In this case it also breaks the type safety, since the function
`last<T>` is declared to only return values of type `T`, but
occasionally also returns `undefined` now, since the `stack` parameters
passed to it never contain a property `"-1"` and neither do the
`Object.prototype` or the `Array.prototype`.

This is a non-breaking performance fix, which adds proper checking
to ensure that `last` is only invoked on non-empty arrays.
2017-10-28 16:07:28 -04:00
Henry Zhu
5b47e4a6cb Merge transform-async-to-module-method into transform-async-to-generator (#6573) 2017-10-27 17:14:40 -04:00
Henry Zhu
f5ec9251c9 updated readme organization [skip ci] 2017-10-27 17:12:45 -04:00
Henry Zhu
c41abd79a1 Rename all proposal plugins to -proposal- from -transform- (#6570) 2017-10-27 15:26:38 -04:00
Logan Smyth
e4bcd1d0ff Allow Flowtype's imports and exports when sourceType:script is set. (#771) 2017-10-27 11:55:24 -07:00
Brian Ng
a94aa54230 Re-add electron-to-chromium as preset-env devdep (#6551) 2017-10-27 11:51:46 -04:00
Henry Zhu
476ec5ed8f Fix readmes to use @babel/ [skip ci] (#6569) 2017-10-27 11:50:59 -04:00
Henry Zhu
e5e7f5bf79 Lerna: Add publishConfig access public [skip ci] (#6557) 2017-10-26 19:22:13 -04:00
Logan Smyth
1d6cbd8dce Standardize descriptor creation. 2017-10-25 15:55:58 -07:00
Logan Smyth
fed2a14da1 Fail if there are cycles in config files. 2017-10-25 15:55:58 -07:00
Logan Smyth
0f31ce5686 Disallow 'null' as a general blank option placeholder. 2017-10-25 15:55:58 -07:00
Logan Smyth
64abf75d1f Perform option validation up front to avoid repeating assertions. 2017-10-25 15:55:58 -07:00
Logan Smyth
3673fbbd52 Refactor config item processing. 2017-10-25 15:55:58 -07:00
Logan Smyth
14901aa74f Remove the .loc from config items. 2017-10-25 15:55:57 -07:00
Logan Smyth
a25942bda9 Remove unused suppressDeprecationMessages option. 2017-10-25 15:55:57 -07:00
Logan Smyth
107648cd0b Remove unused 'mode' option. 2017-10-25 15:55:57 -07:00
Logan Smyth
0a2a0bb254 Remove the relative babel-core option. 2017-10-25 15:55:57 -07:00
Henry Zhu
0a823fbe8d add another team link [skip ci] 2017-10-25 17:51:47 -04:00
Henry Zhu
e3cebbf6bc Add peerDep on specific babel-core version in transform plugins, presets, and cli (#6549) 2017-10-25 08:36:00 -07:00
Simon Lydell
d2b3138bdd Make syntax highlighting for @ and # nicer (#6550) 2017-10-25 03:10:32 -04:00
Brian Ng
cb6082e98f Update flow tests whitelist (#770) 2017-10-24 15:58:27 -05:00
Sylvain Delabye
eb19ea18cc Remove stale emoji tests in plugin-transform-unicode-property-regex (#6548) 2017-10-24 13:17:05 -05:00
Raja Sekar
7f5a216e2d Changed Team link to babel website 2017-10-24 08:56:16 -05:00
Logan Smyth
11d8e0555f Avoid mutating the passed-in options for babel-register (#6542) 2017-10-23 15:49:10 -07:00
Ruslan Gunawardana
70818c3db8 UepdateEADME: useBuiltins: true is changed to "entry" [skip ci] (#6527)
babel-preset-env@next founds "useBuiltins": true is illegal. README is updated accordingly.
2017-10-23 17:08:00 -05:00
Sven SAULEAU
101529ffe0 Merge pull request #6529 from Borales/core-transformation-file-has
Providing File.has method for core/transformation package
2017-10-23 15:37:00 +02:00
Adam
3214c5004e docs - Add helper-get-function-arity readme [skip ci] (#6532)
* Add README to babel-helper-get-function-arity

* Use javascript template

* Address code review

* Comment out ellipsis
2017-10-23 10:30:36 +02:00
Sven SAULEAU
7185bd25e8 Merge pull request #6533 from athomann/add-helper-bindify-decorators-docs
Add API to helper-bindify-decorators README [skip ci]
2017-10-23 10:28:52 +02:00
Sven SAULEAU
546a844e32 Merge pull request #6534 from athomann/add-helper-hoist-variables-api
Add API to babel-helper-hoist-vars README [skip ci]
2017-10-23 10:23:32 +02:00
Adam Thomann
aeedabfa4f Add installation 2017-10-22 21:42:27 -04:00
Adam Thomann
9cebe88a9c Add API to babel-helper-hoist-vars README 2017-10-22 21:31:07 -04:00
Adam Thomann
a94b0d2e54 Add API to helper-bindify-decorators 2017-10-22 21:14:48 -04:00
Lucas Azzola
cd4f0ae393 Add loose mode for nullish coalescing operator (#6531)
* Add loose mode for nullish-coalescing

* Remove unneeded SequenceExpression
2017-10-22 13:25:29 +02:00
Borales
416e9aba39 Providing File.has method for core/transformation package 2017-10-22 00:45:40 +02:00
Lucas Azzola
9e0f5235b1 Optional Chaining: Account for document.all (#6525) 2017-10-21 15:55:39 -04:00
Mateusz Burzyński
4684edaec7 Adhering to async generator yield behavior change (#6452) 2017-10-21 21:48:27 +02:00
Alex Jover
39d05da3ed fix(babel-core): add missing extension to package.json dependency (#6524) 2017-10-21 11:46:10 +02:00
Mateusz Burzyński
54aa4cb3f9 Fixed async generator named declarations with inline helpers 2017-10-20 14:23:27 +02:00
Logan Smyth
765e920e48 Fix regression that leaks JSX pragma config between files. (#6519) 2017-10-19 16:09:56 -07:00
Mateusz Burzyński
fc75198fb4 Cloning reused node in class properties transform (#6517) 2017-10-19 18:12:57 -04:00
Justin Ridgewell
8d4674ca5a Fix destructuring in pipeline operator (#6515)
* Fix destructuring in pipeline operator

Fixes #6514.

* Run exec only on node 6
2017-10-19 15:59:36 -04:00
Brian Ng
923fd4705e Remove syntax-trailing-function-commas from Babel presets (#6513) 2017-10-19 15:50:48 -04:00
Jen Luker
c2c72c4224 Update reference from babel- to @babel/ in README.md (#6508) 2017-10-19 11:23:58 -05:00
Jen Luker
b6ae9e2db2 Updating references to @babel/ and adding dependencies to package.json (#6509)
* Updating references to @babel/ and adding dependencies to package.json all in babel-runtime.

* Removing extra ../../ from the require calls.
2017-10-19 08:23:27 -04:00
Will
752a16d44c Remove babel-plugin-transform-async-functions (#6510) [skip ci]
This is leftover from #6495

Closes #6504

Signed-off-by: Will Soto <will.soto9@gmail.com>
2017-10-19 08:05:52 -04:00
Logan Smyth
c87cc18586 Merge pull request #6379 from nicolo-ribaudo/helper-runtime-dependencies
Fix helper dependencies in babel runtime
2017-10-18 18:11:44 -07:00
Nicolò Ribaudo
a740b28a9e Commit the temporalRef runtime helper 2017-10-19 00:37:09 +02:00
Nicolò Ribaudo
d2af56bcae Fix helpers dependencies loading 2017-10-19 00:37:09 +02:00
Nicolò Ribaudo
e0a6e1e864 Import temporalUndefined inside temporalRef helper 2017-10-19 00:32:43 +02:00
Mauro Bringolf
2311ddbe67 Add transform to rename variables that are ES3 reserved words (#6479)
* Initial version

* Replace .includes with .indexOf and better node set to visit

* Alphabetically sort es3 reserved words and make difference helper for readability

* Fix second Array.include error that was not polyfilled

* Move es3 keywords into separate babel-types helper and use in all es3 transforms

* Reference local plugin build directly for tests

* Try relative import for babel-types

* Update to scoped package name and beta 3

* Fix unscoped package import

* Replace local plugin reference with proper plugin name
2017-10-18 15:00:58 -07:00
Robert Rossmann
e6d44fd68e babel-core: Pass the right err to callback in transformFile() (#6503) 2017-10-18 14:14:35 -07:00
Logan Smyth
97a217db30 Merge pull request #6492 from loganfsmyth/better-template
Make babel-template nicer in a bunch of ways
2017-10-18 14:14:14 -07:00
Logan Smyth
f230497d08 Use literal-based templates for more stuff. 2017-10-18 13:58:48 -07:00
Logan Smyth
673eaf839a Simplfy assertion generation. 2017-10-18 13:58:48 -07:00
Logan Smyth
107c37715e Use .program template for helpers. 2017-10-18 13:58:47 -07:00
Logan Smyth
cc802c1e00 Reimplement 'babel-template' with better caching and tagged literal utilities. 2017-10-18 13:58:47 -07:00
Logan Smyth
191624d800 Add a new utility for traversing the AST. 2017-10-18 13:55:14 -07:00
Logan Smyth
ef185feb35 Split template module into multiple files. 2017-10-18 13:55:14 -07:00
Logan Smyth
fc3433c5cf Default templates to sourceType:module. 2017-10-18 13:55:14 -07:00
Logan Smyth
afc3963848 Clean up template calls. 2017-10-18 13:55:14 -07:00
Logan Smyth
cc22ea04bb Add type declaration for t.validate. 2017-10-18 13:55:13 -07:00
Logan Smyth
ad05c9935e Generate types with %checks annotations. 2017-10-18 13:55:13 -07:00
Logan Smyth
e6beb7cb61 Regenerate flow types and add more types. 2017-10-18 13:55:13 -07:00
Mathias Bynens
5d4c736413 Import babel-plugin-transform-unicode-property-regex (#6499)
* Import babel-plugin-transform-unicode-property-regex

Original: https://github.com/mathiasbynens/babel-plugin-transform-unicode-property-regex

Moving it into the official Babel repository makes it easier to maintain the transform.

* Update package.json

* Update README.md

* fixup

* fixup 2
2017-10-18 13:58:44 -04:00
Logan Smyth
1b4307205e Limit file-based plugins/presets to only exporting functions. (#6494) 2017-10-18 10:17:45 -07:00
Logan Smyth
445b252bc4 Simplify dirname option in plugins/presets? (#6436) 2017-10-18 08:59:32 -07:00
Brian Ng
85d82152c6 Update scope pkg ref in nullish syntax README [skip ci] 2017-10-18 09:54:51 -05:00
Brian Ng
d7af472dc0 Update scope pkg ref in nullish README [skip ci] 2017-10-18 09:53:16 -05:00
Brian Ng
c23281dc54 Update more scope package refs in preset-env docs [skip ci] 2017-10-18 09:51:35 -05:00
Brian Ng
72d1a72122 Update babel-types docs and lib/types [skip ci] 2017-10-18 09:43:54 -05:00
Lucas Azzola
99be60b53d Implement transform for nullish-coalescing operator (#6483)
* Implement transform for nullish-coalescing operator

* Update example output

* Switch from BinaryExpression to LogicalExpression

* Address review comments

- Use generateUidIdentifierBasedOnNode
- Inline "??"
- Clone ref node
- Move "??" to LogicalExpression in babel-types

* Fix reference to @babel/helper-plugin-test-runner

* Fix reference to @babel/plugin-syntax-nullish-coalescing-operator

* Don't use parent scope

* Remove .vscode from .gitignore, change 'lib/index.js' to 'lib'

* Ensure `document.all ?? 0 === document.all`

* Fix note and copy to an inline comment
2017-10-18 03:10:05 -04:00
James Kyle
5c47929983 Export File from babel-core again 2017-10-18 12:28:56 +11:00
Logan Smyth
a75e69ecec Regenerate incorrectly-updated helpers from @babel scope PR. 2017-10-17 10:47:15 -07:00
Daniel Tschinder
c16986b0c7 [preset-env] Add 1.6.1 to Changelog [skip ci] 2017-10-17 14:40:16 +02:00
Henry Zhu
830c527bb7 Merge pull request #6495 from babel/scoped-packages
Rename everything: use scoped packages
2017-10-17 08:29:18 -04:00
Henry Zhu
20729b2625 Scoped: fix flow module resolution thanks to James 2017-10-16 23:35:50 -04:00
Henry Zhu
5eea11f1f9 Scoped: misc fixes 2017-10-16 23:00:48 -04:00
Henry Zhu
f30924e655 Scoped: fix tests [skip ci] 2017-10-16 22:49:57 -04:00
Henry Zhu
33af5f745a Scoped: fix more tests in preset-env [skip ci] 2017-10-16 22:49:57 -04:00
Henry Zhu
3400b3644b Scoped: fix bugs in tests [skip ci] 2017-10-16 22:49:57 -04:00
Mateusz Burzyński
6d2f4a6955 Scoped: updated more docs with scoped packages change [skip ci] 2017-10-16 22:49:57 -04:00
Mateusz Burzyński
859ea4b175 Scoped: updated numerous docs with scoped packages change [skip ci] 2017-10-16 22:49:57 -04:00
Henry Zhu
919bdf5e79 Scoped: remove unncessary deps from standalone [skip ci] 2017-10-16 22:49:57 -04:00
Henry Zhu
eab0a1fadb Scoped: remove old references to default enabled syntax plugins, fix bootstrap [skip ci] 2017-10-16 22:49:57 -04:00
Henry Zhu
d19a0e8635 Scoped: fix dep [skip ci] 2017-10-16 22:49:57 -04:00
Henry Zhu
425c2090c1 Scoped: update standalone [skip ci] 2017-10-16 22:49:57 -04:00
Henry Zhu
c0a958098f Scoped: update readme headers to @babel/ [skip ci] 2017-10-16 22:49:57 -04:00
Mateusz Burzyński
adfacbb270 Removed deprecated babel-core/register [skip ci] 2017-10-16 22:49:57 -04:00
Mateusz Burzyński
df721f067e reverted change to keywords in package.jsons [skip ci] 2017-10-16 22:49:57 -04:00
Mateusz Burzyński
47fa189053 Scoped: update more babel- to @babel/ [skip ci] 2017-10-16 22:49:56 -04:00
Henry Zhu
696df10f51 Scoped: update more babel- to @babel/ [skip ci] 2017-10-16 22:49:56 -04:00
Brian Ng
65495105e9 Scoped: rename installation instructions for transforms [skip ci] 2017-10-16 22:49:56 -04:00
Brian Ng
645bf56838 Scoped: rename installation instructions for presets [skip ci] 2017-10-16 22:49:56 -04:00
Brian Ng
4739677965 Scoped: rename installation instructions for syntax plugins [skip ci] 2017-10-16 22:49:56 -04:00
Henry Zhu
79ddf12d9d Scoped: rename to @babel/ in readme [skip ci] 2017-10-16 22:49:56 -04:00
Henry Zhu
dfbbe82598 Scoped: rename npm pkg keyword [skip ci] 2017-10-16 22:49:56 -04:00
Henry Zhu
70080063a4 Scoped: update experimental/codemods to @babel/ [skip ci] 2017-10-16 22:49:56 -04:00
Henry Zhu
691f90a774 Scoped: change test imports to @babel/ [skip ci] 2017-10-16 22:49:56 -04:00
Henry Zhu
cde0054227 Scoped: change src imports to @babel/ [skip ci] 2017-10-16 22:49:56 -04:00
Henry Zhu
8e5e27577a Scoped: update package.json dependencies to @babel/ [skip ci] 2017-10-16 22:49:56 -04:00
Henry Zhu
1cd564bd16 Scoped: rename package names to @babel/ [skip ci] 2017-10-16 22:49:01 -04:00
Henry Zhu
279f55cd9b update to babylon beta.29 2017-10-16 20:10:55 -05:00
Henry Zhu
24d62cd191 7.0.0-beta.29 2017-10-16 18:34:08 -04:00
Henry Zhu
eaf054ba1f Merge pull request #762 from azz/nullish-tests
Add more tests for the nullish coalescing operator
2017-10-16 18:32:26 -04:00
Zachary Sang
98621a6901 Removed index.js stub from packages/babel-core (#6474)
* Removed index.js stub from packages/babel-core

Added "main":"./lib/index.js" entry to package.json to replace index.js in packages/babel-core

* Fix indentation of new main.
2017-10-16 08:52:56 -07:00
Henry Zhu
58da50aace simplify register test (#6391) 2017-10-16 11:09:11 -04:00
Daniel Tschinder
9d00dac416 Update compat-data in babel-preset-env (#6489) 2017-10-16 11:07:41 -04:00
Henry Zhu
3659652fae update to beta.3 (#6488) 2017-10-16 10:51:56 -04:00
Lucas Azzola
727767c923 Add tests for ?? with other LogicalExpressions 2017-10-16 19:34:52 +11:00
Sven SAULEAU
12c389b718 Merge pull request #6490 from Andarist/deps-fix
Fixed es2015-template-literals dependencies
2017-10-15 20:33:56 +02:00
Mateusz Burzyński
1215db2dd3 Fixed es2015-template-literals dependencies 2017-10-15 18:05:05 +02:00
Daniel Tschinder
d80fea47af Add polyfills for ES6 static Object methods
These functions do exist in ES5, but we still need to
load the polyfills, as they differ in ES6 sligthly
2017-10-15 09:27:27 -05:00
Henry Zhu
94da889ab7 v7.0.0-beta.3 2017-10-15 09:12:00 -04:00
Lucas Azzola
f1b8404750 Move ?? to LogicalExpression 2017-10-15 15:10:34 +11:00
Lucas Azzola
fcdfb0e31e Add more tests for the nullish coalescing operator 2017-10-15 12:04:10 +11:00
Henry Zhu
f1d2db6cf4 7.0.0-beta.28 2017-10-14 18:23:44 -04:00
Lucas Azzola
e53ce38c75 Implement nullish coalescing operator in parser (#761)
* Implement nullish coalescing operator in parser

* Add ?? to AST
2017-10-14 17:18:28 -04:00
Brian Ng
b5e6ba62db Allow new.target in class properties (#759) 2017-10-14 16:50:21 -04:00
Brian Ng
60ea39aa70 Fix export extensions handling of TS declare keyword (#757) 2017-10-14 15:25:42 -04:00
Sven SAULEAU
0951720a81 Merge pull request #6481 from nicolo-ribaudo/fn-bind-dupl-nodes-6458
Don't insert duplicated nodes when transforming function bind
2017-10-14 15:49:55 +02:00
Nicolò Ribaudo
4a4c2f37bd Don't insert duplicated nodes when transforming function bind
Fixes #6458
2017-10-13 22:49:13 +02:00
Qantas94Heavy
5f285c1034 Evaluate computed class props only once (#6240) (#6466)
Previously, computed class properties would be evaluated every time a
new instance of the class was created. This means the property name
may have changed between different instances, as well as potential side
effects.

This commit fixes this by storing the computed value in a separate
variable.
2017-10-13 12:19:48 +02:00
aardito2
bfa167cc21 Add additional tests for ignore/only (#5647) 2017-10-12 20:20:07 -05:00
Clark Sandholtz
613b1bc192 Changed beginner-friendly to good first issue as requested in issue (#6471) [skip ci] 2017-10-12 20:21:42 -04:00
Leyth
35b111325e Changed 'beginner-friendly' to 'good first issue' (#6473) [skip ci] 2017-10-12 20:03:10 -04:00
Brian Ng
d7fd8888fa Bump compat-table for Chrome 63 (#6462) 2017-10-11 13:22:32 -04:00
Brian Ng
be58de2b62 Use no-undefined-identifier eslint rule in packages (#6457) 2017-10-11 01:11:48 -04:00
Andy
0fbf3a61fb Fix new type errors (#754) 2017-10-10 16:11:28 -05:00
Anton Rusinov
fcdfc61bdb Move plugin processing to top of plugins (#6381)
* centralize plugin options

* Centralize plugins options

- move more options to the top
- move validations that depend on options to the top

* use isLoose option

* Move more validations to the top

* Move ref parameter for rewriteModuleStatementsAndPrepareHeader() to the top

* fix eslint errors

* remove unused parameter

* set default systemGlobal value

* Revert "Move ref parameter for rewriteModuleStatementsAndPrepareHeader() to the top"

This reverts commit b3855302d17fa19d8acb4c8accab3680c8d2710e.

* Revert "Move more validations to the top"

This reverts commit e5861d8a034ff8f553391f55654f753bcf428a5d.

* fix allowMutablePropsOnTags option usage

* improve naming

* change Contructor definition for sake of consistency

* move allowMutablePropsOnTags validation to the top

* add missing !
2017-10-10 00:51:34 -04:00
Logan Smyth
d89063bb32 Ensure that tests run with the monorepo's version of babel-core (#6454) 2017-10-10 00:29:23 -04:00
Mateusz Burzyński
e52f6caa18 Drop old compatibility if statement targeting babel@6.15 and earlier (#6451) 2017-10-09 13:49:06 -04:00
Sven SAULEAU
6fc9af52ca Merge pull request #751 from gebilaoxiong/remove-unnecessary-return
chore: remove unnecessary return
2017-10-09 13:53:21 +02:00
Logan Smyth
7d6b15bba9 Regenerate types with scripts. 2017-10-08 22:31:31 -04:00
gebilaoxiong
94a17419d4 chore: remove unnecessary return 2017-10-09 00:48:40 +08:00
Henry Zhu
a69d75bdcb Merge pull request #6440 from babel/misc
Misc
2017-10-07 10:28:07 -04:00
Henry Zhu
b4ba3cf2fa use yarn for external bootstrap 2017-10-07 09:17:50 -04:00
Henry Zhu
e522dd8a3c use latest yarn 2017-10-07 08:58:03 -04:00
Henry Zhu
ef467a3887 move eslint_rules to scripts/eslint_rules [skip ci] 2017-10-07 08:54:54 -04:00
Henry Zhu
35646f15a4 reomve unused packages, unused file 2017-10-07 08:51:38 -04:00
gberaudo
6298bcde03 Fix typo in README.md (#6439) 2017-10-07 12:17:55 +02:00
Logan Smyth
d511cfc0e2 Bit more refactoring from last PR. 2017-10-05 22:33:10 -04:00
Henry Zhu
586a738053 update template [skip ci] 2017-10-05 22:26:22 -04:00
Logan Smyth
841e8e9c80 Merge pull request #6435 from loganfsmyth/always-options
Always pass an options object to presets and plugins.
2017-10-05 22:26:01 -04:00
Logan Smyth
b3331c0217 Ensure that the options object always exists. 2017-10-05 22:04:09 -04:00
Logan Smyth
ca4460c0b8 Standardize on {}|void instead of ?{} options. 2017-10-05 22:04:08 -04:00
Logan Smyth
597f1a12cf Refactor loaded descriptors to allow mutation of options. 2017-10-05 21:58:36 -04:00
Logan Smyth
e01ac56b1c Simplify descriptor loading. 2017-10-05 21:52:05 -04:00
Logan Smyth
1e12bb6a23 Add more types around descriptor processing. 2017-10-05 21:52:05 -04:00
Brian Ng
2ee45bd04d Fix package repo url for babel-preset-env [skip ci] 2017-10-05 17:59:51 -05:00
Brian Ng
38355d9230 Tweak babel-preset-env for monorepo 2017-10-05 17:35:16 -05:00
Brian Ng
2d6606fd5a Merge branch 'env' 2017-10-05 13:46:43 -05:00
Henry Zhu
714456f191 update regenerator to latest [skip ci] 2017-10-05 10:57:36 -04:00
Logan Smyth
70a5b77943 Move babel-standalone's build scripts to the repo root. (#6383) 2017-10-05 10:44:56 -04:00
William
36d8a13f4d Fix catch error on do expression and add tests (#6372)
Fixes #6331
2017-10-04 18:19:54 +02:00
Diogo Franco
02d0b74d37 Extend babel-template to work as a template tag (#5001)
Supports:

```js
// these all should produce "code;" when generated
template`code;`();
template`${0}`(t.identifier('code'));
template`${'code'}`({ code: t.identifier('code') });
template`${t.identifier('code')}`()
template({})`code`();
```
2017-10-04 13:07:02 +09:00
Brandon Weaver
43afb984c4 fix readme (#749) [skip ci]
Amusingly the pipeline OP "breaks" the readme formatting because Markdown likes the `|` character a bit too much. Escaping the `|` fixes this and makes the readme display properly
2017-10-03 20:06:07 -04:00
Logan Smyth
93c3c147d6 Upgrade selfhosted compilation to beta.2 (Take 2) (#6382)
* Avoid bug in current version of typeof-symbol transform.

* Selfhost Babel on most recent beta release.
2017-10-03 17:04:30 -07:00
Logan Smyth
5ea54f6cac Fix "module" external helpers output (#6377)
* Move namespace init.

* Move call to helper generation.

* Generate named module exports properly.

* Ensure that helper names are valid identifiers.
2017-10-03 13:58:47 -07:00
Mateusz Burzyński
68182bd69f Fixed reusing node in destructuring plugin, which caused caching issue in helper-module-transforms (#6374) 2017-10-03 15:25:41 -04:00
Brian Ng
4f3e633fd0 Build with latest Babel 2017-10-03 09:51:02 -05:00
greenkeeper[bot]
bbdde80992 Update flow-bin to the latest version 🚀 (#746) 2017-10-03 09:09:15 -05:00
Henry Zhu
91cde0148d note about .ts extension in the preset [skip ci] (#6365) 2017-10-02 17:42:56 -04:00
Nicolò Ribaudo
18dcdc958b export foo -> module.exports = foo in runtime helers (#6366) 2017-10-02 17:40:55 -04:00
Logan Smyth
3d43a6edb4 Merge pull request #6350 from loganfsmyth/plugin-preset-caching-updated
Cache plugins and presets based on their identity
2017-10-02 14:40:06 -07:00
Logan Smyth
35312dc3d2 Track options on the plugin instance to avoid array pair usage. 2017-10-02 14:15:40 -07:00
Logan Smyth
f9bac2a358 Implement caching of plugins/presets/options 2017-10-02 14:09:59 -07:00
Logan Smyth
cc8109cdc3 Merge pull request #6359 from loganfsmyth/file-simplification
Split up babel-core's File class and add Flowtype annotations
2017-10-02 14:08:56 -07:00
Logan Smyth
f02e6847cf Add browser versions of the transform files. 2017-10-02 13:55:37 -07:00
Logan Smyth
eae76e5b89 Break apart the File class into multiple files and add type definitions. 2017-10-02 13:55:37 -07:00
Logan Smyth
c1df126b83 Remove wrap function and calculate code frames earlier. 2017-10-02 13:48:02 -07:00
Henry Zhu
4a8137c6b4 Merge pull request #6335 from jridgewell/pipeline
Pipeline operator
2017-10-02 16:32:15 -04:00
error
9f90b6f140 add con to monorepo.md (#6362) [skip ci] 2017-10-02 16:30:48 -04:00
Nicolò Ribaudo
db6626718f Document babel helpers (#6364) [skip ci] 2017-10-02 16:29:49 -04:00
Justin Ridgewell
73fba55c9f Requeueing sometimes has wrong scope (#6351)
This prevents a requeued path from inheriting a totally wrong scope later on. I can't find exactly where this is happening, but either way a path should only inherit scope from it's ancestors.
2017-10-02 15:26:10 -04:00
Nicolò Ribaudo
977c72250a Add support for helper dependencies (#6254)
* Add support for helpers dependencies.

They are used like this:

    helpers.main = defineHelper(`
        import dep from "dependency";
        export default function main() { return dependency; }
    `);

    helpers.dependency = defineHelper(`ì
        export default function dep() { return 0; }
    `);

* Clone import references

* Don't make test helpers name depend on the order the tests are run
2017-10-02 10:10:52 -07:00
Brian Ng
9cd4716cb4 Add --include-dotfiles option to babel-cli (#6232) 2017-10-02 08:55:53 -05:00
Henry Zhu
6816b26994 Merge pull request #6356 from JeromeFitz/babel-messages-inline
Remove babel-messages and inline the usages
2017-09-30 23:25:06 -04:00
Henry Zhu
b492f452ce don't run CI for tags [skip ci] 2017-09-30 23:23:25 -04:00
Mateusz Burzyński
d8d35ac0c4 Annotating taggedTemplateLiteral calls as #__PURE__ (#6327) 2017-09-30 17:30:44 -04:00
Brian Ng
789ce386ed Bump prettier (#6355) 2017-09-30 09:53:52 -04:00
JeromeFitz
ae168edcfa Remove babel-messages (#6347), continuation of #6352
package.json "babel-messages" removed:
- babel-core
- babel-helper-replace-supers
- babel-plugin-transform-es2015-classes
- babel-traverse

"messages" remove from:
- babel-plugin-check-es2015-constants/src/index.js
- babel-plugin-transform-es2015-for-of/src/index.js

export "babel-messages" removed from:
- babel-core/src/index.js

import "babel-messages" removed from:
- babel-generator/src/index.js
- babel-helper-replace-supers/src/index.js
- babel-traverse/src/index.js
- babel-traverse/src/scope/index.js
- babel-traverse/src/visitors.js

package "babel-messages" removed completely.

💯️ All tests pass.
2017-09-30 09:31:53 -04:00
Abhilash Singh
6230855b71 unshiftContainer seems to incorrectly handle function params #6150 (#6354) 2017-09-30 09:14:51 -04:00
rouzbeh84
aaeebfaf00 inlines babel-messages on the following files:
option-manager.js... /babel-core/src/config/
 build-external-helpers.js... /packages/babel-core/src/tools/
 index.js... /packages/babel-generator/src
2017-09-30 02:19:32 -07:00
Joe Lim
7c8a6cb461 remove inline plugin from Babel's .babelrc (#6348) 2017-09-30 00:15:35 -04:00
Justin Ridgewell
0e432f0e0d Remove debug closures (#6349)
God, can you imagine how many useless closures this was creating?
2017-09-29 21:31:43 -04:00
Justin Ridgewell
e58409b144 Indirect eval 2017-09-29 19:01:18 -04:00
Justin Ridgewell
4b440110a1 Optimize 0 param arrow 2017-09-29 19:01:18 -04:00
Justin Ridgewell
60335ce1ad Ensure left is evaluated before right 2017-09-29 19:01:18 -04:00
Gilbert
81496ab7b1 Pipeline operator 2017-09-29 19:01:18 -04:00
Justin Ridgewell
3746273eda Path#ensureBlock keeps path context (#6337)
* Path#ensureBlock keeps path context

This ensures that if you're inside an ArrowFunction with an expression body (say, you're on the BooleanLiteral in `() => true`), you don't suddenly lose your path context after inserting a variable.

This is because of 82d8aded8e (diff-9e0668ad44535be897b934e7077ecea5R14). Basically, an innocent `Scope#push` caused my visitor to suddenly stop working. Now, we mutate the Path so it's still in the tree.

* Tests
2017-09-29 19:00:10 -04:00
Logan Smyth
828aec757a Merge pull request #6326 from loganfsmyth/preserve-config-identity
Preserve object identity when loading config, for improved future caching.
2017-09-29 15:36:03 -07:00
Logan Smyth
a85a404175 Merge pull request #6343 from loganfsmyth/metadata-cleanup
Remove core .metadata properties and resolveModuleSource
2017-09-29 15:25:08 -07:00
Logan Smyth
a390a92d6a Remove unused helpers prop. 2017-09-29 15:17:12 -07:00
Logan Smyth
f20f8b164f Remove unused module metadata collection. 2017-09-29 15:17:11 -07:00
Logan Smyth
3bac67b4b9 Remove the resolveModuleSource options. 2017-09-29 15:17:11 -07:00
Logan Smyth
8339e036bf Remove babel.analyse and surrounding helpers. 2017-09-29 15:17:11 -07:00
Logan Smyth
655d1cc91b Remove unused 'usedHelpers' property. 2017-09-29 15:17:10 -07:00
Brian Ng
258e3383bd Add Number.parseFloat/Number.parseInt mappings 2017-09-29 18:12:37 -04:00
Henry Zhu
9418945a1f updated readme [skip ci] 2017-09-29 15:25:06 -04:00
Artem Yavorsky
f48e32bab7 Add transform-new-target and missed stage-3 plugins to babel-standalone. (#6322)
* Add transform-new-target to standalone.

* Add missed stage-3 plugins for babel-standalone.
2017-09-29 14:45:33 -04:00
Brian Ng
832408e85d Fix generator missing parens on Flow union types (#6334) 2017-09-29 14:43:38 -04:00
Logan Smyth
455cb5b8d8 Remove unused file properties. 2017-09-29 11:43:23 -07:00
Logan Smyth
c8835cbbee Remove unnecessary Store subclass. 2017-09-29 11:05:57 -07:00
Logan Smyth
1938f490b3 Move pipeline file to index. 2017-09-29 11:02:23 -07:00
Mateusz Burzyński
f0ab0f81d3 transform-es2015-template-literals doesn't have spec mode anymore, change test to use loose mode (#6338) 2017-09-29 08:00:06 -04:00
Henry Zhu
64366a207e 7.0.0-beta.27 2017-09-28 23:26:01 -04:00
Henry Zhu
d2e06a9496 Pipeline Operator proposal (#742) 2017-09-28 23:13:41 -04:00
Rick Waldron
18c6b4e3e9 Fix: major revision to valid and invalid numeric literal separator "sibling" characters (#745) 2017-09-28 23:12:46 -04:00
greenkeeper[bot]
17be9360af Update babel-eslint to the latest version 🚀 (#738)
* chore(package): update babel-eslint to version 8.0.1

* chore(package): update lockfile

https://npm.im/greenkeeper-lockfile
2017-09-28 14:25:43 -04:00
Rick Waldron
b8ba10532e Fix NumericLiteralSeparator SyntaxError message to match V8 (#743) 2017-09-28 14:25:30 -04:00
Henry Zhu
ab268877fd don't build for tags (#741) 2017-09-28 10:51:04 -04:00
Logan Smyth
048a5b8021 Reenable Flow in option-manager 2017-09-27 16:37:45 -07:00
Justin Ridgewell
23f98a753a Add throw expressions (#6325)
* Add throw expressions

Stage 2 proposal: https://github.com/tc39/proposal-throw-expressions

* Update babylon

* Add to stage 2
2017-09-27 16:15:44 -04:00
Henry Zhu
508cb70a35 7.0.0-beta.26 2017-09-27 14:34:39 -04:00
Nicolò Ribaudo
664ff37b36 Fix flow errors (#735) 2017-09-27 14:33:11 -04:00
Logan Smyth
fc448ca8f2 Flatten, process, and cache incoming options by key. 2017-09-27 11:20:27 -07:00
Justin Ridgewell
8af007d560 Add throw expressions (#740) 2017-09-27 14:12:30 -04:00
Zoe Carver
ef8e30419c Add yield-result (#737) 2017-09-27 11:00:14 -05:00
Henry Zhu
c4696a5bd2 add docs for other import syntax [skip ci] (#6323) 2017-09-27 10:29:51 -04:00
Logan Smyth
a599c49436 Centralize call to getEnv(). 2017-09-26 22:29:48 -07:00
Logan Smyth
7455e58270 Reuse config file merge. 2017-09-26 22:29:34 -07:00
Logan Smyth
9a4b764bde Centralize config processing in class. 2017-09-26 22:29:32 -07:00
Logan Smyth
2d7cda4d28 Remove unnecessary function. 2017-09-26 22:28:56 -07:00
Logan Smyth
073a0dc823 Split the ignore logic into its own helper class. 2017-09-26 22:28:56 -07:00
Logan Smyth
508597aadc Merge pull request #6309 from loganfsmyth/assert-module-exports-usage
Support opt-in restrictions on 'module' and 'exports' usage alongside ES6 import/export.
2017-09-26 16:42:31 -07:00
Logan Smyth
0368d41441 Fix some README issues. 2017-09-26 16:22:47 -07:00
Logan Smyth
e65994e43d Add tests for locally-declared 'exports' and 'module'. 2017-09-26 15:46:26 -07:00
Logan Smyth
b79df60fe6 Disallow usage of module/exports in ES6 modules. 2017-09-26 15:43:51 -07:00
Logan Smyth
9dfcf0f116 Split the simple-access transforms out of the module transform into a general helper. 2017-09-26 15:43:51 -07:00
Logan Smyth
0125c03303 Merge pull request #6304 from loganfsmyth/import-helper
Rewrite import insertion to insert import..from/require() based on module type
2017-09-26 15:39:42 -07:00
Logan Smyth
14ace422c3 Fix two small typoes. 2017-09-26 15:38:55 -07:00
Logan Smyth
f11cce1d7c Avoid exception when instanceof is in anonymous function declaration. 2017-09-26 15:30:50 -07:00
Logan Smyth
9b0f509433 Avoid exception when typeof is in anonymous function declaration. 2017-09-26 15:30:50 -07:00
Logan Smyth
8bea5f4f16 Fix bail-out for standalone build. 2017-09-26 15:21:56 -07:00
Logan Smyth
ed6e6fd7dd Export babel-runtime helpers as standard CommonJS. 2017-09-26 11:28:57 -07:00
Logan Smyth
5eda451fb8 Remove the unused '.addImports' API from 'babel-core'. 2017-09-26 11:28:57 -07:00
Logan Smyth
ed3603ef44 Use the imports helper in transform-runtime. 2017-09-26 11:28:57 -07:00
Logan Smyth
11715cb7af Use the imports helper in async-to-module-method. 2017-09-26 11:28:57 -07:00
Logan Smyth
ec9754bc40 Implement a new utility module for injecting module imports. 2017-09-26 11:28:56 -07:00
Logan Smyth
84184e2ddd Add failing test for babel-runtime import issue. 2017-09-26 11:02:36 -07:00
Logan Smyth
a1c268667a Fix bug in helper processing. 2017-09-26 11:02:36 -07:00
Logan Smyth
d159c468b2 Factor transform-runtime import insertion. 2017-09-26 11:02:36 -07:00
Henry Zhu
a9dd7d970f 2.0.0-beta.2 2017-09-26 12:08:50 -04:00
Henry Zhu
e7aaf1f361 update to beta.2 (#427) 2017-09-26 12:05:13 -04:00
Henry Zhu
70547efcc1 v7.0.0-beta.2 2017-09-26 11:14:41 -04:00
Henry Zhu
195745f25f update types readme [skip ci] 2017-09-26 11:06:03 -04:00
Brian Ng
c821d3a591 Updates for handling codemods folder (#6279)
* add codemod folder to gitignore, update build/test scripts to handle codemods, lerna config
2017-09-26 10:38:18 -04:00
Logan Smyth
5a2a5fb411 Move template object creation from core into the template transform. (#6307)
* Move template object creation into the template transform.

* use shorthand [skip ci]
2017-09-26 10:33:18 -04:00
Logan Smyth
0379060f8a addMapping method call missing name parameter (#6310)
in mergeSourceMap, addMapping method call missing name parameter
2017-09-26 10:24:19 -04:00
Nicolò Ribaudo
8aabbbc822 Use helper-builder-react-jsx inside plugin-transform-react-inline-elements (#6294)
* Use helper-builder-react-jsx inside plugin-transform-react-inline-elements.

This avoids duplicating the logic for converting jsx elements to plain JavaScript.

* Add a comment which explains the _jsx signature, [skip ci]
so it is a little bit easier to understand what all those .splice() calls do
2017-09-26 10:15:27 -04:00
Henry Zhu
314bd31b85 update generator/babel-types printing, babylon (#6306)
* update generator printing, babylon [skip ci]

* Update babel-types for TS node types
2017-09-26 10:01:55 -04:00
Nicolò Ribaudo
4de29fe5e6 Distinguish between ternary's : and arrow fn's return type (#596) 2017-09-26 00:32:52 +02:00
Henry Zhu
4c517a8912 update readme [skip ci] (#6305) 2017-09-25 16:08:39 -04:00
Henry Zhu
20ec5c77b7 7.0.0-beta.25 2017-09-25 15:48:29 -04:00
James Kyle
d9766932db Ensure no-overlap between Flow and TS node types (#710) 2017-09-25 15:42:33 -04:00
Brian Ng
4bd9d751f4 Add minor edits to babel-helper-annotate-as-pure README [skip ci] 2017-09-25 11:00:38 -05:00
Mateusz Burzyński
413ffe6639 Extracted babel-helper-annotate-as-pure (#6267) 2017-09-25 17:40:51 +02:00
Brian Ng
6012c5bedb Fix targets.browsers anchor links [skip ci] 2017-09-25 10:22:59 -05:00
Zoe Carver
a4acf2da6d Clean up uncatagorised decorators (1/2) (#731)
* Re-name uncatagorised 1 and 2

* Move to es2015

* Add expected.json to parenthesized lhs object

* Orginize into parenthesized-lhs-array and parenthesized-lhs-object

* Remove uncategorised/33 because it was repeditive decorators/class-decorator

* Move uncatagorised/34 to decorators/class-decorator-assignment

* Move uncategorised/35 to decorators/method-decorator

* Move uncategorised/36 to decorators/class-decorator-setter

* Move uncategorised/37 to decorators/class-decorator-getter

* Move uncategorised/38 to decorators/class-decorators-multiple

* Clean up syntax

* Move uncategorised/39 to decorators/object-decorator

* Remove syntax in order to pass tests

* Re-add uncategorisd/33 as decorators/class-decorator-new-line

* Move class-decorator-new-line to class-decorator-same-line
2017-09-24 16:33:01 -04:00
Pranav Prakash
2374062bbd Remove babel-node from babel-cli (#6251)
* Remove babel-node from babel-cli

* Use new Array instead of Array for V8 optimization

* Remove extraneous use strict clauses

* Require babel-node in babel-cli

* Remove babel-node from babel-cli

* Require babel-node in babel-cli

* Remove babel-node executable from babel-cli

* Clean up babel-node from package.json
2017-09-23 11:25:27 -07:00
Logan Smyth
b115ea5da7 Merge pull request #6280 from loganfsmyth/only-transform-modules
Only transform 'this'->'undefined' and inject 'use strict' if module statements are present
2017-09-23 11:24:52 -07:00
Mateusz Burzyński
d8b7bc39af Fixed loose option of transform-es2015-parameters handling only Assig… (#6274) 2017-09-22 19:39:39 -04:00
Mateusz Burzyński
0f8c4dc5a1 Fixed transform-fixture-test-runner API docs [skip ci] (#6293) 2017-09-22 18:44:44 -04:00
Sean Zellmer
69f237b743 Fix table of contents in README (#423)
Caveat was renamed to Issues. 'Other Cool Projects' was removed.
Both happened in e4b89a1.
2017-09-22 12:50:29 -05:00
Logan Smyth
72da5e1d02 Quick fix for default import that also uses names. (#6282) 2017-09-21 22:26:42 -07:00
Mateusz Burzyński
9159323b1e Skip adding explicit undefined for let declarations when it is not ne… (#6288) 2017-09-21 22:26:08 -07:00
Mateusz Burzyński
88b7983e4f Fixed asyncToGenerator helper using arrow function (#6289) 2017-09-21 17:09:43 -07:00
Zoe Carver
bfd9c7ba50 Clean up uncategorised tests (#730) 2017-09-21 16:12:36 -05:00
Brian Ng
5983ae38fc Merge pull request #729 from babel/greenkeeper/flow-bin-0.55.0
Update flow-bin to the latest version 🚀
2017-09-21 10:34:50 -05:00
greenkeeper[bot]
f6d7209f0e chore(package): update lockfile
https://npm.im/greenkeeper-lockfile
2017-09-20 19:59:29 +00:00
greenkeeper[bot]
040e46d4f8 chore(package): update flow-bin to version 0.55.0 2017-09-20 19:51:48 +00:00
Logan Smyth
2b88e079ef Only transform this/use strict if a module. 2017-09-20 10:19:35 -07:00
Logan Smyth
8e6b5de042 Allow tests to be .mjs files. 2017-09-19 14:50:43 -07:00
Logan Smyth
aebebd3dde Remove unused expected.json parsing. 2017-09-19 14:50:42 -07:00
Logan Smyth
f23dd3a04c Move 'this' tests to the correct place. 2017-09-19 14:50:42 -07:00
Logan Smyth
fec79e358c Ensure that Program nodes have a sourceType. 2017-09-19 14:50:42 -07:00
Henry Zhu
7c971f3d4d 2.0.0-beta.1 2017-09-19 16:34:39 -04:00
Brian Ng
03d7089b43 Rename stage3 (#421) 2017-09-19 15:33:58 -05:00
Henry Zhu
b83fa26937 release as 0.0.1 [skip ci] 2017-09-19 16:27:26 -04:00
Henry Zhu
23121d2bd3 v7.0.0-beta.1 2017-09-19 16:24:07 -04:00
Henry Zhu
5b9112c794 babel-helper-modules -> babel-helper-module-transforms since package taken [skip ci] 2017-09-19 16:20:03 -04:00
Henry Zhu
8597219ce5 move to codemods folder [skip ci] 2017-09-19 16:04:11 -04:00
Henry Zhu
5c824273bc update to beta.0 [skip ci] 2017-09-19 16:00:18 -04:00
MarckK
8dffbf19d0 Codemod: remove unused catch binding (#6048)
* outline of plugin to remove unused catch binding, test not passing

* plugin to remove unused catch binding

* Edit README.md and package.json

* tests for try catch finally

* Add test to handle case when binding is referenced and given new TypeError (not passing)

* Fix visitor to not remove catch clause param when binding being assigned a new value

* Improve naming of tests and explanations

* add test case for catch param not present and fix test for duplicate variable declaration

* Remove binding.constantViolations filter in visitor as superfluous

* Remove duplicate check that catch clause param present

* Alter visitor so returns out when catch binding is not an Identifier

* Created failing tests for ObjectPattern params and rewrote visitor so now passing
Took out the pass in visitor when param not an Identifier, wrote case to handle when param isObjectPattern, and wrote failing tests for when param isArrayPattern

* Handle case when param isArrayPattern, tests passing

* Update package.json to  v7.0.0-alpha.20

* Revert visitor to only consider transform if param is Identifier
2017-09-19 15:38:17 -04:00
Brian Ng
27b155aa71 Add stage-3 plugin option (#384) 2017-09-19 15:24:15 -04:00
Henry Zhu
57584268cd move out syntax plugins to babel/babel-archive, they don't need to be updated (#6229) 2017-09-19 15:19:13 -04:00
Henry Zhu
174eaa058a just inline the type (#6271) [skip ci] 2017-09-19 15:14:12 -04:00
Mateusz Burzyński
4519f95a29 Fixed buildExternalHelpers tool for var and module output types (#6260) 2017-09-19 14:44:40 -04:00
Henry Zhu
38504c68e3 7.0.0-beta.24 2017-09-19 14:19:01 -04:00
greenkeeper[bot]
7eaf556094 Update babel-eslint to the latest version 🚀 (#719) [skip ci]
* chore(package): update babel-eslint to version 8.0.0

* chore(package): update lockfile

https://npm.im/greenkeeper-lockfile
2017-09-19 14:12:25 -04:00
Logan Smyth
fc1e1c5668 Preserve _blockHoist values for injected binding references. (#6269) 2017-09-19 09:53:18 -07:00
Logan Smyth
bd734f03fb Make babel-register 7.x backward-compatible with 6.x. (#6268) 2017-09-19 09:52:57 -07:00
Brian Ng
9f0f8d99d5 Merge branch 'master' into 2.0 2017-09-18 20:15:30 -05:00
James Hegedus
8b97a8acf9 Clarify purpose of the tool in README (#419) 2017-09-18 18:32:18 -05:00
Pranav Prakash
e98bb3dc60 Use new Array instead of Array for V8 optimization (#6250)
* Use new Array instead of Array for V8 optimization

* fix spacing [skip ci]

* Remove extraneous use strict clauses
2017-09-18 14:14:46 -04:00
Mathias Bynens
24713e5040 transform-es2015-unicode-regex: Add tests for U+002F (#6265) 2017-09-18 13:36:39 -04:00
Mathias Bynens
51b0b06a25 Update regexpu-core to v4.1.3 (#6263)
Fixes #6246.
2017-09-18 11:48:01 -04:00
Brian Ng
d016deac3d Merge pull request #727 from jridgewell/private-methods
classPrivateMethods enables PrivateName usage
2017-09-18 08:55:44 -05:00
Justin Ridgewell
1f11dc0881 classPrivateMethods enables PrivateName usage
This separates `classPrivateMethods`'s dependency on
`classPrivateProperties`. It also starts a `PrivateName` at the hash
symbol, not the `Identifier`.
2017-09-17 21:24:37 -04:00
Ajay Narain Mathur
3cdb7d7f0f added instanceOf plugin to preset es2015 (#6257)
* added instanceOf plugin to preset es2015

* fixed test cases
2017-09-17 17:33:42 -04:00
Ethan Han
f5ad86c5c6 Fix newlines before the update suffix operator in babel-generator (#6259) 2017-09-17 11:22:05 -07:00
Henry Zhu
c815cf554f stopped working at some point so let's remove [skip ci] 2017-09-16 19:14:29 -04:00
Henry Zhu
745c4740af remove ref to phabricator now that we've been on gissues for a while [skip ci] 2017-09-16 19:10:29 -04:00
Henry Zhu
5fae81f43f move out old changelog, remove npm owners unused file [skip ci] 2017-09-16 19:00:36 -04:00
Henry Zhu
efe5c7928a readme: move partially into packages/ [skip ci] 2017-09-16 18:56:51 -04:00
Henry Zhu
1c14fb1227 readme: move out packages [skip ci] 2017-09-16 18:56:29 -04:00
greenkeeper[bot]
9b582c913a Update rollup to the latest version 🚀 (#725)
* chore(package): update rollup to version 0.50.0

* chore(package): update lockfile

https://npm.im/greenkeeper-lockfile
2017-09-16 15:47:33 -04:00
Artem Yavorsky
41f419a2fc Merge pull request #416 from babel/fix-docs
Docs: fix claim about node versions in readme
2017-09-16 12:21:15 +03:00
Kevin Gibbons
4df876b4b5 Docs: fix claim about node versions in readme 2017-09-16 00:29:58 -07:00
Daniel Tschinder
9a0dd4e001 Fix jsx-source to not fail without filename (#6239) 2017-09-16 02:44:48 -04:00
Brian Ng
583a875d22 Add core-js stubs for parseFloat and parseInt to babel-polyfill (#6256) 2017-09-16 02:43:35 -04:00
Brian Ng
5f5ad940ed Bump regenerator-runtime version in babel-polyfill (#6255) 2017-09-16 02:42:46 -04:00
Logan Smyth
f35cf8185b Change usage of flag that was renamed. 2017-09-15 11:43:08 -07:00
Brian Ng
7f390b0282 Make terminator paren comment check more strict (#5651) 2017-09-15 11:06:24 -07:00
Henry Zhu
4df30fc300 7.0.0-beta.23 2017-09-14 20:38:17 -04:00
Henry Zhu
bf93be47c2 Merge pull request #6244 from loganfsmyth/remove-strict-toggling-wildcard-interop
Remove strict toggling wildcard interop
2017-09-14 11:19:46 -04:00
Brian Ng
cdb34c3aa2 Add support for new.target transform (#414) 2017-09-14 11:06:53 -04:00
Logan Smyth
3c93189fce Remove useless stict toggle from strict transform. 2017-09-13 23:30:41 -07:00
Logan Smyth
b6ae55153c Misc documentation fix. 2017-09-13 23:30:41 -07:00
Logan Smyth
2801bfe35c Remove 'strict:false' directive behavior. Use 'strictMode:false'. 2017-09-13 23:30:41 -07:00
Logan Smyth
637bba542a Remove interop toggling behavior of 'strict'. 2017-09-13 23:30:40 -07:00
Logan Smyth
c65742602b Add some docs for why template literals use a chain of .concat() calls. 2017-09-13 13:42:20 -07:00
Logan Smyth
18f77b3aa9 Merge pull request #6238 from loganfsmyth/reexport-name-priority
Named exports should always take priority over star exports
2017-09-13 13:33:50 -07:00
Stephen Scott
f3fe5001e6 Flesh out readme (#410) 2017-09-13 12:29:30 -05:00
Maël Nison
0ea295e83b Make sure that export * from does not overwrite named exports. 2017-09-12 22:32:09 -07:00
Logan Smyth
634c750558 Ensure helpers that reference globals continue to reference the globals properly. 2017-09-12 22:15:16 -07:00
Logan Smyth
158e9fbfd7 Represent helpers as simple modules. 2017-09-12 22:15:16 -07:00
Sven SAULEAU
0c5fae2faa Make sure source type is module when parsing .mjs (#5700)
* feat: force source type module for mjs extension

* style: fix lint
2017-09-12 20:59:00 -07:00
Logan Smyth
7179136401 Ensure the AMD/UMD loaders all have params for each import to avoid lazy-loading (#6237) 2017-09-12 20:13:16 -07:00
Maël Nison
5bb6a83fa8 Add new tests for export * from with other names. 2017-09-12 19:51:48 -07:00
Logan Smyth
5006c81b77 Apply the new module transform the the babel-runtime helper files. 2017-09-12 17:51:52 -07:00
Logan Smyth
1e750a945c Convert CommonJS to use new shared implementation. 2017-09-12 17:17:41 -07:00
Logan Smyth
f17d30692c Convert AMD to use new shared implementation. 2017-09-12 17:17:41 -07:00
Logan Smyth
95e08b6d2a Convert UMD to use new implementation of module logic. 2017-09-12 17:17:41 -07:00
Logan Smyth
47a254025a Return a unique identifier node for each use. 2017-09-12 17:17:41 -07:00
Logan Smyth
20679979fc Remove the unused 'scope' param from 'traverse.hasType'. 2017-09-12 16:48:05 -07:00
Henry Zhu
feed22c822 2.0.0-beta.0 2017-09-12 09:40:53 -04:00
Henry Zhu
a381f9b5f0 update to beta.0 (#413) 2017-09-12 09:40:35 -04:00
Henry Zhu
1cdacf85ae update types readme [skip ci] 2017-09-11 23:04:12 -04:00
Henry Zhu
1c13250807 v7.0.0-beta.0 2017-09-11 23:01:41 -04:00
Laurin Quast
8742012b5e Add --keep-file-extension option to babel-cli (#6221)
* Add --keep-module-extension option to babel-cli

* Rename keep-module-extension option to keep-file-extension; Change option to preserve all file extensions
2017-09-11 18:06:44 -04:00
Justin Ridgewell
4daf11528c Return inserted/replaced paths (#5710)
* Return inserted/replaced paths

This gives `Path`’s replacement and insertion methods a consistent
return value: the inserted/replaced paths.

Before, they could return `undefined`, a `node`, or a the current path
inside an array. It was kinda pointless.  But now they always return an
array of paths, which is useful for solving
https://github.com/babel/babel/pull/4935#discussion_r96151368.

* Return inserted nodes and not BlockStatement

Addded test for bug #4363

* Cleanups

- `#replaceWith` will now return the current path if it's the same node
- `#insertAfter` and `#insertBefore` use public Path APIs now
- Makes container insertion faster (single splice call)
- Use public APIs in container insertion
- Replacing a statement with an expression returns the expression's path
- Replacing an expression with multiple statements returns the inserted
  closure's body's paths.
2017-09-11 16:07:04 -04:00
Mateusz Burzyński
c47258d68c Annotating transformed classes with #__PURE__ comment (#6209) 2017-09-11 11:18:37 -04:00
Ben Newman
c4f6a7a06f Add failing test case for object rest after array rest, and fix it. (#6213)
* Add failing test case for object rest after array rest.

Discovered while upgrading https://github.com/meteor/babel to Babel 7.

The error is:

  1) babel-plugin-transform-object-rest-spread/object rest with array rest:
     TypeError: /Users/ben/dev/babel/packages/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/with-array-rest/actual.js: Property id of VariableDeclarator expected node to be of a type ["LVal"] but instead got null
      at Object.validate (packages/babel-types/lib/definitions/index.js:73:13)
      at validate (packages/babel-types/lib/index.js:460:9)
      at Object.builder (packages/babel-types/lib/index.js:428:7)
      at Object.RestElement (packages/babel-plugin-transform-object-rest-spread/lib/index.js:157:41)
      at NodePath._call (packages/babel-traverse/lib/path/context.js:53:20)
      at NodePath.call (packages/babel-traverse/lib/path/context.js:40:17)
      at NodePath.visit (packages/babel-traverse/lib/path/context.js:84:12)
      ...

* Fix object rest following array rest. (#6213)

* Avoid treating array ...rest elements as object ...rest properties.

* Also avoid treating ...rest parameters as object ...rest properties.

Returning early if the parent was an ArrayPattern was not quite enough,
since a RestElement can appear as a parameter in a Function as well.

* Move RestElement parent check earlier in visitor method.
2017-09-11 11:16:14 -04:00
Sven SAULEAU
1341e4163b fix(preset-es2015): pass loose option (#6224) 2017-09-11 10:37:18 -04:00
Sven SAULEAU
3bd142ba8a Merge pull request #716 from babel/rollup
Bump rollup
2017-09-10 09:36:52 +02:00
Lukas Geiger
b6467a68ca Add option to define output directory relative to the input (#5421)
* Fix output directory if filename is given

* Add test for relative output path

* Add option to define output dir relative to input

* Add tests for --copy-files

* Test error handling for wrong arguments
2017-09-09 20:38:06 -04:00
Daniel Tschinder
5565e1b406 Correctly requeue CallExpression in AMD transform (#5497)
* Correctly requeue the define()-CallExpression

* Use pushContainer
2017-09-09 20:33:35 -04:00
Ruben Verborgh
6560a29c36 Redeclaring a variable counts as a modification (#6219)
* Redeclaring a variable counts as a modification.

Fixes #6217.

* Remove "existing" logic from Binding.

Was added in #5745, but no longer triggered since 6536e605a.
2017-09-08 23:02:26 -04:00
Justin Ridgewell
4e612058c0 Do not fix linting errors in precommit hooks (#6218)
It's just damn annoying. Supersedes #5908.
2017-09-08 19:52:49 -04:00
Brian Ng
b8544de9a8 Bump rollup 2017-09-08 10:00:59 -05:00
Brian Ng
e8c533ba68 Merge pull request #715 from nicolo-ribaudo/makePredicate-comment
Remove outdated code
2017-09-08 09:56:16 -05:00
Nicolò Ribaudo
b97c534b32 Remove outdated imports
They were not needed since c4fb3fe742
because now each files declare a new class
instead of adding method to the existing one.
2017-09-08 15:24:46 +02:00
Nicolò Ribaudo
ef31a148a6 Remove outdated comment
The described code was removed in 5f1c3c3b8d (2 years ago!)
2017-09-08 12:59:22 +02:00
Nicolò Ribaudo
4e7961dcf8 Use /bin/bash instead of /bin/sh in scripts
`/bin/sh` isn't always an alias of `/bin/bash`, so bash-specific syntax broke the scripts.
(like 777a9ae6e4/scripts/_get-test-directories.sh (L7))
2017-09-07 17:19:40 -07:00
Karl Cheng
65bea96544 Add support for class private methods (#703)
* Add support for class private methods

This commit adds parser support for the TC39 Stage 2 Private Methods
proposal.

This commit also changes "key" in ClassPrivateProperty from an
Identifier to a PrivateName, as well as disallowing #constructor as a
valid private field name.

* Add tests for string literal get/set/async

These should be treated as regular methods and not special get/set/async
behaviour.

* Add tests for class private methods

This also removes a test from the Test262 whitelist that failed before
the changes for private methods support and now passes.

* Modify class private prop tests for PrivateName

* Add class private prop tests for #constructor

* Fix existing ASI test case failure
2017-09-06 18:09:12 -04:00
greenkeeper[bot]
b65b5a2f1c Update flow-bin to the latest version 🚀 (#714)
* chore(package): update flow-bin to version 0.54.1

* chore(package): update lockfile

https://npm.im/greenkeeper-lockfile
2017-09-06 13:56:26 -04:00
Henry Zhu
bbac1ebe45 2.0.0-alpha.20 2017-09-06 11:36:30 -04:00
Henry Zhu
7c70b27b53 add basic example [skip ci] (#409) 2017-09-06 00:03:06 -04:00
Noah Lemen
777a9ae6e4 warn about class properties support in decorators readme and error messaging (#6196) 2017-09-05 14:24:21 -04:00
Astha Sharma
3a2b7fe3cd JSX pragma revert (#6195)
* Removed the deprecated jsx pragma detection code and the concerned tests that included jsx-pragma

* Removed extra tests

* Restored packages/babel-plugin-transform-react-jsx/test/fixtures/react/honor-custom-jsx-pragma-option/

* Added JSX_ANNOTATION_REGEX

* Reverted the tests for jsx-pragma-options and removed those which throw deprecated message
2017-09-04 00:25:56 -04:00
Logan Smyth
d6ba4d0a24 Only compile files inside the cwd in babel-register. (#5590) 2017-09-02 01:07:26 -04:00
Justin Ridgewell
5df70e6a94 Fix bad Scope#parent caching (#6155)
* Fix bad Scope#parent caching

Now, we traverse the path until we find a parent scope.

Fixes #6057.

* Fix bad merge

* Remove cached data

* I need to stop using Github editor

* Fix infinite loops due to scopable paths being moved up
2017-09-02 01:03:10 -04:00
Daniel Tschinder
ca117e08cb fix(requeue): Always requeue implicitely created BlockStatements (#6193)
This reverts the former fix done in #5743 and always requeues
BlockStatements when they get created.

This also fixes a bug in babel-generator which would indent code
even though no comments are present.
2017-09-02 01:02:21 -04:00
Zev Isert
2dd03e3ee9 Allow NodeJS v8.4 experimental HTTP2 (#6175)
* Allow NodeJS v8.4 experimental HTTP2

Native NodeJS HTTP/2 support experimental though, so might not be worth merging this

* Linter picked up on a line with only spaces

Removed the spaces
2017-09-02 00:42:45 +02:00
Logan Smyth
4f441ff27e Ignore the standalone output bundle so it will require() faster. 2017-09-01 15:31:29 -07:00
Justin Ridgewell
f7109658f9 Added --delete-dir-on-start option for babel (#6187)
* added --delete-dir-on-start option 

added --delete-dir-on-start-option to delete dir on start of compilation to remove deleted files from the orignial files from the --out-dir

* added option --delete-dir-on-start

added --delete-dir-on-start that option will delete the --out-dir before the compilation of code to remove the deleted files from the source from the out directory

* added --delete-dir-on-start option

added --delete-dir-on-start-option to delete dir on start of compilation to remove deleted files from the orignial files from the --out-dir

* bug removed deleting the correct dir

in the previous code, the source dir was deleted each time rather than deleting the out dir

* Remove shorthand

* Prevent babel-cli option from reaching babel-core

* Lint
2017-09-01 17:45:13 -04:00
Justin Ridgewell
f39811d271 Derived constructors don't always need a super (#6189) 2017-09-01 17:14:25 -04:00
Logan Smyth
fad9345c85 Revert Yarn workspace changes from #6056 for now.
Yarn currently fails to add the correct symlinks in some cases. See https://github.com/yarnpkg/yarn/issues/4289
2017-09-01 13:17:25 -07:00
Brian Ng
8cc89e6228 Remove duplicate flow travis job, and update whitelist (#711) 2017-09-01 12:41:34 -04:00
Justin Ridgewell
1797ac5015 Update babylon and remove bad label tests (#6188) 2017-09-01 12:29:48 -04:00
Mateusz Burzyński
76161e0a73 Added new outputType - module - for build-external-helpers tool. Should help with tree-shaking story. It's strongly influenced by how the helpers are transformed by rollup-plugin-babel. (#5916) 2017-08-31 23:44:24 -04:00
Daniel Tschinder
ab30fa54cb Update debug to 3.0 (#6184) 2017-08-31 23:30:04 -04:00
Daniel Tschinder
44f6ff5e85 Update prettier, eslint + plugins, flow, husky and lint-staged (#6183) 2017-08-31 22:56:29 +02:00
Henry Zhu
6108bee4f9 update changelog labels [skip ci] 2017-08-31 15:59:05 -04:00
Daniel Tschinder
5e018d507b Use correct branch for babel test (#707) 2017-08-31 20:36:57 +02:00
Henry Zhu
c6b2c6bef0 Merge pull request #680 from nicolo-ribaudo/flow-tests
Fix flow test runner
2017-08-31 14:36:47 -04:00
Daniel Tschinder
0189b38702 Merge branch '6.x' into 7.0
# Conflicts:
#	CONTRIBUTING.md
#	Makefile
#	README.md
#	lerna.json
#	lib/types.js
#	package.json
#	packages/babel-cli/package.json
#	packages/babel-code-frame/package.json
#	packages/babel-core/package.json
#	packages/babel-core/test/fixtures/transformation/misc/regression-2892/expected.js
#	packages/babel-generator/package.json
#	packages/babel-generator/src/generators/flow.js
#	packages/babel-generator/src/index.js
#	packages/babel-generator/test/fixtures/flow/declare-statements/expected.js
#	packages/babel-generator/test/fixtures/flow/object-literal-types/expected.js
#	packages/babel-generator/test/fixtures/flow/opaque-type-alias/expected.js
#	packages/babel-helper-bindify-decorators/package.json
#	packages/babel-helper-builder-binary-assignment-operator-visitor/package.json
#	packages/babel-helper-builder-conditional-assignment-operator-visitor/package.json
#	packages/babel-helper-builder-react-jsx/package.json
#	packages/babel-helper-call-delegate/package.json
#	packages/babel-helper-define-map/package.json
#	packages/babel-helper-explode-assignable-expression/package.json
#	packages/babel-helper-explode-class/package.json
#	packages/babel-helper-fixtures/package.json
#	packages/babel-helper-function-name/package.json
#	packages/babel-helper-get-function-arity/package.json
#	packages/babel-helper-hoist-variables/package.json
#	packages/babel-helper-optimise-call-expression/package.json
#	packages/babel-helper-plugin-test-runner/package.json
#	packages/babel-helper-regex/package.json
#	packages/babel-helper-remap-async-to-generator/package.json
#	packages/babel-helper-replace-supers/package.json
#	packages/babel-helper-transform-fixture-test-runner/package.json
#	packages/babel-helpers/package.json
#	packages/babel-plugin-transform-async-generator-functions/package.json
#	packages/babel-plugin-transform-async-to-generator/package.json
#	packages/babel-plugin-transform-async-to-module-method/package.json
#	packages/babel-plugin-transform-class-constructor-call/package.json
#	packages/babel-plugin-transform-class-properties/package.json
#	packages/babel-plugin-transform-decorators/package.json
#	packages/babel-plugin-transform-es2015-block-scoping/package.json
#	packages/babel-plugin-transform-es2015-classes/package.json
#	packages/babel-plugin-transform-es2015-classes/test/fixtures/regression/T6755/expected.js
#	packages/babel-plugin-transform-es2015-computed-properties/package.json
#	packages/babel-plugin-transform-es2015-duplicate-keys/package.json
#	packages/babel-plugin-transform-es2015-function-name/package.json
#	packages/babel-plugin-transform-es2015-modules-amd/package.json
#	packages/babel-plugin-transform-es2015-modules-commonjs/package.json
#	packages/babel-plugin-transform-es2015-modules-commonjs/src/index.js
#	packages/babel-plugin-transform-es2015-modules-commonjs/test/fixtures/interop/export-destructured/expected.js
#	packages/babel-plugin-transform-es2015-modules-commonjs/test/fixtures/strict/export-const-destructuring-object-default-params/expected.js
#	packages/babel-plugin-transform-es2015-modules-commonjs/test/fixtures/strict/export-const-destructuring-object-rest/expected.js
#	packages/babel-plugin-transform-es2015-modules-commonjs/test/fixtures/strict/export-const-destructuring-object/expected.js
#	packages/babel-plugin-transform-es2015-modules-commonjs/test/fixtures/strict/options.json
#	packages/babel-plugin-transform-es2015-modules-systemjs/package.json
#	packages/babel-plugin-transform-es2015-modules-umd/package.json
#	packages/babel-plugin-transform-es2015-object-super/package.json
#	packages/babel-plugin-transform-es2015-parameters/package.json
#	packages/babel-plugin-transform-es2015-shorthand-properties/package.json
#	packages/babel-plugin-transform-es2015-sticky-regex/package.json
#	packages/babel-plugin-transform-es2015-unicode-regex/package.json
#	packages/babel-plugin-transform-es5-property-mutators/package.json
#	packages/babel-plugin-transform-exponentiation-operator/package.json
#	packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/opaque-type-alias/expected.js
#	packages/babel-plugin-transform-object-rest-spread/package.json
#	packages/babel-plugin-transform-object-rest-spread/src/index.js
#	packages/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/nested-2/expected.js
#	packages/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/nested/expected.js
#	packages/babel-plugin-transform-proto-to-assign/package.json
#	packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/regression-node-type-export-default/expected.js
#	packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/regression-node-type-export/expected.js
#	packages/babel-plugin-transform-react-display-name/package.json
#	packages/babel-plugin-transform-react-display-name/src/index.js
#	packages/babel-plugin-transform-react-display-name/test/fixtures/display-name/assignment-expression/expected.js
#	packages/babel-plugin-transform-react-display-name/test/fixtures/display-name/nested/expected.js
#	packages/babel-plugin-transform-react-display-name/test/fixtures/display-name/object-property/expected.js
#	packages/babel-plugin-transform-react-display-name/test/fixtures/display-name/variable-declarator/expected.js
#	packages/babel-plugin-transform-react-jsx-compat/package.json
#	packages/babel-plugin-transform-react-jsx/package.json
#	packages/babel-plugin-transform-regenerator/package.json
#	packages/babel-plugin-transform-regenerator/test/fixtures/regression/6733/expected.js
#	packages/babel-plugin-transform-regenerator/test/fixtures/regression/T7041/expected.js
#	packages/babel-plugin-transform-regenerator/test/fixtures/variable-renaming/retain-lines/expected.js
#	packages/babel-plugin-transform-runtime/README.md
#	packages/babel-plugin-transform-runtime/test/fixtures/runtime/custom-runtime/expected.js
#	packages/babel-plugin-transform-runtime/test/fixtures/runtime/full/expected.js
#	packages/babel-plugin-transform-runtime/test/fixtures/runtime/regenerator-runtime/expected.js
#	packages/babel-plugin-transform-strict-mode/package.json
#	packages/babel-polyfill/package.json
#	packages/babel-preset-es2015/package.json
#	packages/babel-preset-es2016/package.json
#	packages/babel-preset-es2017/package.json
#	packages/babel-preset-latest/package.json
#	packages/babel-preset-react/package.json
#	packages/babel-preset-stage-0/package.json
#	packages/babel-preset-stage-1/package.json
#	packages/babel-preset-stage-2/package.json
#	packages/babel-preset-stage-3/package.json
#	packages/babel-register/README.md
#	packages/babel-register/package.json
#	packages/babel-runtime/package.json
#	packages/babel-template/package.json
#	packages/babel-traverse/package.json
#	packages/babel-traverse/src/scope/lib/renamer.js
#	packages/babel-traverse/test/evaluation.js
#	packages/babel-traverse/test/replacement.js
#	packages/babel-types/README.md
#	packages/babel-types/package.json
#	packages/babel-types/src/converters.js
#	packages/babel-types/src/definitions/core.js
#	packages/babel-types/src/definitions/es2015.js
#	packages/babel-types/src/definitions/flow.js
#	packages/babel-types/test/converters.js
#	packages/babel-types/test/validators.js
#	scripts/generate-interfaces.js
#	yarn.lock
2017-08-31 17:44:17 +02:00
Artem Yavorsky
22ff8be4a7 Bump browserslist to 2.4. (#406) 2017-08-31 07:57:31 -05:00
Henry Zhu
39bd9b58e1 update to alpha.20 (#405) 2017-08-30 16:04:33 -04:00
Henry Zhu
b82b65a31e v7.0.0-alpha.20 2017-08-30 15:02:49 -04:00
Cory Simmons
5196b94fa5 Add Node usage (#398) [skip ci]
I can never remember the syntax and end up coming here to copy/paste this snippet all the time.

I assume other people want to as well, or at least make it clear for newbs that this can be used with Node without them having to scroll.
2017-08-30 00:25:10 -04:00
Justin Ridgewell
5e7fce3fe0 Update babylon (#6172) 2017-08-30 00:19:36 -04:00
Brandon Max
84580cc2d1 Refactor es2015-loose and es2015-no-commonjs presets to use preset op… (#6168) 2017-08-30 00:02:54 -04:00
Brian Ng
0beaf4d54e Merge pull request #705 from babel/flow-declare-var-primitive
Add allowPrimitiveOverride option to flowParseTypeAnnotatableIdentifier
2017-08-29 21:19:20 -05:00
Noah Lemen
d70603ffa9 re-add template literals tests, add ones that were missing (#6169) 2017-08-29 21:06:05 -04:00
Logan Smyth
d79a7920a1 Merge pull request #5586 from loganfsmyth/config-dependency-cycles
Handle cycles of plugins compiling themselves and .babelrc.js files loading themselves
2017-08-29 15:11:51 -07:00
Logan Smyth
2846e06db1 Add dependency cycle handing for plugins and config files. 2017-08-29 14:57:34 -07:00
Logan Smyth
beff7809ea Add debug() calls for config loading. 2017-08-29 14:57:33 -07:00
Henry Zhu
0a4f1b0a6e update babylon beta.22 (#6167) 2017-08-29 17:53:29 -04:00
Brian Ng
55f38933bf Add allowPrimitiveOverride option to flowParseTypeAnnotatableIdentifier 2017-08-29 14:11:50 -05:00
Henry Zhu
3f1dbecd2e 7.0.0-beta.22 2017-08-28 18:06:39 -04:00
Henry Zhu
cde42329ac Merge pull request #658 from babel/expect
Syntax Error: add message with the plugin that should be enabled
2017-08-28 15:44:26 -06:00
Daniel Tschinder
19c099d116 Use expectPlugin 2017-08-28 17:31:58 -04:00
Daniel Tschinder
96bd271495 Fix tests 2017-08-28 17:31:58 -04:00
Daniel Tschinder
aec1bdb359 Enable no-case-declarations to prevent bugs and remove if (true) 2017-08-28 17:31:58 -04:00
Daniel Tschinder
dfb279f478 Add test for function. 2017-08-28 17:30:10 -04:00
Henry Zhu
de47b0423f rename folders, add more 2017-08-28 17:30:10 -04:00
Henry Zhu
2dbba25d1a change some things to expectPlugin 2017-08-28 17:30:10 -04:00
Moti Zilberman
cf3ebacf4f add expectPlugin which throws an error with the missing plugin 2017-08-28 17:30:09 -04:00
Buu Nguyen
75861fac87 Fix bug replacement nodes not requeued (#5743) 2017-08-28 15:10:00 -06:00
Brian Ng
2f76fc88be Fix regression with generic type and jsx (#702) 2017-08-28 14:51:37 -06:00
Artem Yavorsky
b2b3d7944a Spec compatibility for iteratorClose condition. (#6094)
* for-of: IteratorClose spec compatibility.

See #3:
https://tc39.github.io/ecma262/#sec-iteratorclose

* Update spec fixtures for for-of.

* Fix IteratorClose case for remap-async-to-generator.

* Fix IteratorClose case for async-generator-function test output.

* Modify few tests according to iteratorClose fix.

* Fix iteratorClose for helpers.slicedToArray also.

* Update iteratorClose fixture for commonjs.
2017-08-28 13:39:02 -06:00
Henry Zhu
827d84536a Merge pull request #6156 from jridgewell/pr/5502
Fix overshadowing local binding
2017-08-28 13:38:21 -06:00
Justin Ridgewell
3e487f89ab Don't merge test options. (#6157)
* Don't merge test options.

Particularly, I don't want `lodash/merge` to merge my specific plugins
with the general test plugins. It led to odd behavior where I could
enable a loose transform in my specific test, just to have it overridden
by the test fixture's general options.

* Need options
2017-08-28 13:36:03 -06:00
Noah Lemen
40805894c5 default to spec mode for template literal transform (#6098)
* spec/loose/default switch for template literal transform, update/re-org tests

* update readme

* flip if statements

* consolidate else/if

* readme wording modification, updates to examples
2017-08-28 12:57:09 -06:00
Henry Zhu
95dd16aeeb Merge pull request #6159 from jridgewell/pr/3701
Allow native Symbols as computed property names
2017-08-28 12:50:10 -06:00
Justin Ridgewell
ac6eda2709 Class instance properties define their own context (#6158) 2017-08-28 12:47:17 -06:00
Karl Cheng
19bc694e7d Rename PrivateName.name to .id (#698)
Given that it refers to an identifier, it's somewhat confusing to have
to use .name.name to get the actual string. The type declared within
types.js is also incorrect, which this commit fixes.
2017-08-28 13:47:37 -04:00
Artem Yavorsky
7af44fce75 Merge pull request #401 from yuzhakovvv/feature/add-types-to-npmignore
Add `lib/types.js` to .npmignore
2017-08-27 15:14:19 +03:00
Oliver Don
960151c876 Fix #4840: Alias class prototype for methods in loose mode (#5560)
* Fix #4840: Alias class prototype for methods in loose mode

* Cleanup
2017-08-26 21:15:45 -04:00
Henry Zhu
6d24416645 7.0.0-beta.21 2017-08-26 12:05:26 -06:00
James Henry
acf0e65090 Apply location data fix to decorators plugin (#699) 2017-08-26 11:38:11 -04:00
Brian Ng
8f2f250144 Merge pull request #696 from babel/obj-rest-not-last
Throw if rest element is not in last position for object expressions
2017-08-26 09:57:51 -05:00
Brian Ng
2fa1f9929f Throw if rest element is not in last position for object expressions 2017-08-26 09:34:33 -05:00
Brian Ng
083a44658c Enable optionalCatchBinding plugin for test262 tests (#697) 2017-08-26 12:14:56 +02:00
Justin Ridgewell
7795750862 Tests 2017-08-25 22:52:17 -04:00
Adam Miller
2d8fdf3045 Allow native Symbols as computed property names (#6705)
The for-in loop in helpers.defineEnumerableProperties doesn't iterate over Symbols.
If Object.getOwnPropertySymbols exists, include the discovered values when defining properties.
2017-08-25 22:33:51 -04:00
Brian Ng
6ba38a2a78 Merge pull request #693 from babel/trailing-comma-rest-param
Raise error if trailing comma after rest element in async func params
2017-08-25 20:12:59 -05:00
Brian Ng
a659ac6bda Merge pull request #695 from babel/issue691
Fix TypeScript TypeParameterDeclaration location start values
2017-08-25 20:12:47 -05:00
Justin Ridgewell
a70cda812c Remove old test 2017-08-25 19:52:15 -04:00
Justin Ridgewell
4b297907d1 Move fix into #checkBlockScopedCollisions 2017-08-25 19:23:11 -04:00
Moti Zilberman
48c114169f Move up check for binding kind "local"
This puts the check before the call to `checkBlockScopedCollisions`.
Fixes #4946.
2017-08-25 19:21:38 -04:00
Moti Zilberman
68786c4f0f Add test for issue #4946 2017-08-25 19:21:38 -04:00
Moti Zilberman
1ef5871300 Add tests for #5491 and related cases
The two function expression tests would fail before 6705de7. The
function declaration test was not a failing case but is added here for
completeness.
2017-08-25 19:21:38 -04:00
Moti Zilberman
c3e8715010 Mask existing "local" bindings when registering new binding
Fixes #5491.
2017-08-25 19:21:38 -04:00
Brian Ng
af2c974473 Fix TypeScript TypeParameterDeclaration location start values 2017-08-25 09:54:16 -05:00
James Henry
87b322cfc2 Add failing test case 2017-08-25 09:49:03 -05:00
Brian Ng
65db277364 Raise error if trailing comma after rest element in async func params 2017-08-24 21:59:01 -05:00
Brian Ng
c441afeaa6 Improve error message for comma after rest element in arrow func 2017-08-24 21:28:19 -05:00
Mauro Bringolf
d8b4073536 Consistent const violations (#6100)
* Changed updateExpression to report itself as violation instead of its argument

* Update getBindingIdentifiers to work with forXStatement and return proper node as violation

* Updated unaryExpression violation to be consistent with changes.
2017-08-24 21:19:02 -04:00
Brian Ng
27aae6c0f9 Merge pull request #686 from babel/invalid-label-declarations 2017-08-24 19:45:17 -05:00
Brian Ng
2bc124bf49 Fix some cases of keywords with escape sequences 2017-08-24 19:27:09 -05:00
Brian Ng
5e60ad6688 Fix some cases of invalid labeled declarations 2017-08-24 19:00:52 -05:00
Mateusz Burzyński
5d83e2692f Adjusted Object Rest/Spread syntax handling to the latest spec (#670) 2017-08-24 18:31:50 -05:00
Mateusz Burzyński
5df1139567 Test262 update (#692) 2017-08-24 17:42:04 -05:00
Mateusz Burzyński
3c4f19a28d Adjusted Object Rest/Spread tests to use only allowed syntax from the latest spec (#6102) 2017-08-24 15:50:43 -04:00
Noah Lemen
2db0c3ad1d linting: disallow t.identifier("undefined") in plugins (#6096)
* add new custom eslint rule, replace remaining t.identifier("undefined") with buildUndefinedNode(), update tests

* change no-undefined-identifier reporting descriptor
2017-08-24 15:43:01 -04:00
Sven SAULEAU
f0e49dceb5 Merge pull request #400 from devdevil666/feature/license
Change license year
2017-08-24 09:20:18 +02:00
Nikita Yuzhakov
93ebb58e28 Add 'lib/types.js' to .npmignore 2017-08-23 19:08:23 +03:00
Evgeniy
0507c067f4 Change license 2017-08-23 18:48:21 +03:00
Nicolò Ribaudo
4577bd1b7c TypeParameterInstantiation params can be "Flow" nodes, not "FlowType" (#6140) 2017-08-22 23:11:02 -04:00
Daniel Lo Nigro
93cf26abca Fix babel-standalone for realz (#6137)
* Fix babel-standalone

* Fix infinite loop in Makefile (oops)

* Override Node.js module resolution to handle babel-core
2017-08-22 13:46:30 -07:00
Brian Ng
be0fe1c6b6 Update rollup config options (#685) 2017-08-22 15:59:05 -04:00
Astha Sharma
62c22c7b5d Removed the deprecated jsx pragma detection code (#6145)
* Removed the deprecated jsx pragma detection code and the concerned tests that included jsx-pragma

* Removed extra tests

* Restored packages/babel-plugin-transform-react-jsx/test/fixtures/react/honor-custom-jsx-pragma-option/
2017-08-22 15:29:06 -04:00
Bryan Wain
63baaa7148 add --config-file option to CLI to pass in .babelrc location (#6133) 2017-08-22 13:58:24 -04:00
Sangboak Lee
d83064a82e add test for do expressions (#688) 2017-08-22 08:48:56 -05:00
Justin Ridgewell
7e726a81e6 Complete export transform split (#6139)
They were each transforming the other's syntax (including namespace
transform would transform default, too, and vice-versa).
2017-08-21 14:15:40 -04:00
Ramiro Silveyra d'Avila
9e4e64dac9 Remove Flow support in React preset (#6118) 2017-08-21 10:48:18 -04:00
Daniel Lo Nigro
3569cb9922 Allow nightly Yarn builds to be used (#6138)
* Allow nightly Yarn builds to be used

Fixes:
```
C:\src\babel (fix-it-fix-it-fix-it-fix-it) (babel)
λ yarn
yarn install v1.0.0-20170811.1240
[1/5] Validating package.json...
error babel@: The engine "yarn" is incompatible with this module. Expected version ">=0.27.5".
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
```

* Use Yarn 0.28.4 to fix build
2017-08-20 16:19:17 -07:00
James Henry
d0c7d7a8c7 Fix: Use parseExprAtom() for TS module id string (#684) 2017-08-20 10:38:55 -05:00
greenkeeper[bot]
d685b3999c Update rollup to the latest version 🚀 (#682) 2017-08-20 10:27:15 -05:00
Nicolò Ribaudo
79d6bad5c2 Disallow failures in the flow-test JOB 🎉 2017-08-19 23:13:47 +02:00
Nicolò Ribaudo
748b6fc477 Add option to update the whitelist 2017-08-19 22:18:10 +02:00
Nicolò Ribaudo
656815a53a Add whitelist to flow tests 2017-08-19 22:02:27 +02:00
Nicolò Ribaudo
942d22dd70 Remove the get_harcoded_tests function, use get_tests 2017-08-19 18:25:18 +02:00
Nicolò Ribaudo
1a9b340cb9 Use a Map instead of an Obejct to store tests
This change has two reasons:
- The object was actually used as a map
- Using an object leads some problems with the
  private_class_fields/constructor.js test, since
  `tests[test_name] || {}` returned the Obejct
  constructor instead of an empty object.
2017-08-19 18:24:21 +02:00
Henry Zhu
f87b81a8b1 7.0.0-beta.20 2017-08-19 10:36:28 -04:00
Sangboak Lee
c6a094a9d2 Split export extensions into 2 different plugins, update stage presets (#6080) 2017-08-19 09:35:40 -04:00
Daniel Tschinder
559e333557 Remove babel-cli as unused (#679) 2017-08-19 07:34:06 -04:00
Daniel Tschinder
9c2b5e6b1f Update dependencies and add babel-core as dependency
it is requried by rollup-plugin-babel
2017-08-19 12:08:46 +02:00
[mediba] Satoshi Takeda
879bd8f850 Fix README. rename Babili to babel-minify [skip ci] (#397) 2017-08-17 21:02:56 -05:00
laoxiong
a8021fafc4 chore: add comment for whitespace char code (#676) 2017-08-16 21:51:56 +02:00
Henry Zhu
cee4cde53e v6.26.0 2017-08-16 11:54:08 -04:00
Henry Zhu
aa330999d0 update changelog 2017-08-16 11:39:05 -04:00
Henry Zhu
5749276d7e update deps 2017-08-16 10:21:19 -04:00
Henry Zhu
7b30f77954 Merge pull request #6111 from modosc/update-regenerator
Update regenerator
2017-08-16 10:17:59 -04:00
Anup
6ab3b4c0e3 Add 'configurable' property to class fields (#6123) 2017-08-16 10:12:38 -04:00
Henry Zhu
70ab2e0620 Merge pull request #6113 from Andarist/fix/regenerator-fixtures
Fix/regenerator fixtures
2017-08-16 10:11:24 -04:00
Sven SAULEAU
0d16499fc0 Merge pull request #6124 from uxter/patch-1
Update README.md
2017-08-16 15:30:51 +02:00
Sven SAULEAU
77bbe20352 fix: [skip ci] split babel config 2017-08-16 15:30:16 +02:00
Vasiliy Shilov
bd569433c4 Update README.md: A semicolon is required after a class property. 2017-08-16 16:18:39 +03:00
greenkeeper[bot]
dfec243fba Update flow-bin to the latest version 🚀 (#675)
* chore(package): update flow-bin to version 0.53.0

* chore(package): update lockfile

https://npm.im/greenkeeper-lockfile
2017-08-16 13:33:41 +02:00
Mateusz Burzyński
fffa604023 Fixed regenerator related fixtures 2017-08-16 10:02:33 +02:00
Ben Newman
e08ff8e650 Update regenerator-runtime to version 0.11.0. 2017-08-16 10:02:33 +02:00
Ben Newman
b660f61b92 Update regenerator-transform to version 0.10.0. 2017-08-16 10:02:33 +02:00
Sven SAULEAU
5fb282f73f Merge pull request #6121 from maurobringolf/babel-website-link
Update babel/website link
2017-08-16 08:56:09 +02:00
Mauro Bringolf
7cc5580c71 Update babel/website link 2017-08-16 08:41:48 +02:00
Brian Ng
2eaff3d01c Fix rest-member-expression-optimisation fixture (#6116) 2017-08-15 21:34:09 -04:00
Piotr Kowalski
b684699f79 Typo in name of most famous language [skip ci] 2017-08-15 19:35:41 -05:00
jbrown215
f4716dc816 Backport #6031 (#6112)
* Backport #6031

* Backport #6031

* Rebase on master, rerun scripts

* Update flowconfig
2017-08-15 17:42:01 -04:00
Henry Zhu
d375d80001 6.26.0 changelog [skip ci] 2017-08-15 17:06:16 -04:00
Henry Zhu
98824e7cb7 backport the fix #6052 [skip ci] 2017-08-15 17:01:25 -04:00
jbrown215
c28465e03e Flow opaque type 6.x backport (#6081)
* Flow opaque type backport

* Add tests for strip types, comments, and babel-generator

* Fix failing tests, run scripts

* Bump babylon to 6.18.0
2017-08-15 16:44:15 -04:00
greenkeeper[bot]
3a5690ab1c Update ava to the latest version 🚀 (#672)
* chore(package): update ava to version 0.22.0

* chore(package): update lockfile

https://npm.im/greenkeeper-lockfile
2017-08-15 12:55:56 +02:00
Justin Ridgewell
4ca686b7be Fix relative execution location introspection (#5741)
So, I was reading the new Flow type strictness and noticed
https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/
Specifically, I wondered whether the `sum_all` example would copy the
arguments into an array, then loop over. Sadly, it does.

```js
function sum_all(...rest) {
  let ret = 0;
  for (let i = 0; i < rest.length; i++) { ret += rest[i]; }
  return ret;
}

// output
function sum_all() {
  var ret = 0;
  for (var _len = arguments.length, rest = Array(_len), _key = 0; _key < _len; _key++) {
    rest[_key] = arguments[_key];
  }
  for (var i = 0; i < rest.length; i++) { ret += rest[i]; }
  return ret;
}
```

But then I noticed if I changed `let i = 0` to `let i: number = 0`, it
worked directly on `arguments`. That lead me down a rabbit hole to
`Path#_guessExecutionStatusRelativeTo`. When tracing through, the last
comparison made no sense to me. It was trying to find the index of
`"init"` in a list of `["declarations"]` and `"body"` in `["directives",
"body"]`. Red flags and such.

But it makes sense when you're trying to compare the visitor order of
the common ancestor path. Then we're trying to find `"init"` in a list
of `["init", "test", "update", "body"]`. Oh, and there's `"body"` in
there too! And now we know the `ForStatement`'s `init` is executed
before the `body`.
2017-08-14 22:22:18 -04:00
Nicolò Ribaudo
b84f8e9234 Don't use _possibleConstructorReturn inside arrow functions (#6103)
Arrow functions can't be entrly skipped while traversing because this
references inside of them needs to be transformed, so I added a check
which prevents return statements inside arrow functions from being
saved for the transformation.

Fixes #5817 (regression)
2017-08-14 11:11:05 -04:00
Brian Ng
9e51038ad9 Fix class prop test fixture (#6090) 2017-08-14 09:20:36 -05:00
Justin Ridgewell
bab28d68f6 Merge pull request #669 from babel/greenkeeper/rollup-0.47.0
Update rollup to the latest version 🚀
2017-08-13 20:33:09 -04:00
Henry Zhu
777a8e2bb4 add more links [skip ci] 2017-08-12 22:04:55 -04:00
Henry Zhu
ad1f87cf07 add new yarn version requirement [skip ci] 2017-08-12 22:00:25 -04:00
Matthias Kern
bd915ad8dc Rename Babili to Babel-Minify (#392) 2017-08-12 12:55:37 -05:00
Daniel Lo Nigro
a04c18af71 Move babel-standalone into main Babel repo (#6029)
* Move babel-standalone into main Babel repo

* Don't try to gather coverage data for babel-standalone test

* Fix JSX test

* Always use npm v4 on Travis

* Include pull request number as part of version number

* Cherry-picking 5721b2e43e

Remove deprecated packages to prevent Babel v6 files from being pulled in

* Use RootMostResolvePlugin to dedupe packages

* Avoid destructuring so the build works on archaic Node.js versions

* - Fix version number
- Remove Babili packages (they should be in separate babili-standalone)
- Remove deprecated  syntax-class-constructor-call

* - Remove more Babili packages
- Remove `babel-plugin-inline-replace-variables` for now as it pulls in Babel 6 stuff

* Actually remove reference to babel-plugin-undeclared-variables-check

* Add Babylon to root package.json so we hoist the right version. This fixes the tests.
2017-08-11 23:36:19 -07:00
Diogo Franco
0538c3cd8c Add another test for runtime order of template literals (#6092)
More proof that it really is unsafe to merge the .concat calls if the
value is an expression that has any chance of executing impure code 😢
2017-08-12 14:11:27 +09:00
Diogo Franco (Kovensky)
cd66657f34 Update outdated test fixture 2017-08-12 14:10:19 +09:00
greenkeeper[bot]
e9aeffcb60 chore(package): update lockfile
https://npm.im/greenkeeper-lockfile
2017-08-12 03:23:30 +00:00
greenkeeper[bot]
10a3965772 chore(package): update rollup to version 0.47.0 2017-08-12 03:17:33 +00:00
greenkeeper[bot]
88cf1bc140 Update rollup to the latest version 🚀 (#668)
* chore(package): update rollup to version 0.46.0

* chore(package): update lockfile

https://npm.im/greenkeeper-lockfile
2017-08-11 10:56:38 -05:00
Andy
9243c78ea2 babel-plugin-transform-class-properties: Ignore type annotations when looking for name collisions (#6082) 2017-08-11 10:27:48 -05:00
Sangboak Lee
218f191a59 remove left transform-class-properties from stage (#6088) 2017-08-10 22:30:45 -04:00
Henry Zhu
3154c2c114 pr template [skip ci] (#6086) 2017-08-10 16:35:32 -04:00
Noah Lemen
4fdd75695b Update Class Fields to Stage 3 and change default behavior (#6076)
* add transform-class-properties to stage 3, set spec mode to default

* update readme with examples; use `buildUndefinedNode()`; change behavior to always define both static and nonstatic class properties regardless of spec/loose mode; update tests
2017-08-10 11:19:49 -04:00
Rick Waldron
9c91e35ce4 Add numeric separator to stage 2 preset (#6071) 2017-08-10 11:05:35 -04:00
Karl Cheng
3a55e1326c Allow substrings for TEST_ONLY in make (#6079)
This allows TEST_ONLY to match substrings of the package directory name
instead of having to use the full package directory name.
2017-08-10 10:55:46 -04:00
Brian Ng
370559c62f Replace decache with direct removal in babel-register tests (#6085) 2017-08-10 10:52:27 -04:00
Andy
a74b307752 babel-types: Add missing field, fix incorrect definitions (#6083)
* babel-types: Add missing field, fix incorrect definitions

* Regenerate babel-types readme
2017-08-09 16:56:19 -04:00
Mateusz Burzyński
b41fe4efb1 [docs] Added clarification note about transform-react-inline-elements usage … (#6078)
* Added clarification note about transform-react-inline-elements usage with transform-runtime [skip ci]

* small tweaks [skip ci]
2017-08-09 08:45:02 -05:00
Andy
a39ea5dc9d Fix indentation in typescript.js (#665) [skip ci] 2017-08-08 22:44:20 -04:00
Andy
d565eca976 Don't enable class properties just because "typescript" plugin is enabled (#666) 2017-08-08 20:51:57 -05:00
Andy
68d2f8d161 Add "classProperties" plugin to babel-generator typescript tests (#6074) 2017-08-08 17:38:39 -04:00
Andy
1c1ce5a9e4 Move parser plugin from babel-preset-typescript to babel-plugin-syntax-typescript (#6070) 2017-08-08 16:01:14 -05:00
Andy
00ad6d8310 Fix conflict between "typescript" and "exportExtensions" plugins (#664)
* Fix conflict between "typescript" and "exportExtensions" plugins

* `==` -> `===`
2017-08-08 22:30:08 +02:00
Boopathi Rajaa
ab76cb6b53 Fix scope of catch block (#5980)
* Fix scope of catch block

* Throw error on Duplicate variable declaration

* Update test
2017-08-08 16:26:29 -04:00
Henry Zhu
009d7f0b76 Yarn engines (#6064) 2017-08-07 21:54:33 -05:00
Brian Ng
48a4675fed Merge branch 'master' into 2.0 2017-08-07 20:15:57 -05:00
Henry Zhu
f667f07d82 update to alpha.18 (#6062) 2017-08-07 21:15:20 -04:00
Henry Zhu
dbd65d93bb 2.0.0-alpha.19 2017-08-07 20:54:44 -04:00
Henry Zhu
75f11cfec9 alpha.19 (#389) 2017-08-07 20:54:23 -04:00
Henry Zhu
94f54da30b lockfile [skip ci] 2017-08-07 20:01:33 -04:00
Henry Zhu
d85c642617 revert lerna-changelog change [skip ci] 2017-08-07 19:42:12 -04:00
Henry Zhu
79f4956948 v7.0.0-alpha.19 2017-08-07 18:21:08 -04:00
Henry Zhu
41debcd286 rollup-plugin-babel v3.0.1 2017-08-07 17:36:42 -04:00
greenkeeper[bot]
77aa094122 chore(package): update rollup-plugin-babel to version 3.0.1 (#662) 2017-08-07 17:36:03 -04:00
Henry Zhu
7f92e1d9dd Update gulp, fix build (#6061)
* gulp-babel 7.0
2017-08-07 17:09:22 -04:00
Andy
e37a5eb5eb Add babel-plugin-syntax-typescript, babel-plugin-transform-typescript, and babel-preset-typescript (#5899)
* Add babel-plugin-syntax-typescript and babel-plugin-transform-typescript

* Add babel-preset-typescript

* Remove unnecessary handler for JSXOpeningElement

* Use `t.isFoo(node)` instead of `node.type === "Foo"`

* Clean up parameter property assignment generation

* Don't use function for `isSuperCall`

* slice -> shift

* Calculate sourceFileHasJsx only if necessary

* Remove `export =` support

* remove some syntax readme newlines [skip ci]
2017-08-07 11:45:52 -04:00
jugglinmike
0466504d7b Integrate Test262 (#654)
* Integrate Test262

Introduce a GNU Make target for retrieving TC-39's Test262 suite and
validating parsing of the files it contains. Interpret each file as a
parser test in accordance with that project's `INTERPRETING.md`
document. Allow for the specification of allowed failures via a
"whitelist" file so that the test suite may help prevent regressions in
this project in situations where this project has known bugs. Initialize
the "whitelist" file with a listing of all tests that are currently
failing. Extend the continuous integration environment's configuration
to automatically run these tests.

* use graceful-fs and latest yarn on travis
2017-08-06 21:20:25 -04:00
Henry Zhu
66ec5263a4 Use Yarn Workspaces (#6056)
* update lerna and lerna-changelog

* Lerna: enable yarn, yarn workspaces [skip ci]

* use older version of Babel since it matches on semver (cannot be the same version)

* install yarn version

* revert node engine change

* update flow

* circle ci on 8

* update lock
2017-08-05 14:48:15 -04:00
Teddy Katz
13d931c417 Don't insert the same node into the AST multiple times (fixes babel/babili#556) (#6054) 2017-08-04 19:00:29 -04:00
Henry Zhu
47a9ba3440 Merge pull request #6051 from babel/5709-2
Rewrite parameter transform and drop _blockHoist reliance
2017-08-04 18:55:23 -04:00
Daniel Tschinder
fb6d0491f6 Upgrade dependencies 2017-08-05 00:37:55 +02:00
Nicolò Ribaudo
7353a38846 Arrow fns can't be used as the left side of a binary or ternary expression (#559)
* Arrow fns can't be used as the left side of a binary or ternary expression

Fixes #536

* Add test for logical expression with arrow function

* Fix eslint
2017-08-05 00:27:11 +02:00
Henry Zhu
a1debae8f0 babylon beta.19 (#6053) 2017-08-04 14:46:12 -04:00
Henry Zhu
5c867240f7 7.0.0-beta.19 2017-08-04 12:44:51 -04:00
Henry Zhu
9c91e75cb3 yarn.lock 2017-08-04 12:38:08 -04:00
Henry Zhu
579aabf23e alpha.18 (#660) 2017-08-04 12:34:17 -04:00
Henry Zhu
30c4d6b456 Merge pull request #6052 from babel/array-destructuring-hole
Array destructuring hole
2017-08-04 12:20:50 -04:00
Henry Zhu
0e58007264 add test for spread with hole 2017-08-04 12:06:26 -04:00
Henry Zhu
577173cc02 fix export when array destructuring exported value with hole 2017-08-04 11:53:49 -04:00
Henry Zhu
8c457e9283 Merge pull request #5468 from babel/react-preset
Add requireDirective to strip-flow-types for use in React preset
2017-08-04 11:31:12 -04:00
Brian Ng
2a83867436 Fixes from review 2017-08-04 10:16:45 -05:00
Naveen jain
0c11af8fc5 Fix #656 (#659)
* Fix #656

* Fix #656
2017-08-04 11:54:03 +02:00
Brian Ng
9dd65c809f fixes 2017-08-03 22:27:30 -05:00
Brian Ng
af5f34ace5 Throw if annotation found without directive 2017-08-03 21:54:36 -05:00
Brian Ng
57da9bdbed Add requireDirective to strip-flow-types for use in React preset 2017-08-03 21:13:45 -05:00
Logan Smyth
d86ae2fb84 Remove _blockHoist usage from param processing. 2017-08-03 20:56:50 -05:00
Logan Smyth
18084db7cf Fix an ordering bug in object-rest-spread. 2017-08-03 20:56:24 -05:00
Logan Smyth
8e19a5b057 Update param scope values when expanding parameters. 2017-08-03 20:56:24 -05:00
Logan Smyth
95882d4e5a Rewrite param processing to be more clearly defined. 2017-08-03 20:56:08 -05:00
Henry Zhu
99ab2b206c update to alpha.18 (#6050) 2017-08-03 20:40:53 -04:00
Henry Zhu
77cfa94682 yarn: fix ci? 2017-08-03 20:02:31 -04:00
Henry Zhu
78157ebabd 2.0.0-alpha.18 2017-08-03 18:30:13 -04:00
Henry Zhu
e5fd7407c9 update to alpha.18 (#386) 2017-08-03 18:28:47 -04:00
Henry Zhu
79c6814d65 v7.0.0-alpha.18 2017-08-03 18:20:36 -04:00
Henry Zhu
d479673074 prepublish [skip ci] 2017-08-03 18:18:36 -04:00
Nicolò Ribaudo
eee1a3854e Alow regex after "of" in for(...of...) (#579)
Fixes #456
2017-08-03 09:11:31 -05:00
Henry Zhu
6630ae9794 Merge pull request #6046 from jridgewell/pr/6038
Fix invalid block-scoped loop
2017-08-03 08:51:25 -04:00
greenkeeper[bot]
880fa582c3 Update flow-bin to the latest version 🚀 (#657)
* chore(package): update flow-bin to version 0.52.0

* chore(package): update lockfile

https://npm.im/greenkeeper-lockfile
2017-08-03 11:02:29 +02:00
Justin Ridgewell
6bb1486405 Fix 2017-08-02 19:47:14 -04:00
Sarup Banskota
75808a2d14 Prevent getFunctionParent from returning Program (#5923) 2017-08-02 16:30:33 -05:00
jbrown215
4e9a25e34a Flow opaque type aliases (#5990) 2017-08-02 16:30:19 -05:00
Henry Zhu
0f823beeb1 Newlines in fixtures (#6044)
* write newlines for fixtures

* rerun fixtures
2017-08-02 15:35:29 -04:00
Sergey Rubanov
829c75a866 Development Only: drop Node 4-5 and npm 2 (#6037) [skip ci]
Node versions 4 and 5 are obsolete. Version of npm bundled in Node 6 is 3 so npm 2 could be dropped as well.
2017-08-02 14:30:13 -04:00
Henry Zhu
9d7c82d869 Adding failing test for 6025 2017-08-01 16:16:47 -04:00
Brian Ng
21eeed8a8c Fix generate interfaces script (#6031)
* Fix typo in TSPropertySignature type definition

* Sort fields in generate-interfaces script
2017-08-01 14:38:46 -04:00
Brian Ng
889f4e7791 Fix refs in transform-optional-chaining docs [skip ci] (#6035) 2017-08-01 14:30:16 -04:00
Artem Yavorsky
f7a096b08e Add browserslist config/package.json section support. (#161) 2017-08-01 10:50:44 -05:00
Artem Yavorsky
1dd3d14a2f Export default for available plugins 2017-08-01 09:38:48 -05:00
Artem Yavorsky
bba7be20d2 Add available plugins into separate module 2017-08-01 09:38:48 -05:00
Brian Ng
c5e81516dd Add optional catch binding to stage 3 preset (#6032) 2017-07-31 16:00:43 -04:00
Brian Ng
6d965c0926 Make babel-node a standalone package (#6023)
* Make babel-node a standalone package

* New package `babel-node` previously `babel-cli/bin/babel-node`

* updates
2017-07-29 22:26:28 -04:00
Jimmy Jia
2dba910b9e Merge branch '6.x' 2017-07-29 12:20:18 -04:00
Andy
e32042f353 babel-generator: Comment TypeScript-specific code (#6026) 2017-07-28 18:03:38 -04:00
Andy
c1d07fd6db babel-generator: Add TypeScript support (#5896)
* babel-generator: Add TypeScript support

* Remove type declarations; not published from babylon

* Remove TODOs

* Consistently use `this.word` for tokens that are words
2017-07-28 16:07:05 -04:00
Henry Zhu
f83c83d49c add proposals repo [skip ci] (#6024) 2017-07-28 15:31:47 -04:00
chocolateboy
605adc922d allow PluginPass.file.addImport to create empty import statements (#6022)
* allow PluginPass.file.addImport to create empty import statements; fixes #6021

omitting addImport's second argument creates an import statement with an
empty `specifiers` array i.e. an empty import statement:

plugin:

    Program (path, { file }) {
        file.addImport('foo-bar/register')
    }

output:

    import "foo-bar/register";
2017-07-28 12:37:00 -04:00
Justin Ridgewell
6821cfb064 Merge pull request #648 from Qantas94Heavy/private-field-no-shorthand
Remove private field shorthand
2017-07-27 14:56:19 -04:00
Henry Zhu
593cbc1d53 Function sent (#6020)
* change back to function-sent

* update stage 2
2017-07-26 18:01:40 -04:00
Noah Lemen
5c45753cd6 add TEST_GREP example clarification [skip ci] (#6013) 2017-07-26 17:53:46 -04:00
Andy
1563221171 babel-types: Have NewExpression inherit from CallExpression (#6019) 2017-07-26 17:53:23 -04:00
Henry Zhu
c8d2361897 2.0.0-alpha.17 2017-07-26 16:24:59 -04:00
Henry Zhu
c92846d623 alpha.17 2017-07-26 16:24:36 -04:00
Andy
b242e0d946 babel-generator: Make plugins list explicit for test cases (#6018) 2017-07-26 15:46:47 -04:00
Henry Zhu
9322fd0458 v7.0.0-alpha.17 2017-07-26 08:38:44 -04:00
Henry Zhu
f01438e9b1 update devdeps to latest, update babylon (#6012)
* temporary flow strip measure
2017-07-26 07:57:49 -04:00
Henry Zhu
0bc9d78927 7.0.0-beta.18 2017-07-25 18:23:45 -04:00
Henry Zhu
a3128619ff update (#649) 2017-07-25 18:22:07 -04:00
Henry Zhu
9f8de8f542 2.0.0-alpha.16 2017-07-25 18:04:18 -04:00
Henry Zhu
18afff2f85 update (#383) 2017-07-25 18:03:45 -04:00
Henry Zhu
ce5d1d0f59 why 2017-07-25 17:47:59 -04:00
Henry Zhu
7f1cd44d60 v7.0.0-alpha.16 2017-07-25 17:35:35 -04:00
Henry Zhu
2841945095 temporarily rename function-sent pkg to 2 (#6011) [skip ci]
* update readme [skip ci]

* rename to sent2 until we get the package [skip ci]
2017-07-25 17:30:31 -04:00
Henry Zhu
76060bb2c7 commit yarn.lock 2017-07-25 17:10:10 -04:00
Henry Zhu
84dfa659e7 update to alpha.15 (#6009) 2017-07-25 17:08:15 -04:00
Samuel Reed
e0b4543601 feature: Support whitelisting mutable props for react-constant-elements (#5307) 2017-07-25 13:34:21 -05:00
Andy
248743e6c5 babel-types: Add TypeScript definitions (#5856)
* babel-types: Add TypeScript definitions

* Add missing builders

* Allow arrow function to have "generator"

* Replace link to resolved issue with comment

* Re-add 'generator' to functionCommon
2017-07-25 11:42:25 -04:00
Brian Ng
9a1b8ea443 Add support for flow predicates in babel-generator (#5984) 2017-07-25 11:38:17 -04:00
Brian Ng
55aea26f13 Add support for export type star in babel-generator (#5985)
* Add support for export type star in babel-generator

* Bump babylon
2017-07-25 11:37:27 -04:00
Nicolò Ribaudo
fb9a752262 Function sent (#5920)
* Create "babel-helper-wrap-function"

It contains the logic to wrap a function inside a call expression.
It was part of the "babel-helper-remap-async-to-generator" package, but
it is needed to transpile "function.sent"

* Create "babel-transform-function-sent"

It transforms the "function.sent" meta property by replacing it with
"yield" and making the generator ignore the first ".next()" call.

* "function.sent" is the last value passed to .next(), not the first one

* Disable exec tests on old node

* Fix flow error

* Add "transform-function-sent" to "stage-2" preset

* Do every trasformation in one traversal

* Test for "yield function.sent"

* [skip ci]

* Fix some typos [skip ci]
2017-07-25 11:07:01 -04:00
Peeyush Kushwaha
4a35243118 Non string computed keys in object-rest-spread (#5757) 2017-07-25 09:46:52 -05:00
MarckK
9fc910d8c0 Add optionality to catch bindings (#5956) 2017-07-25 09:38:48 -05:00
Noah Lemen
51a293601b add JSXAttribute visitor function, wraps JSXElement attributes in a JSXExpressionContainer; also adds test fixtures (#6006) 2017-07-25 09:30:32 -04:00
Karl Cheng
42d5dbe544 Remove private field shorthand
There seems to be tentative agreement to remove the private field
shorthand given the added confusion and edge cases involved with the
shorthand.

Refs: https://github.com/tc39/proposal-class-fields/issues/21
2017-07-25 11:53:38 +10:00
Shuaibird Hwang
4d51052037 FIX access to the prototype of an instance (#6005)
The right way access to the prototype of an instance is using the `__proto__` rather than the `prototype`.
2017-07-24 21:46:38 -04:00
Artem Yavorsky
5fa460ff2a Merge pull request #380 from leggiero/patch-1
Fixed "node: current" example
2017-07-25 03:38:03 +03:00
Daniel Tschinder
19c4dd2d8c Update chai to 4.x (#6002) 2017-07-24 15:19:32 -04:00
Peeyush Kushwaha
2225892348 Use first binding for multiple var declarations (#5745)
* Use first binding for multiple var declarations
Since var declarations after initial binding have no effect, use the
first declaration. Fixes #2378

* Include hoisted function bindings

* Missing newline in expected.js

* Simplify constantViolations in new Binding on existing

* clarify comment language
2017-07-24 14:43:17 -04:00
Daniel Tschinder
677160385c Update chalk to 2.x (#6003) 2017-07-24 11:06:57 -04:00
Daniel Tschinder
9b04cbbc4f Update find-cache-dir to 1.0 (#5999) 2017-07-23 20:23:55 -04:00
Daniel Tschinder
4aca487b6d Update default-require-extensions to 2.0 (#6000) 2017-07-23 20:23:29 -04:00
Daniel Tschinder
5afe40b095 Update to-fast-properties to 2.0 (#5997) 2017-07-23 09:22:05 -04:00
Daniel Tschinder
b081f68e87 Update output-file-sync to 2.0 (#5996)
* Update output-file-sync to 2.0

* Ignore test tmp directory
2017-07-23 09:21:51 -04:00
Daniel Tschinder
c9ed159a18 Update jsesc to the latest version (#5995) 2017-07-23 09:21:22 -04:00
Daniel Tschinder
b9ed9919c1 Update globals to v10 (#5993) 2017-07-23 09:21:08 -04:00
Daniel Tschinder
04b4e414ad Fix clean to remove package-lock files (#5991)
Otherweise the same versions get installed over an over again in
dev environments
2017-07-23 09:20:36 -04:00
Eduardo Leggiero
d156afff2e Fixed "node: current" example
`parseFloat` is not applied anymore to "node: current" logic:
The parseFloat was wrong, as `parseFloat('6.3.2')` will parse as 6.3, but `parseFloat('6.10.2')` will output 6.1 that is not correct.

Ref: https://github.com/babel/babel-preset-env/blob/master/src/targets-parser.js#L73
2017-07-22 18:19:54 +01:00
Daniel Tschinder
59ffa6268e Fix flow test runner (#647)
* Fix flow test runner

* Retry parsing in scriptmode
2017-07-22 11:11:52 +02:00
greenkeeper[bot]
23d325ba75 Update flow-bin to the latest version 🚀 (#646)
* chore(package): update flow-bin to version 0.51.0

* chore(package): update lockfile

https://npm.im/greenkeeper-lockfile
2017-07-22 09:38:18 +02:00
Henry Zhu
92d64f202d 7.0.0-beta.17 2017-07-21 15:56:42 -04:00
jbrown215
e7e7593ca5 Flow opaque type aliases parsing (#643)
* Add support for Flow opaque type aliases

* Add tests for Flow opaque type aliases
2017-07-21 10:48:28 -04:00
MarckK
c88af90c0a Add optionality to catch bindings (#634)
* Add optionality to catch bindings (plus tests)

* Update ast/spec, README, set param to null if no param with plugin optionalCatchBinding

* Fix: wrap param = null in else case

* Fix tests for optional catch binding; add tests which include finally clause
2017-07-21 10:18:57 -04:00
Ryan Gaus
0b890ced19 Code generator tests (#5847) 2017-07-20 18:22:18 -04:00
Brian Ng
77bdb9ae3e Reorganize new.target tests (#642) 2017-07-20 16:17:40 -05:00
Justin Ridgewell
c60bf9a897 Fixup builder-binary-assignment-operator-visitor (#5969)
Using a `SequenceExpression` instead, we avoid awkward
`AssignmentExpression`s as direct children of `BlockStatement`s.
2017-07-20 11:47:47 -04:00
Naveen jain
245c78dcdc Added test cases for babel-generator (#5934)
* edited .gitignore to ignore all package-lock.json files
2017-07-20 11:39:26 -04:00
Justin Ridgewell
8a98141b60 Fix a few type inferences (#5835) 2017-07-20 11:38:12 -04:00
Justin Ridgewell
78544417fc Remove noop (#5970)
It’s ugly, but it gets the job done. And it unblocks my babel-type
changes.
2017-07-20 11:36:13 -04:00
Justin Ridgewell
c6edce115c Fix numeric-separator transform (#5968) 2017-07-20 11:35:53 -04:00
Marcus Cavanaugh
fe13ba8fc2 Remove unused functions from renamer.js. (#5965) 2017-07-20 11:19:10 -04:00
Henry Zhu
2f50fd00c3 update to babel 7 alpha.15 (#638) 2017-07-19 16:38:45 -04:00
Henry Zhu
135c3bafac drop node 7 [skip ci] 2017-07-19 16:37:09 -04:00
Selwyn
579499c66d Update v8flags to version 3.0.0 (#5975) 2017-07-19 14:31:23 -04:00
Brian Ng
a46f87f726 Check for function when parsing export async (#639) 2017-07-19 14:03:49 -04:00
Henry Zhu
36dc6ee5dc 2.0.0-alpha.15 2017-07-19 10:52:23 -04:00
Justin Ridgewell
827c70e015 Support exporting deep destructuring (#5953) 2017-07-18 14:07:09 -05:00
Justin Ridgewell
8a5488e59f Fix for-of loose optimization (#5964)
VariableDeclarators can’t have a MemberExpression id.
2017-07-18 15:01:36 -04:00
Justin Ridgewell
63204ae51e Remove maybePopFromStatements (#5945)
It prevented you from pushing into the `params` of a function.

```js
fnpath.pushContainer("params", t.identifier("memo"))
```
2017-07-18 14:55:33 -04:00
Justin Ridgewell
28ae47a174 Stop mutating nodes (#5963)
* Stop mutating nodes

* Update tests

* linting
2017-07-18 13:24:07 -04:00
Henry Zhu
fa0b73ba33 Bump babel to alpha 15 (#372) 2017-07-18 09:55:30 -05:00
Mauro Bringolf
aa684d1b0c Spec compliancy of check-es2015-constants plugin (#5930)
* Figuring out where to place throw statement

* Restored path argument destructuring

* New approach using comma expressions for assignments

* Moved throwNode into body of forXstatements

* Refactored with helper function and ensureBlock, additional tests for update exprs

* Added exec tests for all violations

* Hoisted helper function for comma expression outside of visitor
2017-07-17 20:01:01 -04:00
Ryan Tsao
6ae350773e Normalize module format of plugins/built-ins data (#376)
* Reference plugins json instead of module in normalize-options.js

* Make plugins module format match built-ins module
2017-07-17 16:08:15 -04:00
Brian Ng
1fdec955f8 Bump istanbul and nyc (#5959) 2017-07-17 15:58:49 -04:00
Sarup Banskota
213ad1ed7a [generator] remove parens from break & continue (#5950)
* Remove parens around break and continue

Fixes #5742

* Fix space in doc comment

* Add some tests

* Remove newlines within CommentBlock

* Prevent newline before/after label

* Remove reference to node

* Check for label within startTerminatorless

* Print block instead of single line comment

* Clean up
2017-07-17 09:30:28 -07:00
Justin Ridgewell
797fb3c2e4 Optimize and remove state from typeof-symbol transform (#5955)
Also fixes a bug with returning a Symbol from a Class constructor
(because the transform wasn’t run on helpers before).
2017-07-17 10:51:36 -04:00
Justin Ridgewell
9d612e717e Fix react-inline-elements bug (#5958) 2017-07-17 10:46:13 -04:00
Justin Ridgewell
e919c6e6eb Add several test cases for systemjs exports (#5954) 2017-07-17 08:51:37 -05:00
greenkeeper[bot]
fa4d4040dc Update flow-bin to the latest version 🚀 (#629)
* chore(package): update flow-bin to version 0.50.0

* chore(package): update lockfile

https://npm.im/greenkeeper-lockfile
2017-07-17 11:45:00 +02:00
Robin
8e8ddc3ccb Fix typo on JavaScript (#375) 2017-07-15 11:08:42 -05:00
Joseph Frazier
f9b8fa1ddf Add comments property to babylon.parseExpression() result 2017-07-14 09:22:23 -05:00
Brian Ng
688a1e523e Fix parsing a <!-- b in modules (#626) 2017-07-14 09:16:31 -05:00
Sven SAULEAU
d82afb407e Merge pull request #5949 from babel/unused-eslint-rule
remove unused ESLint rule
2017-07-14 11:51:36 +02:00
Sven SAULEAU
b858d7ce5e chore: remove unused ESLint rule 2017-07-14 11:25:09 +02:00
Brian Ng
63143ea5e9 Fix incorrect parsing of %* (#624) 2017-07-13 15:04:05 -05:00
greenkeeper[bot]
f2b8d1f179 Update ava to the latest version 🚀 (#625) 2017-07-13 11:12:34 -05:00
Mauro Bringolf
b83e0ec7b0 2nd try: Add loose option for es2015-parameters transformation (#5943)
* Import changes to parameters package from previous branch

* Refactor plugin option access via state
2017-07-12 17:36:44 -04:00
Nicolò Ribaudo
b0c3a9dcdd Add support for flow's export type * from (#617) 2017-07-11 22:56:04 -05:00
Henry Zhu
a0f0411abf v7.0.0-alpha.15 2017-07-11 23:35:22 -04:00
Buu Nguyen
8decefe8bc Fix bug incorrect dereferencing rest argument (#5810)
* Fix bug incorrect dereferencing rest argument

* Fix pure path

* Minor refactor
2017-07-11 23:26:57 -04:00
Henry Zhu
650cd43096 move to src (#5942) 2017-07-11 23:23:15 -04:00
Henry Zhu
03f249430a v7.0.0-alpha.14 2017-07-11 22:53:09 -04:00
Henry Zhu
8460b4c62f v7.0.0-alpha.13 2017-07-11 22:27:56 -04:00
Brian Ng
4710b8a5ba Update babel-types docs [skip ci] (#5941) 2017-07-11 22:20:43 -04:00
Brian Ng
81e87b0838 Remove codecov node package and use bash uploader (#5938)
* Remove codecov node package and use bash uploader

* test
2017-07-11 21:32:48 -04:00
Mauro Bringolf
465c087ac0 Removed update operators from number unary operators (#5940) 2017-07-11 19:08:50 -05:00
Brian Ng
bc123ad02a Change trailing comma option for polyfill scripts (#5939) 2017-07-11 18:13:26 -05:00
Justin Ridgewell
e170e6d760 Fix returning an object in a derived class constructor without super (#5885) 2017-07-11 17:43:19 -04:00
Ash
960e1708a1 babel-traverse: Mark appropriate template literals as pure (#5914)
* Identify pure template literals

* Mark template literals as pure where possible

* Changes based on code review

* nit
2017-07-11 17:42:34 -04:00
Daniel Tschinder
2ce5f166d7 Remove codecov node package and use bash uploader (#5937) 2017-07-11 13:37:54 -05:00
greenkeeper[bot]
ff513df283 Update rollup to the latest version 🚀 (#618)
* chore(package): update rollup to version 0.45.1

* chore(package): update lockfile

https://npm.im/greenkeeper-lockfile
2017-07-11 05:43:07 +02:00
Sarup Banskota
a7a9e7ae17 Gitignore package-lock (#5918) 2017-07-10 13:44:27 -05:00
greenkeeper[bot]
39ae6f6d28 Update rollup to the latest version 🚀 (#615) 2017-07-09 23:52:20 -05:00
Justin Ridgewell
51ff4dd936 Fix async-to-generator ForAwait transform (#5932)
The old transform called an external `babel-traverse`, which doesn’t
does something funky.
2017-07-09 23:49:44 -05:00
Justin Ridgewell
68fb475661 Merge pull request #604 from babel/greenkeeper/chalk-2.0.0
Update chalk to the latest version 🚀
2017-07-09 20:16:25 -04:00
Justin Ridgewell
880b9a38a3 Merge pull request #614 from babel/greenkeeper/rollup-0.43.1
Update rollup to the latest version 🚀
2017-07-09 20:12:44 -04:00
greenkeeper[bot]
c020a0b2b4 chore(package): update lockfile
https://npm.im/greenkeeper-lockfile
2017-07-09 23:26:21 +00:00
greenkeeper[bot]
a48f5a6780 chore(package): update rollup to version 0.43.1 2017-07-09 23:20:37 +00:00
Justin Ridgewell
cc643668c8 Merge pull request #613 from jridgewell/function-sent-statement
Fix function.sent parsing
2017-07-09 08:56:06 -04:00
Justin Ridgewell
aa1bad90d1 Test function.sent statement without declarations 2017-07-08 02:08:46 -04:00
Justin Ridgewell
62d313e753 Fix function.sent parsing 2017-07-07 23:14:20 -04:00
Justin Ridgewell
628061c501 Add new.target transform (#5906)
* Add new.target transform

* Catch new.target under only an arrow function

* More unsupported reflect.construct cases

* Fix node 4 test

* Do not transform Methods

* More tests

* Properly setup function inheritance test

* Tests tests tests

* Fix ES6 class's new.target

* Remove expected output thats supposed to throw.
2017-07-07 14:28:19 -04:00
Sarup Banskota
003b8918c2 Fix typo in babel-types doc script + run it (#5855) 2017-07-06 16:19:51 -04:00
Jeffrey Wear
72183ff2e9 Clarify use of bind operator in "prefix position" (#5917)
The REPL [shows](https://babeljs.io/repl/#?babili=false&evaluate=false&lineWrap=true&presets=es2015%2Creact%2Cstage-0&targets=&browsers=&builtIns=false&debug=false&code_lz=PYIwVgXBBmCuB2BjA3AKAPToAQEsDOWApgI6w4BuAhgDaHwAuW9wEqcSAdCDvACYAUoMAEo0qKEI7sUGbPiKkKNOo2atJ0rjwFDRqVEKjT-Vansy4CJMqZVMWbBIg6Ia1QeAA0WU3vEQNJxMaczkrRVsGe1ZNV2p3IW9fZCA)
that when the bind operator prefixes `obj.func` (as opposed to being used
between `obj` and `func`), rather than binding a free function `func` to `obj`,
it binds `obj.func` to `obj`.

[skip ci]
2017-07-04 16:21:39 -07:00
Brian Ng
f70c9f11fc 1.6.0 2017-07-04 09:59:31 -05:00
Brian Ng
a99f77a211 Update changelog 2017-07-04 09:58:08 -05:00
Brian Ng
9f8a44ab7a Update yarn.lock 2017-07-04 09:58:01 -05:00
Justin Ridgewell
f09eb3200f Merge pull request #609 from jridgewell/static-private
Add static private class field support
2017-07-03 19:55:34 -04:00
Brian Ng
65fa461a59 Tweak uglify option docs (#368) 2017-07-03 13:07:39 -05:00
Artem Yavorsky
eff645a900 Merge pull request #367 from babel/chromeandroid
Handle `chromeandroid` browserslist value. Fixes #366.
2017-07-03 17:32:42 +03:00
Brian Ng
b73dac4f63 add test 2017-07-03 09:07:48 -05:00
Artem Yavorsky
7e718e1e46 Handle chromeandroid browserslist value. 2017-07-03 01:22:54 +03:00
Justin Ridgewell
9c9f9e2adb Add static private class field support 2017-07-02 01:44:12 -04:00
Artem Yavorsky
51ace73e7c Use nyc 10.1.2. 2017-07-01 18:42:37 +03:00
Artem Yavorsky
47cec5439a Bump chai to 4.0.2. 2017-07-01 18:12:30 +03:00
Artem Yavorsky
ca37d4919d Explicit targets always override browsers targets. 2017-07-01 18:06:34 +03:00
Artem Yavorsky
5152b370e7 Bump some stuff. 2017-07-01 17:57:56 +03:00
Artem Yavorsky
899c57b960 Merge branch 'master' into 2.0
# Conflicts:
#	.travis.yml
#	package.json
#	src/targets-parser.js
#	yarn.lock
2017-07-01 17:50:54 +03:00
Brian Ng
0c847c4571 Bump compat-table for node8 support (#363) 2017-07-01 09:43:00 -05:00
Nicolò Ribaudo
5e1e94917c Add link to decorators proposal (#606) [skip ci] 2017-07-01 06:21:52 -04:00
greenkeeper[bot]
4d851fa44d chore(package): update lockfile
https://npm.im/greenkeeper-lockfile
2017-06-30 00:10:05 +00:00
greenkeeper[bot]
2f1b7d543d chore(package): update chalk to version 2.0.0 2017-06-29 23:59:29 +00:00
Daniel Tschinder
5f5c6fcc4e Remove deprecated option in flowconfig 2017-06-29 10:38:44 -07:00
greenkeeper[bot]
62b527851f Update ava to the latest version 🚀 (#599)
* chore(package): update ava to version 0.20.0

* Update yarn.lock
2017-06-29 10:20:20 -07:00
greenkeeper[bot]
30dfccf84c Update flow-bin to the latest version 🚀 (#601)
* chore(package): update flow-bin to version 0.49.1

* Update yarn.lock
2017-06-29 10:20:09 -07:00
Daniel Tschinder
ae5e6b954c Add greenkeeper-lockfile support (#602) 2017-06-29 10:19:57 -07:00
Brian Ng
7576397b25 Force color output in test runs to ensure consistent behavior in Travis (#603) 2017-06-29 10:19:29 -07:00
Jim Nielsen
9ad660bbe1 Swap github/twitter links (#5895) [skip ci] 2017-06-28 14:51:23 -04:00
Henry Zhu
6474dd5b88 basic publish steps [skip ci] 2017-06-28 12:50:31 -04:00
Henry Zhu
364a9fe72d 7.0.0-beta.16 2017-06-28 12:48:05 -04:00
Brian Ng
5180ecdca4 Use prettier (#600) 2017-06-28 12:41:42 -04:00
Henry Zhu
a95f55c468 add ts to readme [skip ci] 2017-06-28 10:59:02 -04:00
Andy
97c23461f9 TypeScript parser plugin (#523) 2017-06-28 10:57:50 -04:00
Henry Zhu
f7547fd35a Use the string "module" in err message (#598) 2017-06-28 10:46:30 -04:00
Nicolò Ribaudo
03b3b39b17 Allow jsx to be the body of a typed arrow function (#595)
Fixes #593
2017-06-28 10:17:51 -04:00
Sebastian McKenzie
759266a2e8 Remove future plans from README (#597) [skip ci] 2017-06-28 08:44:47 -04:00
Henry Zhu
7795615dac fix example [skip ci] 2017-06-28 06:49:55 -04:00
Henry Zhu
107aea75f1 add a code example [skip ci] (#594) 2017-06-27 23:53:23 -04:00
William Horton
baa5f4dca7 Stage 2: BigInt (#588)
* Stage 2: BigInt

* Change plugin name to bigInt (camelcase).

* Update based on PR review, add test cases.

* Use hex for charCodes.
2017-06-27 23:35:57 -04:00
Daniel Tschinder
fecdb6feeb Make tokens optional (#563)
Adding tokens to the ast is significant slower and most tools
don't ever use them anyway
2017-06-27 23:26:24 -04:00
Brian Ng
58ec149c52 Fix some unneeded semis in test fixtures (#5892) 2017-06-27 22:15:10 -05:00
Daniel Tschinder
b3372a572d Remove whitespace generation (#5833)
* Remove whitespace generation and rely on default printing

Changes to printing:
* Add newline after last empty SwitchCase
* Add newlines around block comments if they are non-flow comments or contain newlines

* Fix a few more fixtures
2017-06-27 21:57:02 -05:00
Josh Johnston
bc29145465 Fix 5768 (to 7.0 branch) (#5891) 2017-06-27 20:04:23 -04:00
Henry Zhu
48c770e4bb Force color output in test runs to ensure consistent behavior in Travis 2017-06-27 17:48:56 -04:00
Josh Johnston
3cf4cee40a Fix 5768 (#5811)
* Fix destructured exports

- adds a failing test based on description in #5768
- handles ObjectPattern and ArrayPattern

* use export assignment template
2017-06-27 17:31:47 -04:00
Henry Zhu
ed0de70656 Merge pull request #5889 from babel/update-babylon
Update babylon
2017-06-27 17:29:55 -04:00
Henry Zhu
9a75916012 remove unused dependencies 2017-06-27 17:18:13 -04:00
Henry Zhu
a4080dc095 update babylon 2017-06-27 17:17:41 -04:00
Henry Zhu
4e50b2d9d9 Merge pull request #5412 from babel/prettify
Use prettier
2017-06-27 17:12:14 -04:00
Henry Zhu
3d03414c05 update readme with decorators2 [skip ci] 2017-06-27 16:06:33 -04:00
Henry Zhu
a0f054b5ce 7.0.0-beta.15 2017-06-27 16:03:30 -04:00
Henry Zhu
88298536c5 Revert "Distinguish between ternary's : and arrow fn's return type (#573)"
This reverts commit a9a55fbd3f.
2017-06-27 15:58:57 -04:00
Nicolò Ribaudo
a9a55fbd3f Distinguish between ternary's : and arrow fn's return type (#573)
* Distinguish between ternary's : and arrow fn's return type

* Correctly parse nested arrow functions inside conditional expressions

Defer the conversion of arrow function parameters to assignable nodes so that
it is possible to use the (invalid) ast to get the exact position of the (wrong)
arrow functions.

* Check params of arrow fns w/ type params or w/o return type

* Fix also async functions

* Add test from prettier

https://github.com/prettier/prettier/issues/2194

* Don't check arrow params if they are valid at the first attemp

* Use state instead of relying on the "noArrowParamsConversion" parameter

* Remove noArrowParamsConversion
2017-06-27 15:44:56 -04:00
Henry Zhu
39447b1cca Merge pull request #590 from peey/decorators-followup
Follow-up on Decorators PR
2017-06-27 15:34:44 -04:00
Peeyush Kushwaha
f2ad94d0e3 Incorporate suggestions from review 2017-06-27 22:46:43 +05:30
Brian Ng
e4b35f680d Run prettier 2017-06-27 12:15:00 -05:00
Brian Ng
93cc22dae1 Add prettier 2017-06-27 12:13:54 -05:00
Henry Zhu
994cde616d Merge pull request #589 from Qantas94Heavy/fix-private-fields
Add delete check and fix nested class parsing for private fields
2017-06-27 11:33:19 -04:00
Henry Zhu
89d8f70fcd Merge pull request #5813 from jridgewell/pr/5786
Optional Chaining Operator (Stage 1)
2017-06-27 11:10:47 -04:00
Justin Ridgewell
f363ec6b99 Add to stage-1 preset 2017-06-27 01:27:41 -04:00
Logan Smyth
b3183b1198 Force color output in test runs to ensure consistent behavior in Travis (Take 2) 2017-06-26 15:59:30 -07:00
Logan Smyth
892377ae57 Force color output in test runs to ensure consistent behavior in Travis. 2017-06-26 15:51:51 -07:00
Logan Smyth
95b3c8a16a Revert "TEMP: Another quick test"
This reverts commit 0005b9e4cf.
2017-06-26 15:49:56 -07:00
Logan Smyth
12e39116f0 Revert "TEMP: Debugging unexpected test failures."
This reverts commit 1fb3d5b0f6.
2017-06-26 15:49:54 -07:00
Logan Smyth
0005b9e4cf TEMP: Another quick test 2017-06-26 15:22:13 -07:00
Logan Smyth
1fb3d5b0f6 TEMP: Debugging unexpected test failures. 2017-06-26 14:59:39 -07:00
Henry Zhu
bd9e1860d0 for-of optimization on arrays/known functions that return arrays (#4747) 2017-06-26 16:47:39 -04:00
Sven SAULEAU
692e51609c Merge pull request #5886 from yavorsky/7-fix-commonjs-destructuring
7.0 port: Fix commonjs exports with destructuring.
2017-06-26 22:37:39 +02:00
Henry Zhu
bb5528b414 Merge pull request #4850 from babel/removeClassCallCheck-option
Remove ClassCallCheck, possibleConstructorReturn in loose mode
2017-06-26 15:24:11 -04:00
Buu Nguyen
033bad3098 Fix bug super ref check doesn’t honor spec evaluation order (#5801) 2017-06-26 15:16:47 -04:00
Artem Yavorsky
2cfd01aeb6 Add fixtures for exports with desctucturing. 2017-06-26 15:44:18 +03:00
Artem Yavorsky
ddba7ba89f Add destructuring case for modules-commonjs. 2017-06-26 14:33:58 +03:00
Justin Ridgewell
1c7151e8ba Merge pull request #592 from nicolo-ribaudo/dead-code
Remove dead code
2017-06-25 19:07:36 -04:00
Nicolò Ribaudo
d93860393c Remove dead code 2017-06-26 00:48:18 +02:00
bill-improbableio
851d2cb6e0 Pass SIGINT signals to the spawned child process (#5861)
* Pass SIGINT signals down to the spawned child

* Kill process with correct signal

* Fix lint issues

* Fix exit for outer process
2017-06-24 19:04:53 -04:00
Joseph Frazier
a330cf2b09 Add support for evaluating String.raw expressions (#5681)
* Add support for evaluating `String.raw` expressions

* Dedupe evaluation code for template literal quasis

* Check scoping in `String.raw` evaluation
  This addresses https://github.com/babel/babel/pull/5681#discussion_r114203497

* Ensure that `tag` is a MemberExpression in `String.raw` evaluation
  This addresses https://github.com/babel/babel/pull/5681#discussion_r114203555

* babel-traverse: Move evaluateQuasis() outside _evaluate()
2017-06-24 16:00:42 -04:00
MarckK
b6b69c615a Fix type errors for destructuring assignments(#4227) (#5865) 2017-06-24 15:56:51 -04:00
Henry Zhu
4fdff567c6 remove superClass truthy check 2017-06-24 14:27:41 -04:00
Peeyush Kushwaha
c3b992e031 Minor change in an error message 2017-06-23 22:04:35 +05:30
Peeyush Kushwaha
2c8fc75643 Add test case for decorated static method 2017-06-23 18:13:51 +05:30
Peeyush Kushwaha
37fa77e84f Support decorator in decorator
Fixes #524
2017-06-23 18:10:16 +05:30
Karl Cheng
44d842c30b Add private fields numeric name test 2017-06-23 18:34:59 +10:00
Karl Cheng
b4e06aa279 Fix parsing of nested classes with private fields
The parsing of private fields checks whether or not it is within a
class to determine if it is valid or not. However, the state.inClass
property is incorrect as it marks it as outside a class when the inner
class is closed.

This commit fixes this problem by replacing the state.inClass property
with a class nesting counter.
2017-06-23 18:34:59 +10:00
Karl Cheng
43dba7e7c1 Throw on attempt to delete a private field
Given that private fields can only be used within classes, any code
using them must be in a strict mode context. As private fields cannot
be deleted, throw an early SyntaxError.
2017-06-23 18:34:59 +10:00
David Colwell
622672d397 Remove Monorepo negative regarding npm results (#5884) [skip ci]
It's fixed as of:  https://github.com/npms-io/npms/issues/13
2017-06-22 23:01:13 -04:00
Peeyush Kushwaha
add8e4ad13 Helpful error message for @dec export class 2017-06-23 02:19:08 +05:30
Henry Zhu
f976bdd21c Merge pull request #587 from peey/decorators-stage-2
Decorators Stage 2 Parsing
2017-06-22 10:20:08 -04:00
Justin Ridgewell
64eafad472 Merge pull request #5469 from yavorsky/fix-commonjs-destructuring
Fix commonjs exports with destructuring.
2017-06-21 16:41:55 -04:00
Peeyush Kushwaha
d99618cdfe renames files 2017-06-22 02:01:28 +05:30
Peeyush Kushwaha
e5fdb3448d rename decoratorsStage2 -> decorators2 2017-06-22 02:00:36 +05:30
Justin Ridgewell
1ea3b0601c Merge pull request #5877 from mathiasbynens/update-unicode-property-regex
Move plugin-transform-unicode-property-regex to stage 3
2017-06-21 16:29:29 -04:00
Peeyush Kushwaha
e1972baff5 Decorated classes/methods start where the decorator starts 2017-06-22 01:45:53 +05:30
Mathias Bynens
5492fe130a Move plugin-transform-unicode-property-regex to stage 3 2017-06-21 15:55:02 +02:00
Peeyush Kushwaha
04b40868f9 Add more tests; fix plugin conflict code 2017-06-19 23:45:57 +05:30
Henry Zhu
a59103f15d link to the handbook [skip ci] 2017-06-19 12:42:53 -04:00
Henry Zhu
8a4ab088e4 create and use a inheritsLoose helper 2017-06-19 11:58:49 -04:00
Henry Zhu
8febb09404 update babel alpha 12, fixes build issues (#583) 2017-06-18 19:01:02 -04:00
Daniel Tschinder
cb09891fff 7.0.0-beta.14 2017-06-18 23:06:56 +02:00
aardito2
ac936e315a Fix comment attachment for call expressions (#575) 2017-06-18 22:57:42 +02:00
Henry Zhu
ba671d0a66 update babel-eslint, try out numeric separators (#5866)
* update babel-eslint, try out numeric separators

* update version
2017-06-17 23:31:47 -04:00
Peeyush Kushwaha
b60ac52ae6 Reorganize tests and add tests
Add tests for static properties and private properties
2017-06-18 02:00:13 +05:30
Peeyush Kushwaha
4f8ac6bada Merge branch 'master' into decorators-stage-2 2017-06-18 01:33:16 +05:30
Henry Zhu
4595729cbb fix issue as a result of refactor (#5867) 2017-06-17 16:01:33 -04:00
Peeyush Kushwaha
b7c1c559c7 Add test case for object properties 2017-06-18 01:30:46 +05:30
Peeyush Kushwaha
38c417e971 Reorganize tests; camelCase plugin name 2017-06-18 01:25:54 +05:30
Daniel Tschinder
e1e2c32bf3 Correctly put typeParameters on FunctionExpression (#585) 2017-06-17 15:43:31 -04:00
Daniel Tschinder
e982c0652c Fix v8 deopts (#581) 2017-06-17 11:41:23 -04:00
Peeyush Kushwaha
b5e23835ce Disallow exports between decorator & class body
For stage 2 decorators
2017-06-17 18:12:14 +05:30
Peeyush Kushwaha
9c639743dd Disallow in object literals, params, class props
And add tests to reflect the same
2017-06-17 17:49:33 +05:30
Peeyush Kushwaha
162bc905a6 Throw if both decorators decorators-stage-2 used 2017-06-17 13:38:04 +05:30
Peeyush Kushwaha
001044ffa7 Add tests for stage 2 decorators from PR#353 2017-06-17 13:33:42 +05:30
Peeyush Kushwaha
a24dc6e630 Let decorator stage 2 parsing be under a new plugin name
Parse stage 0 decorators when "decorators" plugin is active and
parse stage 2 decorators when "decorators-stage-2" plugin is active
2017-06-17 13:25:21 +05:30
Kevin Gibbons
06afa0761b Update decorator parsing to match current spec
Refer to PR #353
2017-06-17 13:23:30 +05:30
Daniel Tschinder
e11794c735 Add back shorthand field to Property (#580)
Also add some better types for estree
2017-06-17 01:05:32 +02:00
Nicolò Ribaudo
6b4fba4deb The { after a function generic type annotation is a statement (#578)
This would have previously been interpreted as an expression,
because usually after ">" there can't be a statement.

Fixes #36
2017-06-15 09:39:39 -05:00
Danny Andrews
3b28bd2cb1 [skip ci] Fix typos in README.md (#5857) 2017-06-14 09:49:41 -05:00
Andy
50ae16de38 Factor parseSubscript out of parseSubscripts (#576) 2017-06-14 00:26:12 +02:00
Justin Ridgewell
5387d9f903 Merge pull request #5721 from Qantas94Heavy/rest-parameters-5656
Fix optimisation of shadowed rest parameters
2017-06-13 13:57:53 -04:00
Konstantin Pschera
fea3a72838 Fix babel-plugin-transform-regenerator README (#5852) 2017-06-13 09:19:36 -05:00
Henry Zhu
ac99d73e88 add probot-stale [skip ci] (#353) 2017-06-12 11:10:58 -04:00
Justin Ridgewell
05726a976e Merge pull request #5837 from jridgewell/hoist-closure-helpers
Hoist several closures
2017-06-12 02:23:45 -04:00
Ryan Gaus
070662e381 Add tests for babel-generator (#5845)
Added two tests for src/generators/flow.js that check if a value is of
type `empty` or `mixed`.
2017-06-10 09:28:37 -04:00
Henry Zhu
cdca54aed3 remove possibleConstructorReturn in loose mode as well 2017-06-09 18:42:52 -04:00
Henry Zhu
4081f3e23e removeClassCallCheck option 2017-06-09 16:50:17 -04:00
Hasan Bayat
1b29ab1289 Adding documentation and information (#5717) [skip ci] 2017-06-09 11:24:20 -04:00
Brian Ng
cce83a0cea Fix parens issues with exponentiation in generator (#5830) 2017-06-09 11:10:16 -04:00
Sarup Banskota
f1303aa54c Misc updates to babel-core README (#5841) [skip ci]
* Minor grammar things
* Standardize fullstops on the options table
* Usage of `` where appropriate
2017-06-09 10:37:34 -04:00
Alex Rattray
dd82d7a653 Document babel-helper-plugin-test-runner usage (#5843) [skip ci]
* Document `babel-helper-plugin-test-runner` usage

* [skip ci]
2017-06-09 10:35:53 -04:00
Justin Ridgewell
ac33b1be27 Fix addCompletionRecords 2017-06-09 00:12:16 -04:00
Henry Zhu
ccd314cba7 6.25.0 changelog [skip ci] (#5844) 2017-06-08 17:30:39 -04:00
Henry Zhu
82f37841f5 v6.25.0 2017-06-08 17:29:04 -04:00
Daniel Tschinder
36ab72f095 Support declare export statements (#5589)
* Add definition of declare export statements

* Add more codecoverage
2017-06-08 23:15:54 +02:00
Henry Zhu
bc013e6d34 just make sure babylon is up to date [skip ci] 2017-06-08 17:10:51 -04:00
Bo Lingen
0c8fdc381d Backport array & object pattern fixes to 6.x (#5770)
* Backport array & object pattern fixes to 6.x

Original PRs merged to 7.0 as #5722 and #5762

* fix lint error
2017-06-08 16:58:37 -04:00
Sarup Banskota
9b05b0df5c Include node 8.0 to travis config & update tests (#5807)
* Remove node 7 and introduce node 8 in travis config

Progress on #5804

* Run yarn install with node 8

Progress on #5804

* Remove expose_debug_as from tests; replace with expose_gc_as

Fixes #5804

* Remove dashed options since they aren't listed

* Revert "Remove dashed options since they aren't listed"

This reverts commit f826167e320ee85331e09ac63b5674401cac6236.
2017-06-08 18:50:42 +02:00
Justin Ridgewell
119d5c5871 Hoist several closures 2017-06-08 03:39:10 -04:00
Justin Ridgewell
0740e61131 Use strict 2017-06-08 00:47:19 -04:00
Brian Ng
97f4d31192 Update changelog for v1.5.2 [skip ci] 2017-06-07 09:44:22 -05:00
Brian Ng
9850f82351 1.5.2 2017-06-07 09:38:08 -05:00
Justin Ridgewell
97d0ab78cb Update babylon 2017-06-07 03:52:42 -04:00
Justin Ridgewell
f537fc7da7 Add babel-generator tests 2017-06-07 03:22:52 -04:00
Justin Ridgewell
462825b15a Simplify transform
This also makes the output use less comparisons for `foo?.()?.bar`
cases. 😁
2017-06-07 03:22:52 -04:00
Justin Ridgewell
9e91ac54d3 Optional call expressions short circuit later member expressions 2017-06-07 03:22:52 -04:00
Justin Ridgewell
54d9732d0b Test Update and Unary expressions 2017-06-07 03:22:52 -04:00
Justin Ridgewell
d92309f0db PR comments 2017-06-07 03:22:52 -04:00
Justin Ridgewell
faa6c9f708 Use nil 2017-06-07 03:22:52 -04:00
Justin Ridgewell
6cc2f5dc78 Consider any unary expression 2017-06-07 03:22:52 -04:00
Justin Ridgewell
a62cb9281e Delete unnecessary check 2017-06-07 03:22:52 -04:00
Justin Ridgewell
ef87acc389 Test not-top-level optional chaining 2017-06-07 03:22:51 -04:00
Justin Ridgewell
1f22ac353a Lint 2017-06-07 03:22:51 -04:00
Justin Ridgewell
0e5f597ee6 Readme 2017-06-07 03:22:51 -04:00
Justin Ridgewell
899634d20b Add exec tests 2017-06-07 03:22:51 -04:00
Justin Ridgewell
b048bff77d Add optional to MemberExpression 2017-06-07 03:22:51 -04:00
Justin Ridgewell
9ce797dd34 Reduce context memoization when possible 2017-06-07 03:22:51 -04:00
Justin Ridgewell
acdd3637bc Refactor 2017-06-07 03:22:51 -04:00
Justin Ridgewell
85b6b4b1b2 Print optional chain operator 2017-06-07 03:22:51 -04:00
Justin Ridgewell
5fe4803562 Simplify NewExpression|CallExpression visitor 2017-06-07 03:22:51 -04:00
Justin Ridgewell
30ee87159d Split syntax and transform into two plugins 2017-06-07 03:22:51 -04:00
Justin Ridgewell
2a496890ff Use a better nested syntax
This way, it quickly returns from the conditions. The first nil will
now exit, instead of checking every nil.

This also allows conditionalChaining inside a container to still
operate the container.
2017-06-07 03:22:51 -04:00
Justin Ridgewell
3fae121460 Implement Null Propagation Operator 2017-06-07 03:22:51 -04:00
Sven SAULEAU
750b03a22f refactor: use WeakSet to keep track of transformed nodes 2017-06-07 03:22:51 -04:00
Sven SAULEAU
98487b5a15 fix: typo 2017-06-07 03:22:51 -04:00
Sven SAULEAU
a9d8040c0f refactor: change undefined to void 0 2017-06-07 03:22:51 -04:00
Sven SAULEAU
3faca62a77 wip 2017-06-07 03:22:51 -04:00
Sven SAULEAU
cc6959e1fa feat: WIP assignements 2017-06-07 03:22:51 -04:00
Sven SAULEAU
6bd3bf4d2f feat: optional chaining with function call 2017-06-07 03:22:51 -04:00
Sven SAULEAU
ed15443dba fix: use undefined instead of null 2017-06-07 03:22:51 -04:00
Sven SAULEAU
64ff5a080d refactor: improved transformation logic 2017-06-07 03:22:51 -04:00
Sven SAULEAU
72259ca5d3 feat: cleanup 2017-06-07 03:22:51 -04:00
Sven SAULEAU
00f58b9bfa feat: optional chaing 2017-06-07 03:22:51 -04:00
Henry Zhu
dc87d99713 7.0.0-beta.13 2017-06-06 11:50:17 -04:00
Henry Zhu
2b7fab87d0 fix flow 2017-06-06 11:49:24 -04:00
Daniel Tschinder
69cba43f82 Fix parsing of private fields (#566)
The computed key is not part of the spec.
key for ClassProperties is an Expression
Do not parse computed and literal keys for PrivateClassProperties
2017-06-06 11:42:07 -04:00
Henry Zhu
37793d5be7 add links [skip ci] 2017-06-06 11:28:08 -04:00
Justin Ridgewell
5cc1cbf3bc Matches pattern cleanup (#5826)
* Extract duplicated function into babel-types

Also reimplements in a sane way.

* Add tests

* cleanup
2017-06-06 11:20:05 -04:00
Justin Ridgewell
8df5514083 Fix numeric separator Number transform (#5825) 2017-06-06 08:14:30 -04:00
greenkeeper[bot]
e5e4981e79 Update rollup-watch to the latest version 🚀 (#568)
* chore(package): update rollup-watch to version 4.0.0

* Update yarn.lock
2017-06-06 11:38:53 +02:00
Henry Zhu
123dce5fcd Hardcode to double quotes, indent to 2 spaces (#5824) 2017-06-05 22:14:37 -05:00
Sven SAULEAU
e064bb9135 Merge pull request #545 from xtuc/feat-optional-chaining
Optional Chaining: Stage 1 plugin
2017-06-05 23:13:16 +02:00
Henry Zhu
4c8f4a23db add another test 2017-06-05 16:51:45 -04:00
Justin Ridgewell
783d85ee4b Merge pull request #5780 from kentor/react-display-name-to-support-createReactClass
Backport support for createReactClass with transform-react-display-name
2017-06-05 16:13:16 -04:00
Daniel Tschinder
775dcfa6d6 Improve performance by removing all spread/rest usages (#561) 2017-06-05 19:21:41 +02:00
Michal Srb
bbc3cd45cf Fix location info on FunctionTypeParam nodes (#565) 2017-06-05 12:41:46 -04:00
Nicolò Ribaudo
b0524427c1 Wrap an arrow function in parentheses if it the test of a conditional expression (#5820)
* Wrap an arrow function in parentheses if it the test of a conditional expression

Fixes #5819

* Use ConditionalExpresion to check if () => {} should be wrapped

* Move `t.isTaggedTemplateExpression()` from ArrowFunctionExpression to
  ConditionalExpresion

* [test] `await (() => {})` needs the parentheses

* [test] (a ? b : c)`` needs the parentheses
2017-06-05 12:39:28 -04:00
Justin Ridgewell
53e3f0dbdc babel-types: avoid recreating validator closures (#5821) 2017-06-05 12:38:30 -04:00
Artem Yavorsky
c4fd05c0c2 Spec compatibility for template literals. (#5791)
* Spec compatibility for template literals.

* Update preset-es2015 `spec` expected case.

* Prevent array mutability by replacing `shift`.

* Fix condition for single item.

* Group concats to ensure toPrimitive sequence.

* Update function test case.

* Add semi for function test case.

* Simplify concat call expressions creating.

* Fix some cases with multiple idengifiers.

* Add test case with different literals.

* Add test case for `Symbol()` and toPrimitive order

* Add actual literal case.

* Add minNodeVersion to template literals order.

* Flip the logical expression.

* Update README for template literals spec option.

* docs [skip ci]
2017-06-05 08:53:10 -04:00
Daniel Tschinder
e579109f0b Use preset-env and update other dependencies (#562) 2017-06-04 00:01:36 +02:00
Daniel Tschinder
0656717552 Fix stmt value being the raw value (#557) 2017-06-03 16:16:45 +02:00
Sven SAULEAU
4628bb957d Merge pull request #1 from jridgewell/pr/545
Finish optionalChaining plugin
2017-06-03 16:07:38 +02:00
Justin Ridgewell
e1ec23cd3e Finish optionalChaining plugin 2017-06-03 01:20:40 -04:00
Brian Ng
c568150759 Merge pull request #346 from babel/issue345
Ensure explicit targets always override browsers key targets
2017-06-02 13:54:12 -05:00
Simen Bekkhus
1e55653ac1 Don't call deprecated code frame export (#5815) 2017-06-02 08:49:26 -04:00
Boopathi Rajaa
edf34dc780 [skip ci] Add classPrivateProperties to README & fix classProperties proposal link (#554) 2017-06-01 21:31:25 -04:00
Henry Zhu
272209ace5 ⬆️ Alpha 12 (#5808)
* fix usage of codeframe
2017-06-01 15:13:17 -04:00
Henry Zhu
794a522fb6 2.0.0-alpha.12 2017-06-01 14:35:03 -04:00
Brian Ng
ed80a4e84d Add node 8 to travis (#347) 2017-06-01 14:21:54 -04:00
Henry Zhu
d6245af802 fix readme [skip ci] 2017-06-01 10:35:28 -04:00
Henry Zhu
b2102baaae target node 8 2017-06-01 10:33:49 -04:00
Henry Zhu
41b0a79837 update packages to alpha.12 (#343)
* update packages to alpha.12

* fix tests

* Read babel-cli from package.json in smoke test
2017-06-01 10:32:28 -04:00
Brian Ng
36e017b427 Ensure explicit targets always override browsers key targets 2017-06-01 08:38:55 -05:00
Daniel Tschinder
c3e256fdb5 Add node 8 to travis (#552) 2017-06-01 11:50:25 +02:00
Sven SAULEAU
7e739f954d Merge pull request #5802 from babel/issue5371
Remove check for super calls in arrow function
2017-06-01 09:55:08 +02:00
Sven SAULEAU
bf9b434736 refactor: search parent instead of using state 2017-05-31 19:34:05 -05:00
Sven SAULEAU
819056e94a fix: remove check for super in arrow function 2017-05-31 19:33:57 -05:00
Brian Ng
432495752d Merge branch 'master' into 2.0 2017-05-31 18:58:01 -05:00
Henry Zhu
c5bad22767 v7.0.0-alpha.12 2017-05-31 17:11:39 -04:00
Henry Zhu
68ed633175 force-publish all packages [skip ci] 2017-05-31 17:09:11 -04:00
Henry Zhu
ce976bba2a v7.0.0-alpha.11 2017-05-31 16:43:30 -04:00
Mauro Bringolf
c142bbc429 Remove duplicated getStatementParent and refactor requires to imports in tests (#5746)
* Additional testcase and require->import refactorings

* Removed duplicated getStatementParent function. Refactored all babel-traverse tests to use ESmodules
2017-05-31 15:33:25 -04:00
Henry Zhu
a6273a92ec fix flow type issue 2017-05-31 15:31:59 -04:00
Henry Zhu
1d7d090bf0 fix pkg name 2017-05-31 15:31:51 -04:00
Buu Nguyen
f58f4ac351 Fix incorrect destructuring in for loop let initialization (#5763)
* Fix incorrect destructuring in for loop `let` initialization

* Improve approach and fix tests
2017-05-31 15:29:50 -04:00
Simen Bekkhus
63b7137dac Add column range to babel-code-frame (#5646) 2017-05-31 15:22:46 -04:00
Rick Waldron
5393a49349 Support for NumericLiteralSeparator, Stage 1 feature (#5793)
* Support for NumericLiteralSeparator, Stage 1 feature

commit cd8f6e062876261a334d968f875e477a48927b6d
Author: Sven SAULEAU <xtuc@users.noreply.github.com>
Date:   Wed May 31 16:14:15 2017 +0200

    docs: update README [skip ci]

commit cf013e3382bf73cdf9224026c1ec0b1a368cfef2
Author: Rick Waldron <waldron.rick@gmail.com>
Date:   Tue May 30 14:51:20 2017 -0400

    Support for NumericLiteralSeparator, Stage 1 feature

    Signed-off-by: Rick Waldron <waldron.rick@gmail.com>

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>

* add note about presets [skip ci]
2017-05-31 15:18:48 -04:00
Henry Zhu
2dd624b44e Merge branch 'master' into feat-optional-chaining 2017-05-31 14:33:47 -04:00
Henry Zhu
defde165ed pin to lerna rc.4 2017-05-31 14:32:50 -04:00
Sven SAULEAU
3783429a96 Merge pull request #5798 from rwaldron/fix-plugin-readmes
Make all packages/*/README.md descriptions consistent.
2017-05-31 16:30:35 +02:00
Rick Waldron
3a6fdca069 Make all packages/*/README.md descriptions consistent.
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
2017-05-31 10:24:26 -04:00
Justin Ridgewell
489cf90d23 Merge pull request #5796 from noinkling/add-inspect-brk-option
Allow --inspect-brk option to be used with babel-node [6.x backport]
2017-05-31 03:20:41 -04:00
noinkling
0230dc5067 Allow --inspect-brk option to be used with babel-node 2017-05-31 14:14:58 +12:00
Henry Zhu
324e2f0253 7.0.0-beta.12 2017-05-30 19:30:08 -04:00
Jan Olaf Krems
d4e842d4eb Add plugin for import.meta proposal (#544)
* Add plugin for import.meta proposal

Fixes https://github.com/babel/babylon/issues/539

* Tests for assignment/mutation of import.meta

* Use correct identifier in failure message

* Simpler & more consistent script errors for import.meta
2017-05-30 19:28:51 -04:00
Rick Waldron
2f5d146d54 Don't treat e, b, E, B as forbidden siblings for hex literals. (#549) 2017-05-30 18:14:31 -05:00
Rick Waldron
3ca75dc9ec Adds test to ensure that numericSeparator plugin does not alter "_" handling in Identifier (#548) 2017-05-30 14:31:13 -05:00
Justin Ridgewell
d34d2b1305 Merge pull request #5785 from noinkling/7.0
Allow --inspect-brk option to be used with babel-node
2017-05-30 15:30:33 -04:00
Sven SAULEAU
c1702e1da6 fix: minor change 2017-05-30 20:16:13 +02:00
Sven SAULEAU
b0386005c8 docs: NewExpression spec 2017-05-30 20:14:19 +02:00
Sven SAULEAU
9bcd85acf3 feat: CallExpression support 2017-05-30 20:12:43 +02:00
Sven SAULEAU
26096d6a3d style: [skip ci] updated comment 2017-05-30 18:38:50 +02:00
Sven SAULEAU
51bd87baa8 feat: use syntax plugin 2017-05-30 18:35:29 +02:00
Peeyush Kushwaha
5fbe8edfb9 Contributing troubleshooting (#5790) 2017-05-29 11:58:07 -05:00
Sven SAULEAU
03d89b6307 docs: fix typo in spec [skip ci] 2017-05-29 18:46:52 +02:00
Sven SAULEAU
d3bc8fcbdf Merge branch 'master' into feat-optional-chaining 2017-05-29 18:43:40 +02:00
Peeyush Kushwaha
dcbb6c5ce5 Add a section on troubleshooting [skip ci] (#5788)
* Add a section on troubleshooting [skip ci]

* Move troubleshooting section to be under the running tests section

* [skip ci]
2017-05-29 11:20:13 -04:00
noinkling
517ecdae65 Allow --inspect-brk option to be used with babel-node 2017-05-28 18:08:04 +12:00
Justin Ridgewell
2579c5b6e9 Merge pull request #5775 from peey/switch-continue
Switch continue
2017-05-27 22:45:14 -04:00
Henry Zhu
30defbe436 fix flow error [skip ci] 2017-05-27 10:20:30 -04:00
Henry Zhu
3477e740e1 pin babel, update lerna 2017-05-27 09:39:21 -04:00
Henry Zhu
0df3e3d6eb update babylon beta 11 2017-05-27 09:08:58 -04:00
Mauro Bringolf
f0d7d580d5 Added individual test cases for possible errors with path.replaceWith (#5779) 2017-05-27 00:22:26 -04:00
Henry Zhu
f326ef6424 7.0.0-beta.11 2017-05-27 00:19:22 -04:00
Andy
50694f99b1 Extract 'parseClassMember' method (#533) 2017-05-26 23:44:56 -04:00
Brian Ng
aad95c63ec Fix some flow unused warnings (#543) 2017-05-26 23:44:36 -04:00
Henry Zhu
81ce415359 add proposal links [skip ci] 2017-05-26 16:44:25 -04:00
Rick Waldron
b344f62056 NumberLiteralSeparator: Stage 1 feature plugin. Closes gh-538 (#541)
* NumberLiteralSeparator: Stage 1 feature plugin

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>

* fix-up per review

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>

* nit: forbiddenNumericLiteralSeparatorSibling -> forbiddenNumericLiteralSeparatorSiblings

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>

* fix-up to change includes -> indexOf

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
2017-05-26 16:37:05 -04:00
Henry Zhu
589ceb4ee7 add extra note [skip ci] 2017-05-26 16:27:16 -04:00
Henry Zhu
ed1809c2d1 link to contributing [skip ci] 2017-05-26 16:25:45 -04:00
Henry Zhu
702d413b83 add contributing docs on making a plugin [skip ci] (#542)
* add contributing docs on making a plugin [skip ci]

* fixes [skip ci]
2017-05-26 16:24:10 -04:00
greenkeeper[bot]
dd83ad6d60 Update flow-bin to the latest version 🚀 (#537)
* chore(package): update flow-bin to version 0.47.0

* Update yarn.lock
2017-05-26 15:48:56 -04:00
Brian Ng
4ae39239b5 Remove import declaration when stripping flowtypes if only type/typeof specifiers (#5782) 2017-05-26 15:36:46 -04:00
Brian Vaughn
b296759852 Updated transform-react-display-name for createReactClass addon (#5554)
* Updated transform-react-display-name for ReactCreateClass addon

* Tweaked description for transform-react-display-name plugin

* Changed ReactCreateClass to createReactClass
2017-05-26 10:04:34 -07:00
Henry Zhu
6eeb0317b9 pin to alpha.9 2017-05-26 12:27:28 -04:00
Henry Zhu
9e2ef0cf9e update types [skip ci] 2017-05-25 15:23:30 -04:00
Henry Zhu
9b44cef691 v7.0.0-alpha.10 2017-05-25 15:17:07 -04:00
Henry Zhu
ce2335604c Merge pull request #5761 from babel/b7-10
Babylon 7 alpha.10
2017-05-25 14:29:25 -04:00
Henry Zhu
51f3ab45c4 [skip ci] 2017-05-25 12:54:06 -04:00
Buu Nguyen
8abe061fab Support specifying minimum Node version a test requires (#5765) 2017-05-25 11:59:00 -04:00
Brian Ng
7945c53389 Merge pull request #327 from yavorsky/2.0-stderr
Consider stderr for debug fixtures.
2017-05-25 08:49:46 -05:00
Aditya Vohra
bf9baa182b Change regeneratorRuntime to _regenerator2.default in transform runtime README [skip ci] (#5767) 2017-05-25 08:34:31 -05:00
Peeyush Kushwaha
ee389384bc Update regenerator test relying on wrong semantics
Broken by fix to switch statements in block scoping
2017-05-25 13:51:13 +05:30
Peeyush Kushwaha
72d83acc07 Properly convert continue statements in switch
Ignore just non-label break statements in a switch, and allow continue
statments and lablled break statements.

Fixes #5725
2017-05-25 13:49:29 +05:30
Artem Yavorsky
9062995324 README: Add string type as valid node target value (#337) [skip ci] 2017-05-24 07:48:53 -04:00
Buu Nguyen
cfe0a84e2b Update doc per review feedback (#5766) [skip ci] 2017-05-23 16:47:09 -05:00
Buu Nguyen
4ce24c041a Minor improvements to grammar, verbiage and others (#5764) [skip ci] 2017-05-23 16:34:50 -04:00
Brian Ng
3563823870 Print decorators before ExportDeclaration 2017-05-23 10:37:38 -05:00
Brian Ng
9d95b3faae 518-spread-assignable 2017-05-23 09:09:01 -05:00
Brian Ng
f8f2ead450 358-decorator-exported-class 2017-05-23 08:57:03 -05:00
Brian Ng
32c4cdf016 339-spread-obj-pattern-assignable 2017-05-23 08:43:15 -05:00
Brian Ng
afe85c11a7 474-transform 2017-05-23 08:08:07 -05:00
Brian Ng
01d5d5ebc7 499-transform 2017-05-23 07:58:22 -05:00
Bo Lingen
8772e7fb89 Fix ObjectProperty patterns (#5762)
* Fix Object Property values to allow Patterns

* Add RestElement to allowed types

* add tests for nested pattern structures
2017-05-22 20:24:19 -04:00
Brian Ng
889a505ffd 377-async-func-decl 2017-05-22 17:35:01 -05:00
Brian Ng
6c6ee74eb0 351-class-prop 2017-05-22 17:26:15 -05:00
Brian Ng
48ce5bcf1c 499-super-class-prop 2017-05-22 16:59:16 -05:00
Brian Ng
ec596604bc 474-export-default-exotic 2017-05-22 16:54:23 -05:00
Henry Zhu
d365dad341 add some tests 2017-05-22 17:48:20 -04:00
Samuel Reed
853b9f8ece Fix multiple var declarations in transform-react-constant-elements (#5732) (#5756)
This was broken by a legacy attachment path conditional that
is no longer needed.
2017-05-22 17:46:53 -04:00
Henry Zhu
6620612b66 update to beta.10 2017-05-22 17:13:54 -04:00
Henry Zhu
9709c8d932 7.0.0-beta.10 2017-05-22 17:02:42 -04:00
aardito2
557696da3a Fixed disappearing comments following a trailing comma on the last property of an object literal or the last argument of a call expression (#478) 2017-05-22 17:02:02 -04:00
Henry Zhu
0f66dbd4b6 add changelog label data [skip ci] 2017-05-22 17:01:48 -04:00
Henry Zhu
1a92c1f34c 7.0.0-beta.9 2017-05-22 14:57:21 -04:00
Andy
2541ab5fda Simplify PrivateName and ClassPrivateProperty types (#532)
* Simplify PrivateName and ClassPrivateProperty types

* ClassPrivateProperty is not a ClassMemberBase; can't be static, can't be computed
2017-05-22 13:42:32 -04:00
Diego Ferreiro Val
01da62283c Modify grammar to support Private Fields proposal: (#260)
* Modify grammar to support Private Fields proposal:
- Adding optional plugin `classPrivateProperties`
- Adding PrivateName type identifier
- Adding ClassPrivateProperty to ClassBody
- Allow PrivateName in MemberExpression
- Allow PrivateName as a reference
- Adding tests

* Remove unnecesary liberal parameter

* Guarding for plugin dependecy for future versioning

* update spec.md [skip ci]

* move comment [skip ci]

* remove unused param [skip ci]

* Refactor PrivateName to contain Identifier in name property
2017-05-22 11:33:48 -04:00
Brian Ng
eaf8d4589a 1.5.1 2017-05-22 09:30:25 -05:00
Brian Ng
6ad103b756 Update changelog for v1.5.1 [skip ci] 2017-05-22 09:29:08 -05:00
Brian Ng
fa69bfc755 Compile with loose mode (#332) 2017-05-22 10:19:55 -04:00
Brian Ng
c6eab0c206 Merge pull request #5758 from STRML/test-react-constant-elements-unreferenced-param
Add regression test for transform-react-constant-elements (#5552)
2017-05-21 13:38:52 -05:00
Samuel Reed
83232bb4ff Add regression test for transform-react-constant-elements (#5552) 2017-05-21 11:47:35 -05:00
Justin Ridgewell
5b261849e0 Merge pull request #5755 from u9lyfish/patch-1
Fix broken tables in README.md
2017-05-20 16:57:53 -04:00
Brian Ng
0fcfcc5bf2 1.5.0 2017-05-20 14:19:39 -05:00
Brian Ng
3b4c36f9e4 Update changelog for v1.5 [skip ci] 2017-05-20 14:07:32 -05:00
Brian Ng
08d397af14 Merge pull request #321 from babel/backport-string-versions
Backport support for target versions as strings
2017-05-20 14:05:24 -05:00
Artem Yavorsky
842d0540a4 Backport: use preset-env and remove flow-strip-types (#324)
* es2015 -> env.

* Remove transform-flow-strip-types plugin.
2017-05-20 14:04:48 -05:00
u9lyfish@gmail.com
58c686378d Fix broken tables in README.md 2017-05-20 23:44:51 +08:00
James Lal
6928695735 Flow comments import export (#5675)
* Add failing test for `export type .. from ...; `

* Add support for flow comment : `export ... from '...'`
2017-05-20 09:10:39 -04:00
Brian Ng
9a92933589 Fix incorrect property ordering with obj rest spread on nested (#5750) 2017-05-20 09:08:23 -04:00
Artem Yavorsky
9b9318493e Merge branch 'master' into backport-string-versions 2017-05-20 13:04:01 +03:00
Artem Yavorsky
a3654478df Merge pull request #329 from babel/bump-electron
Bump electron-to-chromium to 1.3.11
2017-05-20 12:59:33 +03:00
Justin Ridgewell
943fa8aa73 Merge pull request #5753 from jridgewell/7.0
Hoist toSequenceExpression's convert helper (#5693)
2017-05-19 21:54:06 -04:00
Justin Ridgewell
58216f5022 Hoist toSequenceExpression's convert helper (#5693) 2017-05-19 17:35:05 -04:00
Brian Ng
a4e6f90d06 Use ensureDirSync in smoke test 2017-05-19 16:28:30 -05:00
Brian Ng
0781f711d0 Support target versions as strings (#231) 2017-05-19 16:28:30 -05:00
Brian Ng
72591a0ebd Bump electron-to-chromium 2017-05-19 16:26:47 -05:00
Justin Ridgewell
5f866f2d92 Hoist toSequenceExpression's convert helper (#5693)
* Hoist toSequenceExpression's convert helper

* Adds tests

* lint

* dev-depend on babel-generator
2017-05-19 17:03:33 -04:00
Justin Ridgewell
8cd4a62c02 Transform do-expressions on exit (#5694)
* Transform do-expressions on exit

This allows other transforms (notably, block scoping) to do their magic
first, possibly saving closures.

Also fixes a bug with declaring duplicate bindings (de-opts now).

* Use strict in exec test

* lint
2017-05-19 16:58:15 -04:00
Buu Nguyen
c474fd48e1 Fix issue semi-colon gets inserted unnecessarily (#5749)
* Fix issue semi-colon gets inserted unnecessarily

* Simplify if condition a bit
2017-05-19 16:54:51 -04:00
Brian Ng
37c8da674a Bump prettier (#289) 2017-05-19 15:40:19 -05:00
Brian Ng
2788a914f6 Add process to test sandbox (#5410) 2017-05-19 15:13:23 -04:00
Justin Ridgewell
09229db794 Cleanup template-literals transform (#5748)
Avoid `Array#shift`s and prefer `const`s when possible.
2017-05-19 14:57:15 -04:00
Brian Ng
a52d34023c Add spec option example for transform-es2015-arrow-functions [skip ci] (#5698) 2017-05-19 14:56:56 -04:00
Mauro Bringolf
8facda4505 Added more types to API signatures (#5733) [skip ci] 2017-05-19 14:53:43 -04:00
Mauro Bringolf
943b7371a1 Completed return types for all NodePath family methods (#5739) [skip ci] 2017-05-19 14:52:13 -04:00
Kevin Gibbons
6c4acecf00 Fix #437: only prohibit 'export type from "module" ' when flow is enabled (#438)
* Only prohibit 'export type' when flow is enabled

* Fix lint
2017-05-19 10:05:44 +02:00
Artem Yavorsky
ddd6d66bc6 Remove old comments. 2017-05-18 16:45:33 +03:00
Artem Yavorsky
d320d0c587 Fix stderr file reading. 2017-05-18 16:43:37 +03:00
Artem Yavorsky
4d96adaf3c Update stderr for usage with import. 2017-05-18 16:43:09 +03:00
Artem Yavorsky
b0ff26985f Add test for stderr. 2017-05-18 16:20:25 +03:00
Artem Yavorsky
84c38182ad Add usage with import ‘babel-polyfill’ fixture. 2017-05-18 16:20:17 +03:00
Brian Ng
dcef4012a0 Disallow SpreadElement inside dynamic import (#529)
* Disallow SpreadElement inside dynamic import

* tweak error message
2017-05-17 12:07:09 -04:00
Brian Ng
14e9fbf345 Tweak version mappings to match compat-table updates (#323) 2017-05-17 10:26:23 -05:00
James Browning
23ff45fcfa Spec fix as BindExpression only have a single object/callee not an Array (#436) [skip ci]
* Fixed spec.md to reflect that BindExpressions only have a single node not an array for their properties

* Added semicolons to BindExpression props
2017-05-17 10:25:10 -04:00
Max Schaefer
b08fdf87e8 Fix handling of anonymous parameters in flowParseObjectTypeMethodish. (#526)
By analogy with `flowParseFunctionTypeParams` (cf. commit 407c97c9c2).
2017-05-16 22:53:13 +02:00
Karl Cheng
0667160b11 Fix optimisation of shadowed rest parameters
The arguments of a function would be unnecessarily copied if there was
a nested function that had a parameter with the same identifier as the
rest parameter for the outer function. This checks the scope of the
parameter is correct before deoptimising.

Fixes: https://github.com/babel/babel/issues/5656
Refs: https://github.com/babel/babel/issues/2091
2017-05-16 22:39:13 +10:00
Artem Yavorsky
e1cb75989f Add flow (#269) 2017-05-15 08:59:48 -05:00
greenkeeper[bot]
4ef964e066 Update cross-env to the latest version 🚀 (#520)
* chore(package): update cross-env to version 5.0.0

* Update yarn.lock
2017-05-14 20:03:20 +02:00
Andy
aa78011666 Fix type check errors (#521) 2017-05-14 19:59:56 +02:00
Andy
d95b5fb83d Remove unused parameters from parseParenAndDistinguishExpression (#522) 2017-05-14 19:59:03 +02:00
Mauro Bringolf
ce6f67216e Add test cases for bad options in babel-preset-es2015 (#5720)
* Added testcases for bad 'spec' or 'module' option

* Corrected typo in test description
2017-05-14 16:21:37 +02:00
Sven SAULEAU
486563152c Merge pull request #5729 from Daniel15/patch-1
Lowercase "business model" in badge
2017-05-12 11:31:16 +02:00
Daniel Lo Nigro
11539e219b Lowercase "business model" in badge
For consistency with the other badges

Also removed a stray quotation mark.
2017-05-11 21:48:26 -07:00
Logan Smyth
086cdfc705 Add more compat logic for Rest/SpreadElement for 6.x vs 7.x 2017-05-11 18:24:34 -07:00
Andy
a738870472 Type-check ExpressionParser (#488)
* Type-check ExpressionParser

* Improve test coverage
2017-05-11 16:30:21 +02:00
Andy
7a8b64c0d3 Type-check StatementParser (#489) 2017-05-11 16:28:12 +02:00
Daniel Tschinder
f6020aecbf Convert argument of SpreadElement correctly to assignable (#518) 2017-05-11 00:45:08 +02:00
Daniel Tschinder
d605a9a4de Fix flow errors (#517) 2017-05-11 00:04:43 +02:00
Andy
1773ca7457 Type-check State (#492) 2017-05-10 21:55:09 +02:00
greenkeeper[bot]
8862c96237 Update flow-bin to the latest version 🚀 (#497)
* chore(package): update flow-bin to version 0.45.0

https://greenkeeper.io/

* Update yarn.lock
2017-05-10 21:50:30 +02:00
Andy
1f113fd650 Fix FunctionDeclaration spec: Id may be null (#503)
* Fix FunctionDeclaration spec: Id may be null

* Use OptFunctionDeclaration and OptFunctionExpression
2017-05-10 21:29:05 +02:00
Alex Rattray
4e776bf00b Better error message for anonymous class declarations (#509) 2017-05-10 21:26:38 +02:00
Brian Ng
ea22361673 Bump browserslist. (#319) 2017-05-10 13:59:05 -05:00
Daniel Tschinder
7f9eb50b2c Fix changelog 2017-05-10 18:40:12 +02:00
Daniel Tschinder
2b77908ac9 Merge branch '6.x'
# Conflicts:
#	CHANGELOG.md
#	package.json
#	src/parser/expression.js
#	src/parser/statement.js
#	src/plugins/flow.js
#	test/fixtures/flow/type-annotations/135/expected.json
#	test/fixtures/flow/type-annotations/136/expected.json
#	test/fixtures/flow/type-annotations/139/options.json
#	test/fixtures/flow/type-generics/1/expected.json
#	test/fixtures/flow/type-generics/2/expected.json
2017-05-10 18:39:32 +02:00
Daniel Tschinder
28985e7acc 6.17.1 2017-05-10 18:25:58 +02:00
Daniel Tschinder
934a3a78b6 Update changelog 2017-05-10 18:25:13 +02:00
Daniel Tschinder
9a1ef48ae3 Merge pull request #516 from babel/backport2
Backport #433 #473 + typo
2017-05-10 18:22:06 +02:00
Brian Ng
1077a7304e Fix typo in flow spread operator error [skip ci] 2017-05-10 18:20:06 +02:00
Alex Kuzmenko
b98f463aa7 Fixed invalid number literal parsing (#473)
* Fixed invalid number literal parsing

* Don't ignore period or E characters after octal numbers
cherry-pick fix from acorn

* Fix tests
2017-05-10 18:14:09 +02:00
Alex Kuzmenko
406c3dabc0 Fix number parser (#433)
Fixed number parser #2

Added one more test
2017-05-10 18:13:46 +02:00
Daniel Tschinder
8c885eaef6 Merge pull request #515 from babel/backport1
Backport #499, #510, #475, #479
2017-05-10 18:03:58 +02:00
Brian Ng
7c56c24bb0 Ensure non pattern shorthand props are checked for reserved words (#479) 2017-05-10 16:59:09 +02:00
Brian Ng
67db275c94 Remove jsx context when parsing arrow functions (#475) 2017-05-10 16:56:21 +02:00
Brian Ng
4a29ccdd1a Allow super in class properties (#499) 2017-05-10 16:46:45 +02:00
Brian Ng
63412e54f4 Allow flow class field to be named constructor (#510) 2017-05-10 16:46:38 +02:00
Brian Ng
9d1f819320 Allow flow class field to be named constructor (#510) 2017-05-10 16:18:08 +02:00
Diogo Franco
899a754bef Correct the validator for ArrayPattern (#5722)
The elements of the `elements` array should be either `Identifier`, `Pattern` or `RestElement`, but the validator was requiring `Expression`. It happened to work for `Identifier` since an `Identifier` is an `Expression`, but not for the other possible pattern elements.
2017-05-10 10:50:01 +09:00
Robert Brignull
5633e3c4f6 Fix typo a => b 2017-05-07 15:58:24 -07:00
Logan Smyth
6646707e01 Fix 'Unhandled promise rejection (rejection id: 1): ReferenceError: setTimeout is not defined' warning. 2017-05-05 14:13:11 -07:00
Logan Smyth
14584c218c Kill the "shadow-functions.js" internal plugin in favor of an explicit helper (#5677)
* Handle arrow function processing via shared API rather than default plugin.

* Fix a few small PR comments.

* Preserve existing spec arrow 'this' rewrites, and support spec in subclass constructors.
2017-05-05 13:27:18 -07:00
Steven Hargrove
d5aa6d3ff8 Fix for #4943 "Calling an async function with default parameter as function for arguments checking handled synchonous" (#5688)
* moved applying arguments inside new Promise handler block

* updated test fixture to reflect change

* corrected the apply to use correct scope and arguments

* added regression test for issue #4943, added async-to-generator/async-default-arguments test

* added regression test for issue #4943

* switched back to using arrow function, since now pointing to v7 release base branch

* simplified async-to-generator regression test for issue #4943, imrproved change to self/arguments refs by using arrow function on returned promise

* updated text fixtures

* removed es2015 preset usage from issue #4943 regression exec test

* added use strict to test fixture

* added use strict to test fixture

* added destructing transform to test options

* removed use strict from exec test

* added parameters & destructing transforms to test
2017-05-03 21:44:41 -07:00
Sven SAULEAU
0e12f565da Document babylon plugin system (#507) [skip ci]
* docs: document babylon plugin system

* [skip ci]

* [skip ci]

* [skip ci] it's -> its

* [skip ci]
2017-05-03 10:56:22 -04:00
Diogo Franco
86a53773f1 Add function name to spec-transformed arrow functions (#5620)
While it may appear that this should be done by es2015-function-name,
another way to think about it is that es2015-function-name implements
the naming that javascript engines are supposed to do; and javascript
engines cannot name function expressions that are the object of a
member expression.
2017-05-03 11:50:37 +09:00
Brian Ng
d33c82781a Allow super in class properties (#499) 2017-05-02 14:41:10 -04:00
Andy
9660f06b25 Don't add 'shorthand' property to ObjectMethod (#506) 2017-05-02 14:39:21 -04:00
Andy
3a6b77f374 Don't add 'await' property to ForInStatement (#504) 2017-05-02 14:37:58 -04:00
Brian Ng
79c1eed8c1 Fix incorrect property ordering with obj rest spread on nested (#5685) 2017-05-02 14:04:37 -04:00
Brian Ng
d6202dc741 Merge branch 'master' into 2.0 2017-05-02 09:13:18 -05:00
Artem Yavorsky
782d933d5f Debug enhancements (#310) 2017-05-02 08:35:37 -05:00
Samuel Reed
c307bbb3a9 Fix PathHoister hoisting before a same-scope variable declaration.
Seems we didn't have tests running for this very simple case.

Also fixes #5520
2017-05-01 14:32:11 -07:00
Samuel Reed
3570ba7c28 Fix PathHoister error attaching after export declarations.
Fixes #5369.

See also 4ee385e96c/packages/babel-plugin-transform-class-properties/src/index.js (L167)
2017-05-01 14:22:38 -07:00
Brian Vaughn
526a7d20ef Updated transform-react-display-name for createReactClass addon (#5554)
* Updated transform-react-display-name for ReactCreateClass addon

* Tweaked description for transform-react-display-name plugin

* Changed ReactCreateClass to createReactClass
2017-05-01 17:16:17 -04:00
Samuel Reed
c3e8cc8ad6 Fix PathHoister error attaching after export declarations.
Fixes #5369.

See also 4ee385e96c/packages/babel-plugin-transform-class-properties/src/index.js (L167)
2017-05-01 12:41:29 -07:00
Bradley Farias
7ca81700f7 add .mjs to list of well known extensions
this is to conform to the plan of the Node.js EP
2017-05-01 09:43:49 -07:00
Henry Zhu
685006433b Remove babel-helper-builder-conditional-assignment-operator-visitor, unused in babel [skip ci] (#5676) 2017-04-27 18:04:00 -04:00
Patrick Williams
48de6b32de use find-cache-dir for babel-register cache (#5669) 2017-04-27 16:14:59 -04:00
Andy
e81b5f8af2 Type-check flow plugin (#495)
* Type-check flow plugin

* Fix typo
2017-04-27 12:04:06 -04:00
Henry Zhu
5ae165d489 update changelog [skip ci] 2017-04-27 11:16:48 -04:00
Andy
cccee00606 Type-check JSX plugin (#496)
* Type-check JSX plugin

* Improve test coverage
2017-04-27 10:58:33 -04:00
Andy
8288f7d9e4 Type-check tokenizer/types.js (#493) 2017-04-27 10:53:17 -04:00
Andy
cd5bfb786a Type-check estree plugin (#494) 2017-04-27 10:40:51 -04:00
Andy
d8ff63181e Type-check LValParser (#487) 2017-04-27 10:37:08 -04:00
Andy
e1a06544bc Type-check utils (#491)
* Type-check utils

* Improve test coverage
2017-04-27 10:23:13 -04:00
Sasha Aickin
925b6448e0 Fix operator processing in object super. 2017-04-26 20:14:40 -07:00
Andy
47cade874c Type-check options.js and index.js (#490) 2017-04-26 17:18:17 -04:00
Sebastian McKenzie
60adcd68a0 Port flow object spread from #418 to 6.x (#5653)
* Add support for object type spread

* Type spread: remove variance and add stripping test

* Fix tests
2017-04-26 17:16:38 -04:00
Brian Ng
e54c30c285 Bump babel to alpha.9 (#309) 2017-04-26 17:03:53 -04:00
Brian Ng
aad13388c7 Add forceAllTransforms option and deprecate Uglify target (#264) 2017-04-26 14:11:53 -05:00
Brian Ng
285b35e8b3 Bump compat-table (#307) 2017-04-25 17:14:19 -05:00
Andy
7627c5a2be Type-check UtilParser (#485) 2017-04-25 18:01:55 -04:00
Andy
3199ceecdb Type-check node.js (#486) 2017-04-25 17:54:47 -04:00
Andy
34acecca2e Type-check CommentsParser and LocationParser (#484) 2017-04-25 16:07:01 -04:00
Artem Yavorsky
7624648623 Add debug-fixtures and test/tmp to .eslintignore (#305) 2017-04-25 09:36:51 -05:00
Brian Ng
8895828bc3 Merge pull request #5659 from aretecode/patch-1
[Doc PR] naming fix in example
2017-04-25 08:04:25 -05:00
James
b4f3d943b2 -> parsedAst 2017-04-24 03:24:06 -07:00
James
505d639da7 string -> sourceCode, ast -> generatedCode
9a576ca932
2017-04-24 01:16:02 -07:00
James
9a576ca932 back to babylon 2017-04-23 21:28:42 -07:00
Brian Ng
68967bf515 Remove jsx context when parsing arrow functions (#475) 2017-04-24 00:45:19 +02:00
Andy
c4fb3fe742 Convert each file with parser methods to a class in an inheritance chain (#481) 2017-04-24 00:40:49 +02:00
Andy
2c1193b7da Move plugin helpers out of Parser.prototype and into the plugin itself (#482) 2017-04-24 00:34:35 +02:00
Daniel Tschinder
fce92fa1ad Switch to pirates for babel-register. (#3670)
* Switch to pirates for babel-register.

Pirates is a simple module that enables easy require hooking. It makes sure that your require hook works properly. It also makes the implimentation of babel-register a lot simpler.

For more on pirates: http://ariporad.link/piratesjs

* Use modified version of pirates.

* Switch back to stable version

* Initial tests for babel-register

* Fix tests to work in new test env

* Fix for new ignore behaviour

* Update pirates to 3.0.1
2017-04-24 00:25:44 +02:00
James
a18ee8a9a5 [skip ci] babylon -> babel, ast -> parsedAst
align the naming, allow the example to be usable without change
2017-04-22 22:15:59 -07:00
James
446ee06680 [readme] change code -> string
because code is declared as const twice
2017-04-22 22:08:55 -07:00
Andy
8601f2f7da Add type declarations for AST nodes (#480) 2017-04-21 19:48:09 +02:00
Brian Ng
bc0719a145 Ensure non pattern shorthand props are checked for reserved words (#479) 2017-04-21 16:25:34 +02:00
Andy
d975b91a54 Refresh property ordering in baselines (#454) 2017-04-21 15:59:46 +02:00
Alex Kuzmenko
00d6db9fbb Fixed invalid number literal parsing (#473)
* Fixed invalid number literal parsing

* Don't ignore period or E characters after octal numbers
cherry-pick fix from acorn

* Fix tests
2017-04-21 15:22:50 +02:00
Daniel Tschinder
d1a5220b89 Add support for declare export + fixes (#224)
* Add support for declare export

* Do not allow declare module inside declare module

* Reallow module exports outside module

* Add handling of `declare export default`

Add check for multiple module.export declarations

* Disallow export let/const/type

Refactor parsing object properties to share more code and add support
for getters and setters

* Rename tests

* Update test fixtures

* Optimize for performance

* disallow declare export interface outside of module

* Refactor code to be more readable and less lookahead

* Add comments

* Add test for export star as

* Test for number literal getter/setter

* Add more tests

* Fix tests

* Allow union types and correctly eat semi after type

* Use non computed keys

* Fix tests
2017-04-21 14:41:59 +02:00
greenkeeper[bot]
28ccd05bab Update flow-bin to the latest version 🚀 (#468)
* chore(package): update flow-bin to version 0.44.0

https://greenkeeper.io/

* Update yarn.lock
2017-04-21 14:26:30 +02:00
Andy
5e156310ca Type-check tokenizer/index.js (#460)
* Type-check tokenizer/index.js

* Update test baselines
2017-04-21 14:25:31 +02:00
Andy
ad284d5c36 Convert each plugin to a function from a class to an overriding class (#459)
* Convert each plugin to a function from a class to an overriding class

* Handle undefined options

* Fix indentation

* Fix double space
2017-04-21 13:53:51 +02:00
Conrad Buck
8434f89bc0 Add support for object type spread (#5525)
* Add support for object type spread

* Type spread: remove variance and add stripping test
2017-04-20 11:59:45 -04:00
Sebastian McKenzie
a2c143299a Add changelog 2017-04-20 16:43:47 +01:00
Sebastian McKenzie
2e17e5bc39 6.17.0 2017-04-20 16:41:23 +01:00
Sebastian McKenzie
a4ca1cc645 Cherry-pick #418 to 6.x (#476)
* Add support for flow type spread (#418)

* Add support for flow type spread

* Broaden spreadable types from primary to all, more tests

* Eliminate variance sigil for type spreads, better errors, fix tests

# Conflicts:
#	src/plugins/flow.js

* Fix tests
2017-04-20 16:40:55 +01:00
Christopher Karper
14ed03127c Fix object destructuring in param arrays (#5650) 2017-04-20 10:45:45 -04:00
Artem Yavorsky
ccc31f7878 Update useBuiltIns : true warning. (#300) 2017-04-20 09:18:19 -05:00
Brian Ng
2b9b69dc32 Merge branch 'master' into 2.0 2017-04-20 08:20:31 -05:00
Brian Ng
2ef436641e Ensure locations in ObjectTypeAnnotations do not include semi or comma (#472) 2017-04-19 14:08:51 +02:00
Brian Ng
17f2a2036c Allow namespace exotic to be exported as default (#474) 2017-04-19 13:59:49 +02:00
Logan Smyth
0eae6a432c Remove merge helper and add more type declarations. (#5649) 2017-04-18 19:08:39 -07:00
Logan Smyth
6af8e64711 Typecheck much more of the config loading process (#5642)
* Add type declarations for micromatch.

* Enable Flowtype on all config loading.

* Remove unneeded comments.
2017-04-18 09:28:18 -07:00
Henry Zhu
c46ef658b5 update to alpha.9 (#5639) 2017-04-18 11:22:31 -04:00
Henry Zhu
50539f86c0 2.0.0-alpha.7 2017-04-18 10:58:41 -04:00
Brian Ng
79a0f8c458 Add debug messaging to usage plugin (#291) 2017-04-18 10:58:05 -04:00
Henry Zhu
62375cdf12 v7.0.0-alpha.9 2017-04-18 10:41:30 -04:00
Logan Smyth
d1d812edff Fix a regression from adding negation support in #5625. (#5641) 2017-04-17 18:13:37 -07:00
Henry Zhu
ba6fa252c0 2.0.0-alpha.6 2017-04-17 16:55:05 -04:00
Henry Zhu
a35684988b update to alpha.8 (#293) 2017-04-17 15:45:35 -04:00
Henry Zhu
25ae8c8554 v7.0.0-alpha.8 2017-04-17 15:12:31 -04:00
Logan Smyth
2b86d353d6 Restrict Babel's plugins/presets to a single target. (#5547) 2017-04-17 11:45:49 -07:00
Logan Smyth
c59e9f5f0e Merge pull request #5608 from loganfsmyth/config-cache
Cache configs based on mtime and allow .babelrc.js functions
2017-04-17 11:43:31 -07:00
Logan Smyth
1c078e5a76 Add tests for caching API and .babelrc.js functions. 2017-04-17 11:20:34 -07:00
Artem Yavorsky
e54cef60a5 Remove hidden files from debug fixtures targets. (#287) 2017-04-17 12:07:29 -04:00
Henry Zhu
6a478c48fb Deprecate: move babel-preset-latest to babel/babel-archive (#5638) [skip ci] 2017-04-17 11:09:04 -04:00
Sven SAULEAU
bc9edd139f fix: move tests in experimental 2017-04-17 13:33:48 +02:00
Sven SAULEAU
b2fdd944fe feat: add tests 2017-04-17 13:33:00 +02:00
Sven SAULEAU
0927e24ac6 Merge remote-tracking branch 'kristofdegrave/nullPropagation' into feat-optional-chaining 2017-04-17 13:21:35 +02:00
Xavier Damman
28831c144d added opencollective backers and sponsors (#5572) [skip ci] 2017-04-15 12:51:31 -04:00
Sven SAULEAU
7b51979152 feat: add optional MemberExpression 2017-04-15 18:19:43 +02:00
Logan Smyth
ad250ef10a Merge pull request #5602 from loganfsmyth/option-manager-cleanup
Refactor OptionManager to be a short class with a bunch of pure helper functions.
2017-04-14 14:25:45 -07:00
Logan Smyth
ccbb2eb8d4 Disallow cache configuration after handler evaluation. 2017-04-14 14:19:20 -07:00
Brian Ng
2c5ff923d1 Use Sets for polyfills and transformations (#274) 2017-04-14 13:07:05 -05:00
Brian Ng
c478c429ea 1.4.0 2017-04-14 10:43:19 -05:00
Brian Ng
88856fc1f2 Update changelog [skip ci] 2017-04-14 10:37:22 -05:00
Diogo Franco
75db91940e Support spec option (#98) 2017-04-14 10:11:36 -05:00
Artem Yavorsky
64cfc43883 Update README according to new useBuiltIns values. (#288) [skip ci] 2017-04-14 08:43:30 -04:00
Logan Smyth
2774cb7d42 Allow function-based .babelrc.js files. 2017-04-13 20:17:32 -07:00
Logan Smyth
911027f289 Cache config files based on mtime rather than file content. 2017-04-13 20:17:31 -07:00
Brian Ng
1e11a32c44 Run smoke test for both entry and usage options (#286) 2017-04-13 22:04:08 -05:00
Henry Zhu
7acf4a46f0 make useBuiltIns: false default, rename true to 'usage' (#285) 2017-04-13 21:45:25 -05:00
Brian Ng
1fca73a1b7 Move polyfill debug into useBuiltInsEntry plugin (#280) 2017-04-13 17:42:02 -04:00
Henry Zhu
e4d2c4e346 account for web.iterable (#283)
* account for web.iterable

* extra test, remove unncessary warning
2017-04-13 17:39:34 -04:00
Logan Smyth
2163acd6c2 Refactor static file processing with a helper wrapper. 2017-04-13 13:23:36 -07:00
Dara Hak
4648bb6022 Clarify note about loading polyfills only once (#282) 2017-04-13 11:00:00 -05:00
Brian Ng
a139b12a86 Add a reminder about include/exclude options (#275)
* Add a reminder about include/exclude options [skip ci]

* include note about adding plugin [skip ci]
2017-04-13 11:08:44 -04:00
Evilebot Tnawi
f9517db461 Chore: reduce package size. (#281) [skip ci] 2017-04-13 11:05:59 -04:00
Logan Smyth
a2f334b9e9 Fix issue with #5625 2017-04-12 11:41:54 -07:00
Artem Yavorsky
3146b245ed Test arrow function inside generator. (#5605) 2017-04-12 11:13:58 -07:00
Logan Smyth
d1c954b36f Allow negation of ignore and only patterns. (#5625) 2017-04-12 11:10:33 -07:00
Artem Yavorsky
f51e082687 Merge pull request #273 from babel/compat-table
Bump compat-table for Edge 15 support
2017-04-12 12:57:23 +03:00
Brian Ng
9abd056ccd Bump compat-table for Edge 15 support 2017-04-11 16:40:36 -05:00
Artem Yavorsky
d60cd65213 Remove deprecated comment (#271) 2017-04-11 20:53:33 +03:00
Brian Ng
3dee64d1e1 Merge pull request #270 from babel/issue268
Add Android browser to name map
2017-04-11 12:40:36 -05:00
Brian Ng
2f28de5d70 Add Android browser to name map 2017-04-11 11:45:16 -05:00
Artem Yavorsky
de29bb374f Merge pull request #266 from babel/2.0-flow
Add initial flow setup
2017-04-11 12:32:51 +03:00
Brian Ng
1d8b6b043f Add initial flow setup 2017-04-10 21:13:04 -05:00
Brian Ng
243d5d1a02 Merge branch 'master' into 2.0 2017-04-10 15:23:20 -05:00
Logan Smyth
248c240998 Use clearer function name. 2017-04-10 10:01:01 -07:00
Logan Smyth
d7e10a3adc Misc refactoring of OptionManager. 2017-04-10 10:01:01 -07:00
Logan Smyth
d16991054e Pass the config through mergeOptions. 2017-04-10 10:01:01 -07:00
Logan Smyth
e13320ef73 Separate plugin/preset loading and plugin/preset evaluation. 2017-04-10 10:01:01 -07:00
Logan Smyth
adb903fd4b Standardlize plugin/preset result object. 2017-04-10 10:01:01 -07:00
Logan Smyth
75847306fd Expose passes as a first-class output of OptionManager. 2017-04-10 10:01:01 -07:00
Logan Smyth
1fecf286c6 Avoid the onResolve callback. 2017-04-10 10:01:01 -07:00
Logan Smyth
ac5c13c1c8 Move OptionManager statics to be module functions to the lack of sideeffects clearer. 2017-04-10 10:01:01 -07:00
Logan Smyth
258e82ca13 Expose a function rather than a class from option-manager. 2017-04-10 10:01:01 -07:00
Logan Smyth
86fc4fbc4f Avoid using OptionManager statics 2017-04-10 10:01:01 -07:00
Logan Smyth
ded4ca48cd Move .inherits handling to OptionManager. 2017-04-10 10:01:01 -07:00
Logan Smyth
2ea3338b8e Set a basic coverage rate to avoid tiny percentage changes from 'auto'. (#5619) 2017-04-10 09:58:44 -07:00
Andy
482b8155a3 Update test baselines (#461) 2017-04-10 11:24:34 -05:00
Brian Ng
637119a017 Fix typo in flow spread operator error [skip ci] 2017-04-10 10:48:51 -05:00
Henry Zhu
9732524aaf 2.0.0-alpha.5 2017-04-10 10:39:49 -04:00
Henry Zhu
444025a764 Merge pull request #263 from babel/coverage
Coverage + fixes
2017-04-10 10:39:01 -04:00
Henry Zhu
5d8a091336 fix code output 2017-04-10 10:10:21 -04:00
ssuman
412180e203 Increase the code coverage for traverse evaluation (#5363)
* When applied this commit will increase the code coverage for evaluation.js

* Fixing linting issues
2017-04-09 16:49:37 -07:00
Brian Ng
cd9bb7ba10 Ensure default exported classes keep entry in export table (#5488) 2017-04-09 16:39:15 -07:00
Erik Simmler
769eddc788 Avoid creating a new line comment when a block comment is preceded by a forward slash (#5562)
Fixes #5557
2017-04-09 16:36:18 -07:00
Jan Kassens
a1a795321a Update deprecation warning on flow bindings (#5615)
Babel 6 is at 6.24, doesn't seem like this is getting removed in version 6 anymore.
2017-04-09 16:11:06 -07:00
Daniel Kao
216cbf5bd6 Move syntax-dynamic-import to stage-3 (#5610) 2017-04-08 10:14:23 -04:00
Brian Ng
11b7db05fb Merge pull request #5613 from babel/backport-doc-changes
Backport doc changes
2017-04-08 09:08:47 -05:00
Henry Zhu
2e231bb976 Add changelog tags [skip ci] (#258) 2017-04-08 07:52:28 -04:00
Sven SAULEAU
ca435b6d48 Improve options documentation for babel-plugin-transform-runtime #5401 2017-04-08 10:18:44 +02:00
Sven SAULEAU
982aba38e4 [doc] Fix: comments in usage w/ options #5400 2017-04-08 10:18:01 +02:00
Sven SAULEAU
c1b3740707 document cache option for babel-register #5440 2017-04-08 10:16:55 +02:00
Sven SAULEAU
e9bc213b14 Update coffescript/register reference link address #5475 2017-04-08 10:15:43 +02:00
Sven SAULEAU
e2c2d7d742 Update babel-generator's README #5517 2017-04-08 10:14:56 +02:00
Sven SAULEAU
2cb4d08d19 Improve example of babel-plugin-transform-es2015-arrow-functions #5573 2017-04-08 10:14:19 +02:00
Sven SAULEAU
149acc40bd Remove incorrect docs. #5580 2017-04-08 10:13:47 +02:00
Sven SAULEAU
d40cb31685 Update transform-es2015-modules-commonjs doc #5588 2017-04-08 10:13:20 +02:00
Henry Zhu
5248f499b3 check if import/required babel-polyfill are removed 2017-04-07 17:47:43 -04:00
Brian Ng
3f5b1490c2 1.3.3 2017-04-07 16:38:16 -05:00
Brian Ng
d7c18cf9fa Fix and update changelog for v1.3.3 [skip ci] 2017-04-07 16:32:38 -05:00
Brian Ng
3c8eeec515 Ensure const-check plugin order (#257) 2017-04-07 16:25:34 -05:00
Brian Ng
5b64743864 Update changelog (#253) 2017-04-07 17:23:27 -04:00
Henry Zhu
88f18f5482 Merge pull request #255 from babel/2.0-update-smoke
Update smoke-test
2017-04-07 17:22:56 -04:00
Brian Ng
adf5045e66 Fix coverage 2017-04-07 16:15:00 -05:00
Brian Ng
4ed8904205 Use ensureDirSync in smoke test 2017-04-07 16:14:50 -05:00
Brian Ng
f2de82a368 Drop extends helper (#254) 2017-04-07 14:39:12 -05:00
Brian Ng
b2524770f9 Update smoke-test 2017-04-07 14:36:19 -05:00
Brian Ng
3c1836ab43 Support target versions as strings (#231) 2017-04-07 14:24:42 -05:00
Artem Yavorsky
bfe22a945a Merge pull request #252 from yavorsky/electron-string
Support electron version in a string format.
2017-04-07 19:43:07 +03:00
Henry Zhu
79573baa16 2.0.0-alpha.4 2017-04-07 12:42:43 -04:00
Artem Yavorsky
1e4e071c25 Support electron version in a string format. 2017-04-07 19:29:49 +03:00
Henry Zhu
556b3743f6 fix lint [skip ci] 2017-04-07 12:01:11 -04:00
Henry Zhu
d71169f3b0 Merge pull request #241 from babel/add-used-built-ins
Breaking: make current "useBuiltIns" auto import only used + necessary polyfills per file
2017-04-07 11:23:59 -04:00
Henry Zhu
f8da5e3457 v6.24.1 2017-04-07 11:19:02 -04:00
Henry Zhu
c63c2fc49b fix warning, readme [skip ci] 2017-04-07 10:25:32 -04:00
greenkeeper[bot]
344f070445 Update ava to the latest version 🚀 (#450)
* chore(package): update ava to version 0.19.0

https://greenkeeper.io/

* Fix tests for latest ava
2017-04-07 15:52:19 +02:00
greenkeeper[bot]
aef9e4fb5c Update flow-bin to the latest version 🚀 (#448)
* chore(package): update flow-bin to version 0.43.0

https://greenkeeper.io/

* Update yarn.lock
2017-04-07 15:02:11 +02:00
Sven SAULEAU
0b917c00d6 Merge pull request #5573 from exacs/docs-babel-plugin-transform-es2015
Improve example of babel-plugin-transform-es2015-arrow-functions
2017-04-07 08:17:43 +02:00
Henry Zhu
afa3ad97d1 update plugins to latest alpha 2017-04-06 14:36:01 -04:00
Henry Zhu
5cbe963dde account for computed variables in properties 2017-04-06 14:32:12 -04:00
Henry Zhu
2a874dff8c fix the fixtures after PR was merged 2017-04-06 14:14:15 -04:00
Andy
4bf18ccbea Simplify cd commands (#452) [skip ci] 2017-04-06 13:48:20 -04:00
Henry Zhu
200edc8e8c move debug check 2017-04-06 12:02:21 -04:00
Henry Zhu
88d4df437e use a Set 2017-04-06 12:01:18 -04:00
Andres Suarez
f0dc710a46 Remove unnecessary returns in asyncToGenerator helper (#5548)
* Remove unnecessary returns in asyncToGenerator helper

* Reuse "then" callbacks in asyncToGenerator helpher
2017-04-06 11:40:55 -04:00
MrSpider
fd3a2c285a Fix replacing function declaration in export default (fixes #4468) (#5456) 2017-04-06 11:40:31 -04:00
Henry Zhu
a48cf8b53f fix warning + readme [skip ci] 2017-04-06 11:38:29 -04:00
Henry Zhu
cb1c5eaf97 validate useBuiltIns against true,false,entry and test 2017-04-06 11:21:06 -04:00
Henry Zhu
3534bc872d Merge pull request #5567 from aickin/update-regenerator-transform
Update regenerator-transform to new version
2017-04-06 11:18:03 -04:00
Diogo Franco
452f8f150c Always use the native (or polyfilled) Promise in transform-async-to-generator (#5536)
* Always use the native (or polyfilled) Promise in transform-async-to-generator

Fixes #5531

* Simplify scope handling to only un-shadow the Program's Promise

Only the helper needs to see the native Promise.
2017-04-06 11:17:31 -04:00
Daniel Tschinder
66f8546107 Add test for regression 4219 2017-04-06 15:51:17 +02:00
Henry Zhu
bf31fff83e add imports as built-ins are found instead of at program exit 2017-04-05 19:35:02 -04:00
Henry Zhu
38fa457a88 use error messages, only log instance methods in debug 2017-04-05 17:58:54 -04:00
Henry Zhu
c732f5e1d0 v7.0.0-alpha.7 2017-04-05 17:13:26 -04:00
Henry Zhu
9acbcccff8 update issue template [skip ci] (#5591) 2017-04-05 15:26:26 -04:00
Logan Smyth
1c07efb5fc Use a .babelignore to skip compiling lib and fixtures. (#451) 2017-04-05 15:16:51 -04:00
Brian Ng
ae0681aa3f Merge pull request #5588 from babel/xtuc-patch-2
Update transform-es2015-modules-commonjs doc
2017-04-05 09:48:14 -05:00
Sven SAULEAU
beae0ff9ba docs: [skip ci] type in plugin's name 2017-04-05 16:43:56 +02:00
Henry Zhu
8f848b4b32 add individual polyfill files (#5584)
* add individual polyfill files

* rename files

* use preset-env for the script [skip ci]
2017-04-05 10:11:58 -04:00
Henry Zhu
f1bf68364c useBuiltIns: true is now useBuiltIns: entry, and turn on useBuiltIns: true on default 2017-04-04 18:17:07 -04:00
Logan Smyth
d39400c9d5 Separate config/plugin loading from config processing. (#5563) 2017-04-04 14:48:48 -07:00
Logan Smyth
9155c613cb Change babel-register default ignore to cwd content. (#5583) 2017-04-04 14:47:49 -07:00
Henry Zhu
016c9ad94c Breaking: account for https://github.com/babel/babel/pull/5584, only run on babel-polyfill not core-js
return babel-polyfill require instead of core-js
2017-04-04 17:42:16 -04:00
Daniel Tschinder
ed452b6f78 Update CONTRIBUTING.md 2017-04-04 23:16:59 +02:00
Daniel Tschinder
b2ced1d6bd Update babylon to latest beta (#5585) 2017-04-04 22:32:31 +02:00
Daniel Tschinder
4147c01ac0 7.0.0-beta.8 2017-04-04 22:08:28 +02:00
Daniel Tschinder
c8ac8abad7 Update yarn.lock 2017-04-04 22:07:44 +02:00
Henry Zhu
f33bea1363 remove unncessary check 2017-04-04 14:17:34 -04:00
Henry Zhu
7df557a269 add instance method tests 2017-04-04 14:16:29 -04:00
Henry Zhu
c10528254b create add-used-built-ins option 2017-04-04 14:16:28 -04:00
Artem Yavorsky
cf5ea69073 Merge pull request #245 from babel/existentialism-patch-1
Note babel plugin prefix handling in include/exclude [skip ci]
2017-04-04 17:32:41 +03:00
Brian Ng
804329e221 Note babel plugin prefix handling in include/exclude [skip ci] 2017-04-04 09:31:01 -05:00
Artem Yavorsky
624c2868c0 Allow use babel-plugin- prefix for include and exclude. (#242) 2017-04-04 09:24:25 -05:00
Brian Ng
7ad697cd86 Merge pull request #5580 from loganfsmyth/fix-docs
Remove incorrect docs.
2017-04-04 08:56:47 -05:00
Brian Ng
bdfa92464b Fix predicate attachment to match flow parser (#428) 2017-04-04 15:48:50 +02:00
Alex Rattray
cbf4203237 Add extra.raw back to JSXText and JSXAttribute (#344) 2017-04-04 15:47:59 +02:00
Alex Rattray
348cc5eeff Use raw value of JSXText and JSXAttribute (#5256) 2017-04-04 15:46:20 +02:00
Felix Yan
9b4c33d44e Fix a typo: occurences -> occurrences (#5575) 2017-04-03 22:38:12 -07:00
Logan Smyth
5576a8942b Remove incorrect docs. 2017-04-03 21:13:00 -07:00
Brian Ng
14b7f50e51 Fix rest parameters with array and objects (#424)
* Fix rest parameters with array and objects

* Add test for array rest  with object

* reuse parseBindingIdentifier
2017-04-03 22:27:43 +02:00
Alex Kuzmenko
22741a8068 Fix number parser (#433)
Fixed number parser #2

Added one more test
2017-04-03 22:25:29 +02:00
greenkeeper[bot]
9222562b82 Update cross-env to the latest version 🚀 (#443)
* chore(package): update cross-env to version 4.0.0

https://greenkeeper.io/

* Update yarn.lock
2017-04-03 22:23:44 +02:00
greenkeeper[bot]
786d73b2ce Update rollup-plugin-node-resolve to the latest version 🚀 (#445)
* chore(package): update rollup-plugin-node-resolve to version 3.0.0

https://greenkeeper.io/

* Update yarn.lock
2017-04-03 22:23:02 +02:00
Conrad Buck
213fdab063 Add support for flow type spread (#418)
* Add support for flow type spread

* Broaden spreadable types from primary to all, more tests

* Eliminate variance sigil for type spreads, better errors, fix tests
2017-04-03 22:05:05 +02:00
Carlos Saito
abcbb07357 Do not transform const to var
[skip ci]
2017-04-02 18:54:10 +02:00
Carlos Saito
4276462a07 Function without renaming
[skip ci]
2017-04-02 18:54:10 +02:00
Carlos Saito
95c65ec1cb Improve example of babel-plugin-transform-es2015-arrow-functions
[skip ci]
2017-04-02 14:27:15 +02:00
Logan Smyth
878a7c5fdb Add tests to test the plugin ordering. (#5571) 2017-03-31 18:52:58 -07:00
Brian Ng
83b85a3609 Merge branch 'master' into 2.0 2017-03-31 12:15:06 -05:00
Brian Ng
af2b162175 Add simple smoke-test (#240) 2017-03-31 12:11:26 -05:00
Sasha Aickin
60df9f3cad Updating regenerator-transform and adding a test for the issue in facebook/regenerator#267 2017-03-30 22:10:02 -07:00
George Chung
db1fd15616 Fix README: debug option shows info in stdout. (#236) 2017-03-30 20:25:32 -05:00
Brian Ng
9733e89cd8 Add prepublish script 2017-03-30 17:30:06 -05:00
Brian Ng
234568cd51 1.3.2 2017-03-30 17:24:58 -05:00
Brian Ng
8663c37888 1.3.1 2017-03-30 16:08:06 -05:00
Brian Ng
4ffe1f2e52 Revert npmignoring data 2017-03-30 16:06:57 -05:00
Brian Ng
da97567ee9 1.3.0 2017-03-30 15:41:24 -05:00
Brian Ng
bd944ccf56 Update changelog 2017-03-30 15:41:16 -05:00
Brian Ng
ae3e7cb4a9 Add check for ArrayBuffer[Symbol.species] (#233) 2017-03-30 16:18:28 -04:00
Brian Ng
0052e16853 Merge branch 'master' into 2.0 2017-03-30 13:26:41 -05:00
Brian Ng
4d18221098 Use babel-register script when running babel smoke tests (#442) 2017-03-30 11:25:23 -04:00
Artem Yavorsky
c4c9a7fc88 Fill data with electron as a target. (#229) 2017-03-28 23:07:17 -05:00
Logan Smyth
d3497348b8 Ensure that incremental builds work with 'gulp build'. (#5561) 2017-03-28 15:18:12 -07:00
Henry Zhu
4bf8e4d08d temp fix for watch, still recompiles all [skip ci] 2017-03-28 14:31:55 -04:00
Brian Ng
9a5ab8cfea Merge branch 'master' into 2.0 2017-03-28 10:37:47 -05:00
Artem Yavorsky
0443dcd7cd Merge pull request #228 from babel/b7-a6
Bump babel to b7.alpha6
2017-03-28 15:59:20 +03:00
Logan Smyth
0c2ac9d907 Use a standard .babelignore and babel-register. (#5555) 2017-03-27 21:16:09 -04:00
Mikhail Shustov
ae3dfda1d6 separate default builtins for platforms (#226) 2017-03-27 17:43:18 -05:00
Brian Ng
fc03259a2b Bump babel to b7.alpha6 2017-03-27 17:18:41 -05:00
Henry Zhu
899daafcf4 Merge pull request #5551 from babel/fix
use latest babel-core
2017-03-27 18:00:11 -04:00
Logan Smyth
fa23b662c2 Add empty .babelrc for CLI tests. 2017-03-27 14:46:39 -07:00
Henry Zhu
3d74dc044f fix ci 2017-03-27 17:26:39 -04:00
Henry Zhu
67253c5d27 babelrc false to relevant files 2017-03-27 17:19:02 -04:00
Henry Zhu
7935dd6642 pass config 2017-03-27 16:44:42 -04:00
Henry Zhu
f3ef03abfd use caret for devDeps 2017-03-27 16:32:13 -04:00
Henry Zhu
75328ccc60 use latest babel-core 2017-03-27 16:24:13 -04:00
Henry Zhu
dea509377c v7.0.0-alpha.6 2017-03-27 15:09:36 -04:00
Henry Zhu
7262ad631f Merge pull request #5543 from babel/food
🐶 🍲
2017-03-27 15:00:23 -04:00
Kai Cataldo
1f2f63ccdf Fix: config lookup logic in babel-core (#5550)
This fixes a bug that was causing the config lookup to stop
when a package.json file was found even if it did not contain a
"babel" key.
2017-03-27 11:54:57 -07:00
Henry Zhu
1ada981077 run coverage on circle ci 2017-03-27 14:24:32 -04:00
Henry Zhu
18bbaa0253 use node current in dev 2017-03-27 14:24:32 -04:00
Henry Zhu
4278ede41f 🐶 🍲 2017-03-27 14:24:16 -04:00
Steve Mao
a9f7c7db4c remove deprecated projects (#223) [skip ci] 2017-03-25 22:06:09 -04:00
Henry Zhu
7a1ccf076c Misc (#5545)
* normalize npmignores

* fixup eslint ignore, etc

* lint

* remove unused

* rm from gitignore

* use strict
2017-03-25 21:46:16 -04:00
Artem Yavorsky
b3bfd40195 Run yarn as pre-commit hook if package.json was changed (#225) 2017-03-24 10:35:26 -05:00
Henry Zhu
cff1c8db39 v7.0.0-alpha.5 2017-03-24 10:38:10 -04:00
Henry Zhu
b8cf7b89f2 keep one core-js helper file in git, remove babel-runtime from deps (#5540) 2017-03-24 10:36:41 -04:00
azrael25
0eb898d95b fix babel-runtime helpers gererator (#5539) 2017-03-24 08:56:41 -04:00
Alex Kuzmenko
2f3123ca03 Fix CONTRIBUTING.md [skip ci] (#432) 2017-03-24 10:57:36 +01:00
Henry Zhu
d0b6db1901 v7.0.0-alpha.4 2017-03-23 18:06:48 -04:00
Henry Zhu
d7a77f4161 register should be a devDep 2017-03-23 18:04:46 -04:00
Henry Zhu
287869dcc2 nvm [skip ci] 2017-03-23 17:50:45 -04:00
Logan Smyth
a498371005 Ensure the ignore regex is consistent and initialized fully. (#5534) 2017-03-23 17:44:03 -04:00
Brian Ng
a495d7f65d Allow statics in flow interfaces (#427) 2017-03-23 22:10:07 +01:00
Henry Zhu
03de20f043 2.0.0-alpha.3 2017-03-23 17:03:11 -04:00
Henry Zhu
8e528fdacf update to b7-alpha.3 (#224) 2017-03-23 17:01:52 -04:00
Henry Zhu
ab68800e06 v7.0.0-alpha.3 2017-03-23 15:49:01 -04:00
Henry Zhu
f438a4e6b6 force publish all pkgs for now, clean runtime helpers/core-js correctly [skip ci] 2017-03-23 15:45:49 -04:00
Brian Ng
c687b703ae Ensure babel-cli tests compare generated output with out-files (#5205) 2017-03-23 12:06:56 -04:00
Boopathi Rajaa
c9a851a218 Cleanup traverse cache APIs (#5494) 2017-03-23 12:00:28 -04:00
Damien Maillard
299e51298c Fix path.remove() leading & trailing comments sharing (#5504) 2017-03-23 11:55:14 -04:00
Patrick Williams
0cd541b7d8 document cache option for babel-register (#5440) [skip ci] 2017-03-23 11:44:44 -04:00
Artem Yavorsky
796d497ea1 [skip ci] devEngines: Bump node to 4.x. (#5530) 2017-03-23 11:28:36 -04:00
Jason Julian
640515b3f6 removed unused alias in babel-runtime (#5516) 2017-03-22 20:03:35 -04:00
Henry Zhu
e155859b12 Merge pull request #5528 from babel/fix-babel-runtime-helpers
Fix babel runtime helpers
2017-03-22 20:02:29 -04:00
Brian Ng
c0779fdb71 Merge pull request #5341 from yavorsky/regenerator-transform-0-9-10
Bump regenerator-transform version to 0.9.11.
2017-03-22 18:07:47 -05:00
Artem Yavorsky
60b5409183 Bump regenerator-transform version to 0.9.11 2017-03-22 18:02:09 -05:00
Artem Yavorsky
f2f226b4f2 Add syntax-object-rest-spread as devDep for tests. 2017-03-23 00:52:10 +02:00
Artem Yavorsky
ddfb6f2c44 Remove object-rest-spread syntax. 2017-03-23 00:33:03 +02:00
Henry Zhu
26b9f9ed15 commit one helper to git to check regressions 2017-03-22 18:18:08 -04:00
Henry Zhu
483958b24d fix runtime helpers
Ref f3f907bdb3 (diff-339968af11c78f10673c78c6c7568d2fR34)
2017-03-22 18:07:11 -04:00
Guy Bedford
b75d80386c document dynamic import support (#5457) [skip ci] 2017-03-22 16:55:42 -04:00
Samuel Reed
f20da57317 Fix PathHoister attaching to default parameters. (#5415)
* Fix PathHoister attaching to default parameters.

Ref: #5315

* Update hoister.js
2017-03-22 16:37:53 -04:00
Patrick Williams
b2c977a1b0 Seperate version env cache files (#5411) 2017-03-22 16:29:29 -04:00
jddxf
7e25dccc6e Update babel-generator's README (#5517) [skip ci] 2017-03-22 16:25:42 -04:00
Robert Jackson
c4ebc8553b Properly preserve import ordering with AMD format. (#5474)
Previously, all "bare imports" (e.g. `import './foo';`) were moved to the
end of the array of sources. I presume this was done to remove needless
variables in the callback signature.

Unfortunately, doing this actually changes the intent of the program.
Modules should be evaluated in the order that they were in the source.

In the case of a bare import, it is quite possible that the bare import
has side effects that a later required module should see. With the current
implementation the later imported modules are evaluated before that "side
effecty" module has been evaluated.

Obviously, it is better to avoid these sorts of side effect ridden modules
but even still you could imagine a similar issue with cycles.

This change ensures that module source order is preserved in the AMD
dependencies list, and avoids making needless variables as much as possible.
2017-03-22 16:24:17 -04:00
Henry Zhu
b638c8b3eb Transform the template literals revision proposal (#5523)
* Account for template literals revision

* extra tests

* update to babylon beta 7

* pr feedback (keep arr length the same)
2017-03-22 16:07:36 -04:00
Henry Zhu
e4e1cb0bda 7.0.0-beta.7 2017-03-22 14:07:10 -04:00
Henry Zhu
9f7d9080cf remove babylon plugin for template revision since it's stage-4 (#426) 2017-03-22 14:05:56 -04:00
Henry Zhu
492ee95f27 Merge pull request #5522 from babel/update-babylon 2017-03-22 10:49:29 -04:00
Daniel Tschinder
32eabf620b Fix push-pop logic in flow (#405) 2017-03-22 10:25:10 +01:00
Sven SAULEAU
2b774f46fb fix: handle bailed when recursive convert (#5499) 2017-03-22 09:18:37 +01:00
Arshabh Kumar Agarwal
a55f38b127 Changes the throw error for test in super-illegal-non-constructor-call (#5450) 2017-03-22 00:24:28 -04:00
Henry Zhu
ceb68f5bb7 babylon@7.0.0-beta.6 2017-03-22 00:24:00 -04:00
Henry Zhu
af5fdc2ebd 7.0.0-beta.6 2017-03-22 00:08:04 -04:00
Henry Zhu
ad1eb149fe update lock [skip ci] 2017-03-22 00:07:32 -04:00
Arshabh Kumar Agarwal
964105e3fb Improves error message when super is called outside of constructor (#408) 2017-03-21 17:44:21 -04:00
Henry Zhu
0f982799b6 Merge branch '7.0' 2017-03-21 17:05:48 -04:00
Kevin Gibbons
2e467ef3bc Add support for invalid escapes in tagged templates (#274)
Per the stage-3 TC39 proposal:
https://github.com/tc39/proposal-template-literal-revision
2017-03-21 16:55:54 -04:00
Kevin Gibbons
fab343e379 Add support for invalid escapes in tagged templates (#274)
Per the stage-3 TC39 proposal:
https://github.com/tc39/proposal-template-literal-revision
2017-03-21 16:50:34 -04:00
James Browning
5f048b4f5d [7.0] Moved value field in spec from ObjectMember to ObjectProperty as ObjectMethod's don't have it (#415) [skip ci] 2017-03-21 16:44:54 -04:00
Henry Zhu
6a94d0eb9c 7.0.0-beta.5 2017-03-21 15:56:16 -04:00
Henry Zhu
7d37017a5f Merge pull request #5489 from loganfsmyth/conf-refactor
Misc fixes + Move babel-core config processing from transformation/file/options into top-level folder
2017-03-21 14:12:41 -04:00
Henry Zhu
7551a8e666 Update yarn.lock 2017-03-21 13:04:54 -04:00
Henry Zhu
4901f33423 remove unnecessary call 2017-03-21 13:03:54 -04:00
Henry Zhu
95c905c5d2 fix markdown rendering [skip ci] 2017-03-20 09:32:32 -04:00
Aaron Ang
94024961ba Update error message when importing babel-cli (#5507) 2017-03-19 15:59:01 -07:00
Daniel Tschinder
0811438c82 Update flow (#422) 2017-03-19 22:07:16 +01:00
Andy
0545173f66 Test runner: Detect extra property in 'actual' but not in 'expected'. (#407)
* Test runner: Detect extra property in 'actual' but not in 'expected'.

Also update all expected.json where this would result in errors.

* Include rmExpected.js script in case it is needed again
2017-03-19 22:03:11 +01:00
Daniel Tschinder
82b7872cb8 Optimize travis builds (#419)
* Optimize travis builds

* Use yarn

* Fix babel tests to correctly fail

* Check against 7.0 branch of babel
2017-03-19 21:58:20 +01:00
Daniel Tschinder
ae8728c146 Merge branch 'master' into 7.0 2017-03-19 14:21:00 +01:00
Henry Zhu
b3c7337fac Fix changelog [skip ci] 2017-03-19 14:14:00 +01:00
Artem Yavorsky
70354013f1 Fix visitor inheritance. 2017-03-19 14:46:59 +02:00
Artem Yavorsky
c42e027602 Add object rest spread syntax using plugin. 2017-03-19 14:02:01 +02:00
Diogo Franco
256fcbc58f Treat "await" as an invalid identifier (#4954)
It is valid (outside `async` functions) in the "script" parse goal, but always invalid in the "module" parse goal.

Fixes #4952.
2017-03-19 11:28:52 +09:00
Artem Yavorsky
18d6ba9947 Fix export array rest expected output. 2017-03-19 01:18:22 +02:00
Artem Yavorsky
c82b084927 Fix object rest params for exports. 2017-03-19 00:32:27 +02:00
Artem Yavorsky
45b41740d8 Consider default params for object pattern. 2017-03-18 16:26:22 +02:00
Artem Yavorsky
b608e28aa7 Consider rest params for array pattern in exports. 2017-03-18 16:02:06 +02:00
Artem Yavorsky
06f67e1ad3 Consider default parameters for array pattern. 2017-03-18 15:42:39 +02:00
Artem Yavorsky
b5bb89b30a Add array pattern to exports destructuring. 2017-03-18 15:12:46 +02:00
Brian Ng
baafe486b3 Add useBuiltins and useESModules options to transform-runtime README [skip ci] (#5481) 2017-03-17 14:55:55 -04:00
Brian Ng
cd3dbe700c Re-enable yarn/node 4 on travis 2017-03-17 12:47:30 -05:00
Henry Zhu
534f621183 remove unused use of removed util class 2017-03-17 10:41:19 -04:00
Logan Smyth
a15de19888 Encapsulate config loading in config/ index file. 2017-03-17 00:04:00 -07:00
Logan Smyth
3c63431c7e Move config loading helpers into config folder. 2017-03-17 00:03:59 -07:00
Logan Smyth
f3f907bdb3 Remove unneeded helper file. 2017-03-17 00:03:59 -07:00
Logan Smyth
7b5d4fe069 Resolve parser and generator plugins in configuration resolution. 2017-03-17 00:03:59 -07:00
Logan Smyth
b71569ff6c Remove unneeded util.js file. 2017-03-17 00:03:59 -07:00
Logan Smyth
3e2d731d50 Move the Store class to be inside transformation. 2017-03-17 00:03:59 -07:00
Logan Smyth
12a2124d16 Move the deeply nested option logic to a toplevel folder. 2017-03-17 00:03:58 -07:00
Logan Smyth
6c4810cea5 Move Plugin class to be part of config loading, independent of File. 2017-03-17 00:03:58 -07:00
Logan Smyth
05ee30c9f7 Use the standard option parser to load the internal plugins. 2017-03-17 00:03:58 -07:00
Logan Smyth
38720ae309 Remove store subclassing from Plugin class. 2017-03-17 00:03:58 -07:00
Logan Smyth
bf13ed4da0 Limit where certain arguments are allowed in Babel config. 2017-03-17 00:03:58 -07:00
Logan Smyth
344f0a68c9 Centralize preset processing from two loops to one. 2017-03-17 00:03:57 -07:00
Logan Smyth
62def8da19 Make presets consistently resolve string values relative to their config file location. 2017-03-17 00:03:50 -07:00
Logan Smyth
39c862c195 Make only/ignore relative to cwd/config file and move only/ignore checking all to core. (#5487)
* Make only/ignore relative to cwd/config file and move only/ignore checking all to core.
2017-03-16 23:22:43 -07:00
Logan Smyth
b6194a8533 Merge pull request #5467 from loganfsmyth/clean-options
Misc reorganizing and prep for ignore/only refactoring
2017-03-16 20:25:20 -07:00
Ryan Paul
8859715893 Removes unused lodash dependency from babel-helper-builder-react-jsx (#5486) 2017-03-16 16:17:37 -04:00
Brian Ng
612cce399a Fix options header on preset-latest readme [skip ci] 2017-03-16 14:10:26 -05:00
Ryan Paul
4e96a2da5e Removes unused lodash dep from babel-helper-builder-react-jsx (#5484) 2017-03-16 15:08:11 -04:00
Aaron Ang
edf2c76d63 Improve options documentation for babel-plugin-transform-runtime (#5401) 2017-03-16 10:37:50 -05:00
Sergey Bekrin
bf1b6ace53 update coffescript reference in readme [skip ci] (#5475) 2017-03-16 10:35:40 -05:00
Sven SAULEAU
ad1edc6155 Merge pull request #5477 from xtuc/fix-generator-doc
Update babel-generator documentation
2017-03-16 08:56:08 +01:00
Sven SAULEAU
e30197b96b docs: [skip ci] update documentation 2017-03-16 08:53:38 +01:00
Brian Ng
b7c04d43ca Merge pull request #216 from babel/update-npmignore
npmignore: Add related to build data and codecov.
2017-03-15 22:23:43 -05:00
Artem Yavorsky
040404085b npmignore: Add related to build data and codecov. 2017-03-16 04:06:50 +02:00
Brian Ng
f77b875875 Merge pull request #215 from babel/2.0-yarn
Update yarn.lock
2017-03-15 20:58:15 -05:00
Artem Yavorsky
d309b25b19 Update yarn.lock 2017-03-16 03:47:23 +02:00
Artem Yavorsky
9237206337 Merge pull request #214 from babel/2.0-istanbul
Bump babel-plugin-istanbul
2017-03-16 03:43:34 +02:00
Brian Ng
9565dfed54 Bump babel-plugin-istanbul 2017-03-15 18:45:00 -05:00
Brian Ng
35068a6626 Merge branch 'master' into 2.0 2017-03-15 18:24:57 -05:00
Artem Yavorsky
41ddbc03c9 Merge pull request #212 from babel/existentialism-patch-2
Bump codecov
2017-03-16 01:18:02 +02:00
Brian Ng
1fe146f274 Bump codecov 2017-03-15 18:04:41 -05:00
Daniel Tschinder
9690daabd4 Update codecov to 2.0 (#412) 2017-03-15 23:40:58 +01:00
Brian Ng
6babbd981a v1.2.2 changelog [skip ci] 2017-03-15 11:50:32 -05:00
Brian Ng
d71cee8fa1 1.2.2 2017-03-15 11:44:23 -05:00
Brian Ng
8b99386491 Change how yarn is installed on travis 2017-03-15 11:12:59 -05:00
Artem Yavorsky
0c2e3b1045 Remove exports definition. 2017-03-15 16:02:21 +02:00
Artem Yavorsky
9b410be61c Add test for exports destructuring. 2017-03-15 15:37:17 +02:00
Artem Yavorsky
f81d7496b1 Fix exports while destructuring. 2017-03-15 15:35:45 +02:00
Diogo Franco
2c0907acdc Merge pull request #5442 from babel/babel-runtime-with-builtins
Add useBuiltIns and useESModules options to transform-runtime
2017-03-15 11:47:35 +09:00
Logan Smyth
dd1bc3b183 Resolve programmatic/CLI arguments from cwd, not file being compiled. (#5466) 2017-03-14 16:56:00 -07:00
Logan Smyth
bf4664b430 Invert the resolution order of config-chain to process higher-priority items first. 2017-03-14 13:39:57 -07:00
Logan Smyth
dcb0f91f38 Ignore files if they don't match only OR they do match ignore. 2017-03-14 13:39:57 -07:00
Logan Smyth
738bd54bfb Move OptionManager calls out of 'new File'. 2017-03-14 13:39:57 -07:00
Logan Smyth
83356abd92 Centralize transform API functions. 2017-03-14 13:39:56 -07:00
Logan Smyth
c1be6a36c4 Delete Logger class. 2017-03-14 13:39:56 -07:00
Logan Smyth
188fe105c2 Move option-defaulting to option-manager. 2017-03-14 13:30:24 -07:00
Logan Smyth
540f9b2ad6 Remove the nonstandard basename option. 2017-03-14 13:30:24 -07:00
Logan Smyth
2642c2c2df Merge pull request #5463 from loganfsmyth/strict-args
More strictly parse configs and explicitly handle arguments in babel-cli
2017-03-14 10:21:32 -07:00
Brian Ng
1b5df314d9 Merge pull request #198 from yavorsky/typed-ie
Change built-in-targets according to Typed Array methods
2017-03-14 11:09:34 -05:00
Artem Yavorsky
dde487a0c6 Add typed array methods to built-ins features. 2017-03-14 10:28:25 -05:00
Brian Ng
9f74e10959 Merge pull request #208 from babel/issue207
Refactor browser data parsing to handle families
2017-03-14 09:49:00 -05:00
Nitin Tulswani
8c1cd177b2 added examples for transforms. [skip ci] (#5393) 2017-03-14 09:43:51 -05:00
Brian Ng
8b19c74606 address review comments 2017-03-14 09:16:06 -05:00
Sven SAULEAU
0bc802cf1b Merge pull request #5448 from xtuc/feat-expose-env-core
Export Babel's environment
2017-03-14 12:50:21 +01:00
Artem Yavorsky
f9f31c2120 Merge pull request #206 from babel/trailing-commas-scripts
Add --check to build-data and skip trailing-commas on scripts/*.js
2017-03-14 11:49:57 +02:00
Brian Ng
9d890f57bb Refactor browser data parsing to handle families 2017-03-14 00:05:17 -05:00
Andy
873bf284ba Fix spec for ClassMethod: It doesn't have a function, it *is* a function. (#406) [skip ci] 2017-03-13 20:52:12 -04:00
James Browning
a5386433e1 Changed Non-existent RestPattern to RestElement which is what is actually parsed (#409) [skip ci] 2017-03-13 17:27:16 -04:00
Logan Smyth
5b50b73d8b Remove config.js file in favor of config code. 2017-03-13 11:06:46 -07:00
Logan Smyth
4f72232ca9 Move option parsing to babel-cli. 2017-03-13 11:06:46 -07:00
Logan Smyth
2c564a6973 Move babel config descriptions to babel-cli. 2017-03-13 00:06:01 -07:00
Logan Smyth
0c0f090a98 Get rid of circular dependencies in babel cli script. 2017-03-13 00:00:56 -07:00
Henry Zhu
523a41b25e v6.24.0 changelog [skip ci] 2017-03-12 22:23:51 -04:00
Henry Zhu
71e4336f65 v6.24.0 2017-03-12 22:18:08 -04:00
Henry Zhu
a8cf9079a8 changelog for 6.24.0 [skip ci] (#5452) 2017-03-12 22:03:19 -04:00
Henry Zhu
b78fc9b4d0 Keep parentheses for logical expression when in await expression (fix #5428) (#5433) (#5453) 2017-03-12 21:40:38 -04:00
Aaron Ang
2bb6dff00a Use absolute paths in Babel's CONTRIBUTING.md (#5431) 2017-03-12 20:31:58 -05:00
Sven SAULEAU
c00ffb83be Merge pull request #5029 from xtuc/fix-require-debug
Require debug module directly
2017-03-12 21:23:56 +01:00
Brian Ng
72b1f38f91 Change trailing commas option on scripts 2017-03-12 12:29:48 -05:00
Brian Ng
22dab1fa95 Check plugin/built-in data on travis 2017-03-12 12:28:25 -05:00
Brian Ng
32ebccd050 Merge pull request #183 from yavorsky/2.0-prettify-long
Prettify.
2017-03-12 11:22:18 -05:00
Artem Yavorsky
f81aef3c22 Add prettier 2017-03-12 11:15:42 -05:00
Brian Ng
ce78265443 Merge pull request #205 from babel/merge-master-2
Merge branch 'master' into 2.0
2017-03-12 10:56:29 -05:00
Brian Ng
1e9cf572a8 Merge branch 'master' into 2.0 2017-03-12 10:48:54 -05:00
Seth Bergman
3d52d30e49 Fixed broken links in README.md [skip ci] (#5449)
* Fixed broken links in README.md

- [plugins](https://github.com/babel/babel/blob/master/docs/plugins) => [plugins](https://babeljs.io/docs/plugins/)
- [presets](https://github.com/babel/babel/blob/master/docs/plugins/#presets) => [presets](https://babeljs.io/docs/plugins/preset-latest/)

* Corrected the presets link [skip-ci]

Changed to:
```
[presets](https://babeljs.io/docs/plugins/#presets)
```
2017-03-12 00:24:57 -08:00
Sven SAULEAU
d328af0aec feat: export env getter 2017-03-11 20:40:23 +01:00
Sven SAULEAU
8744303f06 Merge branch '7.0' into fix-require-debug 2017-03-11 12:17:04 +01:00
Diogo Franco (Kovensky)
752788f22f Add fixtures for the transform-runtime output 2017-03-11 13:36:38 +09:00
Logan Smyth
01b250a8fa Merge pull request #5430 from loganfsmyth/opts-simplify
Simplify option and plugin pass processing
2017-03-10 13:03:19 -08:00
MrSpider
5287e13817 Fix replacing function declaration in export default (fixes #4468) (#5444) 2017-03-10 11:41:03 -08:00
Brian Ng
337da3c641 Merge pull request #201 from yavorsky/bump-plugins
Bump plugins
2017-03-10 12:48:25 -06:00
Artem Yavorsky
88cfe1b635 Merge branch 'master' into bump-plugins
# Conflicts:
#	package.json
#	yarn.lock
2017-03-10 20:41:11 +02:00
Brian Ng
f521884d01 Merge branch 'master' into 2.0 2017-03-10 11:35:58 -06:00
Brian Ng
4312ad922b Merge pull request #200 from alxpy/alxpy-patch-1
Enable code coverage
2017-03-10 11:28:04 -06:00
Brian Ng
07e18669af Tweak package scripts and travis config for code coverage 2017-03-10 11:22:03 -06:00
Alex Kuzmenko
1738cb6690 Add babel-plugin-istanbul 2017-03-10 10:43:54 -06:00
Alex Kuzmenko
7d7f06c10e Add codecov badge 2017-03-10 10:43:53 -06:00
Alex Kuzmenko
4cf4ac6cbb Enable code coverage 2017-03-10 10:43:53 -06:00
Aaron Ang
911b71f2c6 Use absolute paths in Babel's CONTRIBUTING.md (#5431) 2017-03-10 08:49:28 -06:00
Artem Yavorsky
ded253f1ad Increase mocha timout to 10s. 2017-03-10 07:08:53 -06:00
Daniel Tschinder
4a813dc51a Revert "Disable failing tests (fixed in 7.0)"
This reverts commit 4c88cfe765.
2017-03-10 13:51:24 +01:00
Daniel Tschinder
90f2b12569 Merge branch 'master' into 7.0
* master:
  Disable failing tests (fixed in 7.0)
2017-03-10 13:51:05 +01:00
Daniel Tschinder
4c88cfe765 Disable failing tests (fixed in 7.0) 2017-03-10 13:50:53 +01:00
Daniel Tschinder
68e8550e84 Merge branch 'master' into 7.0
* master:
  Upgrade flow to 0.41
  Throw error if new.target is used outside of a function (#402)
  Fix watch command (#403)
  Update yarn lock
  Fix parsing of class properties (#351)

# Conflicts:
#	src/parser/statement.js
#	test/fixtures/experimental/class-constructor-call/illegal-key/options.json
2017-03-10 13:47:45 +01:00
Daniel Tschinder
c0a89f4c15 Upgrade flow to 0.41 2017-03-10 13:41:08 +01:00
Brian Ng
ca652bd934 Throw error if new.target is used outside of a function (#402) 2017-03-10 13:38:45 +01:00
Brian Ng
35e7732156 Fix watch command (#403) 2017-03-10 13:37:54 +01:00
Daniel Tschinder
902f93d937 Update yarn lock 2017-03-10 13:35:49 +01:00
Artem Yavorsky
3a9f6e93c4 Update yarn.lock 2017-03-10 14:00:41 +02:00
Artem Yavorsky
5537635175 Fix object-curly-spacing rule. 2017-03-10 14:00:28 +02:00
Artem Yavorsky
37bd909e15 Put duplicate-keys in alphabetical order. 2017-03-10 13:59:56 +02:00
Artem Yavorsky
1584fbe176 Bump packages. 2017-03-10 13:58:56 +02:00
Brian Ng
250cd65479 Fix watch command (#403) 2017-03-10 12:45:45 +01:00
Kevin Gibbons
81056eeee7 Fix parsing of class properties (#351) 2017-03-10 12:43:45 +01:00
Artem Yavorsky
d6a6ee4045 Merge pull request #199 from bl4ckdu5t/typo-fix
Fixed minor typo in README.
2017-03-10 13:15:14 +02:00
Diogo Franco (Kovensky)
25212445ed Add new generated files to .gitignore 2017-03-10 18:53:20 +09:00
Joseph Rex
fe6a606c58 Changed word were to where in README 2017-03-10 03:44:50 -06:00
Diogo Franco (Kovensky)
8dc2176a04 Fix Node 4 parse errors 2017-03-10 16:36:20 +09:00
Diogo Franco (Kovensky)
cf5ab16ff9 Add useBuiltIns and useESModules options to transform-runtime
useBuiltIns uses versions of the helpers that do not import even
internal polyfills from core-js.

useESModules uses versions of the helpers that do not go through
transform-es2015-modules-commonjs. This allows for smaller builds in
module systems like webpack, as it doesn't need to preserve commonjs
semantics.

This includes changes to the babel-runtime build-dist script, which
will build the versions of the runtime helpers to be used by
combinations of useBuiltIns and useESModules.
2017-03-10 16:27:35 +09:00
Logan Smyth
ca71c74696 Move plugin and pass initialization into a more central location. 2017-03-09 16:13:38 -08:00
Logan Smyth
305165eda4 Remove Logger usage from options processing. 2017-03-09 16:13:38 -08:00
Henry Zhu
12eb25c06c don't show other presets in readme [skip ci] (#5438) 2017-03-09 11:00:25 -05:00
Sven SAULEAU
7c8825f6b2 Merge pull request #5418 from babel/xtuc-patch-4
Add new members
2017-03-09 16:48:06 +01:00
Aaron Ang
3d987ed6c0 Keep parentheses for logical expression when in await expression (fix #5428) (#5433) 2017-03-09 09:13:53 -05:00
Henry Zhu
230712e091 Internal: back to fixed, publish everything (#5436) 2017-03-08 22:56:00 -05:00
Henry Zhu
0553d7761d Publish
- babel-cli@7.0.0-alpha.2
 - babel-core@7.0.0-alpha.2
 - babel-helper-plugin-test-runner@7.0.0-alpha.2
 - babel-helper-transform-fixture-test-runner@7.0.0-alpha.2
 - babel-register@7.0.0-alpha.2
2017-03-08 13:08:44 -05:00
Artem Yavorsky
ba2b58e57f Replace preset-es2015 with env (#184) 2017-03-08 11:01:35 -06:00
Artem Yavorsky
84d4b9de5d Add built-ins, better links, compat-table url, etc (#195) [skip ci] 2017-03-08 10:54:16 -05:00
Brian Ng
7a6d495704 Throw error if new.target is used outside of a function (#402) 2017-03-08 16:34:22 +01:00
Henry Zhu
5e0dc7a689 add version badge [skip ci] 2017-03-08 08:43:49 -05:00
Artem Yavorsky
7dfcba6f16 Merge pull request #194 from babel/doc-relative-path
Change CONTRIBUTING.md to use absolute paths
2017-03-08 12:23:28 +02:00
Aaron Ang
8f0e70bad4 Change CONTRIBUTING.md to use absolute paths
[skip ci]
2017-03-07 20:18:14 -08:00
Henry Zhu
02473a72c1 Merge pull request #4892 from kaicataldo/babelrcjs
Add support for .babelrc.js files
2017-03-07 16:58:00 -05:00
Kai Cataldo
d054cd0ea8 Add support for .babelrc.js files 2017-03-07 16:44:24 -05:00
Brian Ng
0336cab757 Fix transform-object-rest-spread README [skip ci] (#5409) 2017-03-07 16:41:49 -05:00
Artem Gurzhii
6888a2c51b Code refactoring for the babel-generator (#5344)
* refactoring code for babel-generator package

* removing spaces and refactoring if statement

* fixing warnings
2017-03-07 16:41:49 -05:00
Logan Smyth
39eca84642 Use 'resolve' from npm instead of private 'module' methods. (#5416) 2017-03-07 12:42:25 -08:00
Logan Smyth
ea787a1980 Merge pull request #5427 from rwjblue/backport-modules-noInterop
Backport `noInterop` flag for modules to 6.x.
2017-03-07 12:25:16 -08:00
Robert Jackson
290995923e Add docs for strict and noInterop with es2015-modules-commonjs.
(cherry picked from commit 23de276718)
2017-03-07 14:53:01 -05:00
Robert Jackson
bc65822379 Add noInterop option to babel-plugin-transform-es2015-modules-commonjs.
The intent of this option is to toggle module interop behavior. When `true`
no `interopRequireXXX` helper invocations will be emitted.

(cherry picked from commit 0d1edb9811)
2017-03-07 14:53:01 -05:00
Logan Smyth
836dd95c44 Merge pull request #5422 from rwjblue/remove-interop-require-default-in-strict-mode
Add noInterop option to babel-plugin-transform-es2015-modules-commonjs.
2017-03-07 11:16:43 -08:00
Artem Yavorsky
970f8ebaf8 Drop whitelist option (#181) 2017-03-06 20:41:55 -06:00
Brian Ng
7348637a1e Fix running tests (#182) 2017-03-06 20:26:42 -06:00
Robert Jackson
23de276718 Add docs for strict and noInterop with es2015-modules-commonjs. 2017-03-06 20:19:38 -05:00
Robert Jackson
0d1edb9811 Add noInterop option to babel-plugin-transform-es2015-modules-commonjs.
The intent of this option is to toggle module interop behavior. When `true`
no `interopRequireXXX` helper invocations will be emitted.
2017-03-06 19:51:35 -05:00
Brian Ng
6c20876fd2 v1.2.1 changelog [skip ci] 2017-03-06 15:00:53 -06:00
Brian Ng
0ede95a640 1.2.1 2017-03-06 14:56:23 -06:00
Brian Ng
cd0c019b24 Add transform-duplicate-keys mapping (#192) 2017-03-06 14:55:34 -06:00
Mike Greiling
6ee5b0c5ac Clarify reasons for the uglify option in README.md (#188) 2017-03-06 14:37:51 -06:00
greenkeeper[bot]
c7492454ca chore(package): update flow-bin to version 0.41.0 (#395)
https://greenkeeper.io/
2017-03-05 13:53:48 +01:00
Artem Yavorsky
349e31b665 Travis: Drop 0.12, 0.10 node. (#185) 2017-03-04 23:10:46 -05:00
Daniel Tschinder
12abc20575 Merge branch 'master' into 7.0 2017-03-04 21:00:42 +01:00
Daniel Tschinder
0b7da509d9 Add estree test for correct order of directives 2017-03-04 21:00:10 +01:00
Brian Ng
8a82cc060a Run new lint rules (#5413) 2017-03-04 10:46:01 -05:00
Sven SAULEAU
990d22a8d4 docs: [skip ci] add new members 2017-03-04 11:26:13 +01:00
Brian Ng
4966544002 v1.2.0 changelog [skip ci] 2017-03-03 17:03:58 -06:00
Brian Ng
a68d98d1a5 1.2.0 2017-03-03 16:50:57 -06:00
Artem Yavorsky
6a2b6fc0e0 Add uglify as a target (#178) 2017-03-03 15:36:54 -06:00
Henry Zhu
7e622940a4 Merge pull request #180 from babel/fix-compat-import
Respect older versions in invert equals map
2017-03-03 15:43:27 -05:00
Alex Kuzmenko
962ce16e84 Add DoExpression to spec (#364) 2017-03-03 21:38:04 +01:00
Daniel Tschinder
7d00281b2b Don’t add duplicate entries to map 2017-03-03 20:48:35 +01:00
Daniel Tschinder
6edae49d4d Version can be float and correctly lookup envMap 2017-03-03 17:27:24 +01:00
Daniel Tschinder
b5af93f348 Update compat-table to include ndoe4 and ios8 fixes 2017-03-03 17:15:26 +01:00
Brian Ng
2127df0db0 Fix transform-object-rest-spread README [skip ci] (#5409) 2017-03-02 23:29:34 -05:00
Henry Zhu
ed14b86fe3 2.0.0-alpha.1 2017-03-02 17:10:44 -05:00
Henry Zhu
71e4767014 updates 2017-03-02 17:10:31 -05:00
Daniel Tschinder
c2c96995a1 Add comments 2017-03-02 22:33:03 +01:00
Daniel Tschinder
8d96bd2378 Secure script 2017-03-02 22:29:49 +01:00
Henry Zhu
f7e2d88f6c independent mode [skip ci] 2017-03-02 16:25:18 -05:00
Daniel Tschinder
09c84a379f Fix tests 2017-03-02 22:24:46 +01:00
Henry Zhu
11e54a6bd3 v7.0.0-alpha.1 2017-03-02 16:04:47 -05:00
Henry Zhu
22a5ce43f1 fix lerna config [skip ci] 2017-03-02 16:00:44 -05:00
Henry Zhu
67ed224df0 update babel-types readme [skip ci] 2017-03-02 15:58:12 -05:00
Daniel Tschinder
984df9c96a Fix node 4 2017-03-02 21:58:09 +01:00
Henry Zhu
c86f922dc7 add exact flag [skip ci] 2017-03-02 15:54:51 -05:00
Henry Zhu
b4b03d48fa remove undeclared plugin [skip ci] (#5407) 2017-03-02 15:53:02 -05:00
Henry Zhu
0847ae055d cleanup + update to lerna 38 (#5406) 2017-03-02 15:04:54 -05:00
Artem Gurzhii
0d3a7e9cc6 Code refactoring for the babel-generator (#5344)
* refactoring code for babel-generator package

* removing spaces and refactoring if statement

* fixing warnings
2017-03-02 10:14:03 -08:00
Henry Zhu
1165d7e8c7 typo [skip ci] 2017-03-02 11:48:55 -05:00
Sumedh Nimkarde
05dd6d4545 Mention cloning of repository in CONTRIBUTING.md (#391) [skip ci] 2017-03-02 11:10:02 -05:00
Daniel Tschinder
c468d68cb8 Remove console.log 2017-03-02 16:31:39 +01:00
Daniel Tschinder
55ccfbf6a0 Respect older versions in invert map 2017-03-02 16:29:11 +01:00
Aaron Ang
265d2c1e4f Explain how to run only one test (#389) [skip ci] 2017-03-01 22:48:14 -05:00
Aaron Ang
4ad0caaa66 Merge pull request #5400 from JPeer264/fix/usage
[doc] Fix: comments in usage w/ options
2017-03-01 12:50:29 -08:00
Brian Ng
540c382637 Add additional note about async support on changelog [skip ci] 2017-03-01 14:39:03 -06:00
JPeer264
b9c0f364c4 [skip ci] Fix: comments in usage w/ options 2017-03-01 21:35:51 +01:00
Brian Ng
5233afabd9 v1.1.11 changelog [skip ci] 2017-03-01 14:28:51 -06:00
Brian Ng
f6db04d8db 1.1.11 2017-03-01 14:20:44 -06:00
Brian Ng
ecfcb31bf6 Bump compat-table (#177) 2017-03-01 15:10:04 -05:00
Henry Zhu
65f23b8212 Merge pull request #5399 from babel/update-babylon-beta-4
Update babylon beta 4
2017-03-01 13:26:28 -05:00
Henry Zhu
b363e7b199 add @danez's changes 2017-03-01 12:54:22 -05:00
Henry Zhu
2b9c3735fd update to babylon beta 4 2017-03-01 12:38:19 -05:00
Henry Zhu
2766263eea 7.0-beta.3 changelog [skip ci] 2017-03-01 12:32:08 -05:00
Henry Zhu
38cf1910c1 7.0.0-beta.4 2017-03-01 12:15:32 -05:00
Brian Ng
c8c71684c4 Don't consume async when checking for async func decl (#377) 2017-03-01 12:11:48 -05:00
Henry Zhu
fdb0b50c86 add ranges [skip ci] 2017-03-01 11:00:36 -05:00
Henry Zhu
f1e2cca767 Add back ranges property (#363)
* Add back ranges property

* Correctly adjust range in flow plugin

* Make it an option
2017-03-01 10:57:06 -05:00
Andrew Levine
aec4beff0c Don't parse class properties without initializers when classProperties is disabled and Flow is enabled (#300) 2017-03-01 11:55:24 +01:00
Henry Zhu
3ff77a61e4 Update babylon beta 3 (#5394)
* Update babylon to v7-beta.3

* convert RestProperty/SpreadProperty to RestElement/SpreadElement

* add virtual types to make it easier to upgrade
2017-02-28 16:58:19 -05:00
Daniel Tschinder
6d6cdf6baf [7.0] Allow presets to be objects (#5385)
* Allow presets to be objects

* Improve logic to detect preset format
2017-02-28 16:39:08 -05:00
Henry Zhu
56a92ccec1 changelog [skip ci] 2017-02-28 14:56:40 -05:00
Henry Zhu
e2cd62449e 7.0.0-beta.3 2017-02-28 14:47:08 -05:00
Henry Zhu
575e0d58dd update lock 2017-02-28 14:46:25 -05:00
Henry Zhu
5e0cce4974 Merge branch 'master' into 7.0 2017-02-28 14:37:13 -05:00
Henry Zhu
393746d781 Merge pull request #176 from babel/add-electron-fail
Add test for invalid electron version
2017-02-28 14:27:26 -05:00
Alex Kuzmenko
d9e9466350 Update spec.md [skip ci] (#367) 2017-02-28 12:45:25 -05:00
Brian Ng
09bb9bc6be Fix parsing yield with dynamicImport (#383) 2017-02-28 12:43:34 -05:00
Brian Ng
68c2a725c6 add electron version util to normalize-options 2017-02-28 11:38:55 -06:00
Brian Ng
2e0f64256f Use invariant for invalid electron version 2017-02-28 11:38:27 -06:00
Brian Ng
93b8b0735b Add electron version exception test 2017-02-28 11:38:27 -06:00
Henry Zhu
8d90dc0d10 [7.0] Change RestProperty/SpreadProperty to RestElement/SpreadElement (#384)
* [7.0] Change RestProperty/SpreadProperty to RestElement/SpreadElement

* Fix rest element in array pattern at invalid location
2017-02-28 12:31:58 -05:00
Brian Ng
cd133ff8e1 Ensure consistent start args for parseParenItem (#386) 2017-02-28 12:56:56 +01:00
Logan Smyth
9acae54a29 Merge pull request #5376 from loganfsmyth/no-pipeline
[7.0] Remove the unneeded Pipeline class.
2017-02-27 12:33:11 -08:00
Artem Yavorsky
1bc8325679 Fix hasBeenWarned condition. (#175) 2017-02-27 10:12:02 -05:00
Artem Yavorsky
2d1768209d Add yarn example. (#174) 2017-02-27 08:46:05 -06:00
greenkeeper[bot]
9a5d93fa61 chore(package): update flow-bin to version 0.40.0 (#380)
https://greenkeeper.io/
2017-02-27 12:08:56 +01:00
Henry Zhu
696e63c58b Merge pull request #5380 from babel/extra-do + 6.x commits 2017-02-25 18:48:27 -05:00
Henry Zhu
6529cb5f01 babel-generator: add another do test 2017-02-25 18:39:18 -05:00
Alex Kuzmenko
01918c68c1 Improve babel-generator's code coverage (#5338) 2017-02-25 13:26:29 -05:00
Sven SAULEAU
eb9d699ce9 style: [skip ci] lint code snippets in md (#5379) 2017-02-25 12:19:29 -05:00
Logan Smyth
f3e92010c5 Remove the unneeded Pipeline class. 2017-02-24 13:37:33 -08:00
Henry Zhu
8e05140280 1.1.10 2017-02-24 15:48:23 -05:00
Brian Ng
1bb8f30b24 Drop use of lodash/intersection from checkDuplicateIncludeExcludes (#173) 2017-02-24 15:47:18 -05:00
Henry Zhu
ab87ff071c Merge pull request #170 from babel/hzoo-patch-1 [skip ci] 2017-02-24 11:53:51 -05:00
Brian Ng
70817b1fe4 add descriptions [skip ci] 2017-02-24 09:12:07 -06:00
Brian Ng
3384e36671 add links 2017-02-24 09:01:56 -06:00
Brian Ng
ea417727dc Merge pull request #171 from babel/travis-shrug
Pin yarn version on travis
2017-02-24 08:52:25 -06:00
Brian Ng
058c86715d Pin yarn version on travis 2017-02-24 08:39:03 -06:00
Henry Zhu
a9c31797dc v1.1.9 changelog [skip ci] 2017-02-24 08:46:51 -05:00
Henry Zhu
fcf1d7a33a 1.1.9 2017-02-24 08:34:59 -05:00
Henry Zhu
4367fba31e update compat (#169) 2017-02-24 08:34:06 -05:00
Brian Ng
1092dde11c Add tests for debug output (#156) 2017-02-24 08:27:43 -05:00
Henry Zhu
d33d023594 Merge remote-tracking branch 'origin/master' into merge-master 2017-02-23 18:54:15 -05:00
Henry Zhu
1e747835db add estree to docs [skip ci] (#372) 2017-02-23 18:12:30 -05:00
Henry Zhu
539d345d9b 6.16.1 2017-02-23 09:53:50 -05:00
Henry Zhu
2dd57d17b9 Revert "Fix export default async function to be FunctionDeclaration" (#375) 2017-02-23 09:50:33 -05:00
Henry Zhu
b0f8405b52 Revert "Don't parse class properties without initializers when classProperties plugin is disabled, and Flow is enabled" (#376) 2017-02-23 09:50:25 -05:00
Daniel Tschinder
9ed026df08 Fix error in changelog 2017-02-23 14:04:25 +01:00
Daniel Tschinder
b301d436da 6.16.0 2017-02-23 14:00:35 +01:00
Daniel Tschinder
76c7f55fb5 Fix date [skip ci] 2017-02-23 13:56:22 +01:00
Daniel Tschinder
99484d4c39 Fix typo [skip ci] 2017-02-23 13:52:53 +01:00
Daniel Tschinder
8dbdeff762 Fix typo [skip ci] 2017-02-23 13:51:44 +01:00
Daniel Tschinder
c6c4222789 Changelog 6.16 (#371)
* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

* Address review comments

* Update CHANGELOG.md
2017-02-23 13:50:41 +01:00
Kevin Gibbons
561d4f74b0 Forbid semicolons after decorators in classes (#352) 2017-02-22 16:24:40 +01:00
Brian Ng
ad8d520406 Ensure takeDecorators is called on exported class (#358) 2017-02-22 16:22:38 +01:00
Alex Rattray
94eda1254e Fix generator-method-with-computed-name spec (#360) 2017-02-22 16:21:44 +01:00
Alex Rattray
fab4ca2a18 Fix flow type-parameter-declaration test with unintended semantic (#361) 2017-02-22 16:19:42 +01:00
Daniel Tschinder
87ca6150ae [7.0] Remove bc code from preset handling and preset-es2015 (#5128)
* Remove bc code from preset handling and preset-es2015

* Add more tests

* Only allow functions for presets

* Fix lint
2017-02-22 14:58:01 +01:00
Zachary Miller
6614a63b3b Wrap some generated do expressions in parens (#5339) 2017-02-22 07:50:58 -05:00
Aaron Ang
45087b258b Add Yarn installation to CONTRIBUTING.md (#5358) [skip ci] 2017-02-22 07:50:22 -05:00
Daniel Tschinder
be293bd708 Enable codecov partial coverage (#5336) 2017-02-21 22:40:11 -05:00
Aaron Ang
c1c9ac4e11 Add section to CONTRIBUTING about debugging code (#5354) [skip ci] 2017-02-21 22:26:52 -05:00
Aaron Ang
3a6d85e55e Remove redundant NODE_ENV=test in Makefile (#5350)
`NODE_ENV=test` is exported by default. Therefore, targets that set `NODE_ENV` to `test` are cleaned up.
2017-02-21 22:14:59 -05:00
JeongHoon Byun (aka Outsider)
2de4b08c51 Add test for passing arguments to babel-node (#5163) (#5342) 2017-02-21 22:14:26 -05:00
Izaak Schroeder
8d9195f862 Pass dirname as extra metadata to preset constructor. (#4834)
* Pass `dirname` as extra metadata to preset constructor.

Sometimes a preset would like to know where it should resolve relative paths from (e.g. https://github.com/tleunen/babel-plugin-module-resolver) and this extra information makes that possible.

* Test for `dirname` passed into preset constructor

This adds a check for `dirname`’s existence and correctness to the
`resolve-addons-relative-to-file` test, and serves as a minimal example
of a path-aware preset.
2017-02-21 22:13:03 -05:00
Artem Yavorsky
02f51fb7a5 [skip ci] Add devEngines to package.json (#5312) 2017-02-21 22:10:33 -05:00
Marcelo Dapper
724c949244 Replace lodash/assign with Object.assign (#5356)
Remove imports to lodash/assign and replace assign with Object.assign.
The lodash/assign is unnecessary for babel 7 as node >4 has the same
functionality built-in with Object.assign as used here.

This resolve the [issue 5353](https://github.com/babel/babel/issues/5353)
2017-02-21 22:08:20 -05:00
Logan Smyth
c1f7d67bae Merge pull request #5351 from loganfsmyth/reduce-require
Avoid usage of exports/module.exports/require().
2017-02-21 16:59:32 -08:00
Logan Smyth
4ee385e96c Avoid usage of exports/module.exports/require(). 2017-02-21 16:52:42 -08:00
Alex Kuzmenko
b5246994b5 Update CONTRIBUTING.md: include make build (#5349) [skip ci] 2017-02-21 10:09:31 -05:00
Daniel Tschinder
2974a82df1 Add babel-bot to team (#5355) [skip ci] 2017-02-21 08:44:40 -05:00
Daniel Tschinder
fe2d2a99ea 7.0.0-beta.2 2017-02-20 23:50:07 +01:00
Daniel Tschinder
7bf553a575 Merge branch 'master' into 7.0 2017-02-20 23:49:27 +01:00
Daniel Tschinder
b023470c7e estree: correctly change literals in all cases (#368) 2017-02-20 23:47:57 +01:00
Daniel Tschinder
a4bf244f9a 7.0.0-beta.1 2017-02-20 23:12:19 +01:00
Daniel Tschinder
e52962f4c9 upgrade yarn.lock 2017-02-20 23:11:47 +01:00
Daniel Tschinder
72a0f10825 Merge branch '7.0-dev' into 7.0 2017-02-20 23:09:42 +01:00
Daniel Tschinder
50ffa49201 Merge branch 'master' into 7.0
# Conflicts:
#	src/plugins/flow.js
2017-02-20 22:47:17 +01:00
Daniel Tschinder
2ef00a6631 Fix negative number literal typeannotations (#366)
* Fix negative number literal typeannotations

Also use parseLiteral() to parser string and number literal typeannotations
so that future changes (estree) to literals are also reflected to flow.

* Instead of invalid fallthrough throw immediately

* Increase coverage and better error mesage
2017-02-20 22:43:59 +01:00
Brian Ng
7b63af0e91 Fix typo in CONTRIBUTING.md [skip ci] 2017-02-20 11:37:04 -06:00
Henry Zhu
d9f01cbce6 Merge pull request #5317 from babel/update-babylon
Update to babylon@7.0.0-beta.0
2017-02-18 13:06:39 -05:00
Daniel Tschinder
7e540cdcc9 Remove obsolete code 2017-02-18 12:30:46 +01:00
Brendan Houle
07dd2b1e20 Shorthand properties examples (#5334) 2017-02-17 12:01:57 -06:00
Zachary Miller
d55a775024 Update CONTRIBUTING.md with respect to coverage check [skip ci] (#5329) 2017-02-16 22:14:16 -05:00
Joe Lencioni
69c6d27794 Improve syntax highlighting in readme for JSX (#5331) [skip ci] 2017-02-16 20:36:05 -05:00
Wilhelmina Drengwitz
7e59f86444 Fix 'o' is undefined in example code (#5327) [skip ci] 2017-02-16 15:24:20 -05:00
Daniel Tschinder
28853bf190 Fix for-await printing (#5322)
Only the first for-await was correctly printed all subsequent for-await statements
where printed as for-of as the variable op was changed inside the buildForXStatement
2017-02-15 17:43:06 -05:00
Daniel Tschinder
7c62278dcd [7.0] Change for-await to use new AST (#5321) 2017-02-15 17:29:09 -05:00
Alexander
1ba3269ece [7.0] Switch decorators-legacy to decorators in the Stage 1 Preset (#5318) (#5319) 2017-02-15 16:58:31 -05:00
Daniel Tschinder
ca78da6501 Fix variance (#5320) 2017-02-15 22:37:19 +01:00
Alex Kuzmenko
fa2a373acd [7.0] Replacing current decorators with decorators-legacy (#5290) 2017-02-15 15:42:50 -05:00
Jason Laster
ff2c24eed2 Add test for reference paths (#5296) 2017-02-15 15:05:31 -05:00
Toru Kobayashi
9188be9ed5 [7.0] Rename flow AST Type ExistentialTypeParam to ExistsTypeAnnotation (#5199) 2017-02-15 14:58:07 -05:00
Charles Pick
bc8f476d33 [7.0] Rename NumericLiteralTypeAnnotation to NumberLiteralTypeAnnotation (#5229) 2017-02-15 14:54:27 -05:00
Henry Zhu
b3e208fcd0 Update to babylon@7.0.0-beta.0 2017-02-15 14:45:21 -05:00
Brian Ng
b77c435f0f Ignore babel-register test artifacts (#5316) [skip ci] 2017-02-15 14:38:54 -05:00
Henry Zhu
401733d19f 7.0.0-beta.0 2017-02-15 14:28:29 -05:00
Sergey Rubanov
958f72ddc2 Add name field to package.json (#5311) [skip ci] 2017-02-15 10:55:12 -05:00
Logan Smyth
7dcc9708e3 Manually bump and publish babel-runtime 2017-02-14 11:26:49 -08:00
Sergey Rubanov
c3098d2437 Add Node 7 to CI (#5165)
This reapplies this commit, as it was lost before
2017-02-14 15:33:10 +01:00
Daniel Tschinder
6c03cb0783 Merge branch 'master' into merge-master
# Conflicts:
#	lerna.json
#	packages/babel-cli/package.json
#	packages/babel-core/package.json
#	packages/babel-generator/package.json
#	packages/babel-helper-builder-react-jsx/package.json
#	packages/babel-helper-function-name/package.json
#	packages/babel-helper-optimise-call-expression/package.json
#	packages/babel-helper-replace-supers/package.json
#	packages/babel-helper-transform-fixture-test-runner/package.json
#	packages/babel-helpers/package.json
#	packages/babel-plugin-transform-class-properties/package.json
#	packages/babel-plugin-transform-es2015-block-scoping/package.json
#	packages/babel-plugin-transform-es2015-classes/package.json
#	packages/babel-plugin-transform-es2015-modules-commonjs/package.json
#	packages/babel-plugin-transform-es2015-modules-systemjs/package.json
#	packages/babel-plugin-transform-es2015-modules-umd/package.json
#	packages/babel-plugin-transform-es2015-parameters/package.json
#	packages/babel-plugin-transform-react-jsx/package.json
#	packages/babel-register/package.json
#	packages/babel-template/package.json
#	packages/babel-traverse/package.json
#	packages/babel/package.json
2017-02-14 12:46:23 +01:00
Logan Smyth
11cf0e0b50 Revert lerna again 2017-02-13 18:18:45 -08:00
Logan Smyth
9cae61911d v6.23.1 2017-02-13 18:18:17 -08:00
Logan Smyth
454933ef76 Revert "Rewrite Hub as interface #5047" (#5306) 2017-02-13 18:15:50 -08:00
Logan Smyth
48709e9fa4 Revert change that lerna force-committed. 2017-02-13 17:20:18 -08:00
Logan Smyth
48573f1fb4 v6.23.0 2017-02-13 17:14:12 -08:00
Logan Smyth
24400c5b66 Update babel-types README from script. 2017-02-13 15:00:37 -08:00
Logan Smyth
cc5750d151 Add CHANGELOG for 6.23.0 [skip ci] (#5304) 2017-02-13 14:57:26 -08:00
Logan Smyth
e1fee21529 Add charset so tests work with convert-source-map@>1.4 (#5302) 2017-02-13 14:37:41 -08:00
Logan Smyth
1c1e9c764b Revert "Upgrade lerna to current beta." (#5303) 2017-02-13 14:20:10 -08:00
Logan Smyth
8a28c07d20 Upgrade lerna to current beta. (#5300) 2017-02-13 14:01:57 -08:00
Brian Ng
6522a255d9 Add greenkeeperio-bot to mention-bot blacklist (#5301) [skip ci] 2017-02-13 16:56:12 -05:00
Ben Alpert
14d3c2e256 Avoid adding unnecessary closure for block scoping (#5246)
When you write

```
for (const x of l) {
  setTimeout(() => x);
}
```

we need to add a closure because the variable is meant to be block-scoped and recreated each time the block runs. We do this.

However, we also add the closure when no loop is present. This isn't necessary, because if no loop is present then each piece of code runs at most once. I changed the transform to only add a closure if a variable is referenced from within a loop.
2017-02-13 13:46:00 -08:00
Yongxu Ren
2985597d40 Rewrite Hub as interface #5047 (#5050)
* Rewrite Hub as interface #5047

* Update index.js
2017-02-13 12:49:10 -08:00
Justin Ridgewell
ca45904a45 Fix loose for-of with label (#5298) 2017-02-13 10:30:36 -05:00
Samuel Reed
2aa2de8c6f feature: Support pure expressions in transform-react-constant-elements (#4812) 2017-02-12 20:02:38 -08:00
Logan Smyth
4edcd02965 Fix linting error 2017-02-12 18:48:07 -08:00
Samuel Reed
f4e3dfee74 Fix PathHoister hoisting before bindings. (#5153)
Fixes #5149 and enables a few additional safe hoists.
2017-02-12 18:35:08 -08:00
Samuel Reed
eb91bd831c Fix PathHoister hoisting JSX member expressions on "this". (#5143)
The PathHoister ignored member references on "this", causing it
to potentially hoist an expression above its function scope.

This patch tells the hoister to watch for "this", and if seen,
mark the nearest non-arrow function scope as the upper limit
for hoistng.

This fixes #4397 and is an alternative to #4787.
2017-02-12 18:34:07 -08:00
Daniel Tschinder
d2ccc6ae22 Fix test 2017-02-12 15:39:52 +01:00
Daniel Tschinder
09c1f069f9 Fix test 2017-02-12 15:38:11 +01:00
Brian Ng
57aaceaae7 Update contributing with more test info [skip ci] (#355) 2017-02-12 13:45:23 +01:00
Daniel Tschinder
d88befdd30 Merge branch 'master' into 7.0
# Conflicts:
#	src/parser/index.js
2017-02-12 13:32:06 +01:00
Daniel Tschinder
1cca7000d1 Reintroduce Variance node (#333)
* Reintroduce Variance node

* Optimize code and coverage

tt.plusMin can only be + or - so no need to have an elseif
2017-02-12 13:28:14 +01:00
Charles Pick
cd3f14921e Rename NumericLiteralTypeAnnotation to NumberLiteralTypeAnnotation (#332) 2017-02-12 13:14:35 +01:00
Daniel Tschinder
fac13290d7 Estree compatibility as plugin (#277)
* Initial estree support for ClassMethod

* Handle literals for estree

* Fix regex

* correct output of regexp and regenerate test

* Add tests for validation stuff with estree plugin

* Parse Properties correctly

This also refactors how babylon parses obj properties in general
so that this logic can be more easily extended.

* Run all throws-tests a second time with estree plugin

* Fix all throw tests

* Remove rebase conflict

* Correctly set kind

This ensures state.inMethod gets propagated correctly

* Add computed: false to methods with ident async

* Implement directive field on Directives

* Test invalid directives

* more tests
2017-02-12 12:48:41 +01:00
Kristof Degrave
1eaf01661b babel/babylon#328 babel/babylon#205 ?. as nullPropagation. For now it only works for member access. (.? or ?.[) If the object is undefined this will return undefined. If the object on which you want to access the property is defined, the value of the propery will be given back. 2017-02-11 21:20:15 +01:00
Kristof Degrave
b902fe6c7b ?. && ?[ as member access with nullPropagation. If the object is undefined this will return undefined. If the object on which you want to access the property is defined, the value of the propery will be given back. 2017-02-11 16:44:28 +01:00
Henry Zhu
dde70c0a04 [7.0] remove standalone babel package (#5293)
Having it isn't compatible with the changes for `babel-cli -> @babel/cli`
2017-02-10 14:40:24 -05:00
Daniel Tschinder
c79dd953ea Fix #304 and #309 (#339) 2017-02-10 15:36:46 +01:00
Raphael Mu
f25a2fbc78 add startLine option (#346) 2017-02-10 15:06:28 +01:00
Daniel Tschinder
407c97c9c2 Fix #321 by allowing question marks in type params (#338)
* Fix #321 by allowing question marks in type params

* Require commas between params
2017-02-10 15:03:15 +01:00
Daniel Tschinder
bc771bd0f9 Fix #336 by correctly setting arrow-param (#337) 2017-02-10 15:01:39 +01:00
Timothy Gu
88d38a1abb Update API documentation (#330) 2017-02-10 14:59:35 +01:00
Daniel Tschinder
4bd682e90b keywords are not allowed as local specifier (#307)
Also fix some error messages to be more specific
2017-02-10 14:58:44 +01:00
Panagiotis Vekris
e049ec3456 [Flow] Function predicate declaration (#103)
* [Flow] Function predicate declaration

The accepted syntax for function declarations is extended to allow
the following predicate declaration:

  FunctionReturnType :=
    Type
    Predicate
    Type Predicate

  Predicate :=
    %checks
    %checks ( ConditionalExpression )

* [Flow] Minor tweaks and more examples to function predicates

* [Flow] Clean-up and better message for function predicates

* [Flow] Adding abstract function predicate example

* [Flow] Rearranging the `predicate` field to ease babel generator.
2017-02-10 14:55:13 +01:00
james kyle
75ac320cf7 Add new flow preset (#5288) 2017-02-09 16:45:38 -08:00
Henry Zhu
870a37834c .gitignore for test [skip ci] 2017-02-09 19:19:41 -05:00
Henry Zhu
982cdb2a3a update yarn 2017-02-09 18:54:42 -05:00
Henry Zhu
ad91c6d186 use lerna@2-beta.37 (#5254) 2017-02-09 18:47:58 -05:00
Henry Zhu
9083bd6283 Merge branch 'master' into 7.0 2017-02-09 18:36:02 -05:00
Brandon Dail
56928dca66 [7.0] Remove ForAwaitStatement, add await flag to ForOfStatement (#349)
* Remove ForAwaitStatement, add await flag to ForOfStatement

* Set await flag for all ForOfStatements
2017-02-09 17:37:03 -05:00
Brian Ng
6da9bb83df Prevent multiple return statements in a loop when replacing expressions (#5030) 2017-02-09 13:06:41 -08:00
jwbay
1a325ce5d5 codegen performance: use trim-right instead of lodash/trimEnd (#5255) 2017-02-09 13:04:42 -08:00
greenkeeper[bot]
0834cb5b72 chore(package): update ava to version 0.18.0 (#345)
https://greenkeeper.io/
2017-02-09 14:55:55 +01:00
greenkeeper[bot]
b0220bfd3e chore(package): update babel-plugin-istanbul to version 4.0.0 (#350)
https://greenkeeper.io/
2017-02-09 14:30:19 +01:00
Sven SAULEAU
fb0a91b750 Fix TypeError with babel-register's cache (#5260) 2017-02-08 15:24:23 -05:00
Boopathi Rajaa
f8ffe03e79 Deopt evaluation of undefined with a local binding. Fix #5204 (#5206) 2017-02-08 10:37:14 -05:00
Mark Jones
5c5262437e Add definition of stage 3 (#5253) [skip ci] 2017-02-08 10:25:43 -05:00
Mark Jones
64e7d76b6b Added info about stage 2 (#5252) [skip ci] 2017-02-08 10:25:10 -05:00
Mark Jones
01eabd0d34 Add background for stage 1 (#5251) [skip ci] 2017-02-08 10:23:54 -05:00
Jimmy Jia
9de923258c Don't transpile ES7 symbol properties (#5195) 2017-02-07 11:19:14 -05:00
Vicente Jr Yuchitcho
1ba4a3fe5d Add path sibling traversal methods (#5230)
* getPrevSibling
* getNextSibling
* getAllNextSiblings
* getAllPrevSiblings
2017-02-07 11:17:50 -05:00
Łukasz Lityński
badce969da Fix confusing comment (#5272) (#5273) 2017-02-06 16:17:26 -08:00
Ben Alpert
ff8a10e52f Add option to block-scoping to slow on throw code (#5236)
The let/const plugin can add closures where you don't expect them. This is undesirable in some perf-sensitive projects (ex: React). I added an option that throws whenever the plugin adds a function (as opposed to simply renaming variables when converting to var).
2017-02-06 13:50:56 -05:00
Christina
6ee7bf6df5 checks if babel is installed globally and displays correct cli message (#5258)
* checks if babel is installed globally and displays correct cli message - fixes #5228

* recommend local installation and fix lint errors

* uses babel-cli vs babel

* switch back to babel

* use process.cwd() to determine if globally executed

* checks for /node_module/.bin/babel

* compare execPath and module execution path to determine global or local installation

* Move the babel/cli.js into a 'src' so the 'const's are compiled Node < 6.
2017-02-06 10:30:56 -08:00
Erik Desjardins
e9d7757433 Emit parens for await (but not yield) of ternary expressions (#5270) 2017-02-06 09:06:48 -08:00
Logan Smyth
6fa6f5924d [7.0] Run Babel's unittests in a custom sandbox (take 2). (#5263)
* Run Babel's unittests in a custom sandbox (take 2).

* Add tests for sandboxing behavior.
2017-02-04 13:31:33 -08:00
Andres Suarez
8c3392f058 Remove uses of lodash/compact (#5181) 2017-02-04 13:01:45 -08:00
Logan Smyth
b845f2b69d Re-enable the max-len ESLint rule. (#5265) 2017-02-04 11:07:15 -05:00
Logan Smyth
4d411ef83e Add a sublime project [skip ci] (#5264) 2017-02-03 17:52:29 -05:00
Marek Święcicki
ba0df23365 [7.0] Remove quotes option (#5154)
* remove mention of 'quotes' option from README.md

* always infer quotes option's value
2017-01-31 12:03:51 -08:00
StyMaar
283d9cbb9e Fix broken repository link in package.json (#5248) [skip ci] 2017-01-31 09:27:07 -05:00
Brian Ng
160bd3924b Normalize options sections in docs [skip ci] (#5244) 2017-01-31 08:46:01 -05:00
Henry Zhu
2104ab6c44 Add our business model [skip ci] (#5242)
- don't need to run tests for this one
2017-01-30 09:28:53 -08:00
Logan Smyth
510e93b2bd Merge pull request #5235 from mattste/fix4323
Limit export node default assignment stack size #4323
2017-01-28 12:55:29 -08:00
Matthew Stewart
d4790888a3 Limit export node default assignment stack size #4323
Signed-off-by: Matthew Stewart <mattdste@gmail.com>
2017-01-28 12:51:37 -05:00
Brian Ng
e530e3c025 [7.0] List babylon plugins instead of * in babel-generator tests (#5231) 2017-01-28 09:35:21 -05:00
Daniel Tschinder
0309a5ba8a Merge branch 'master' into 7.0
# Conflicts:
#	src/parser/statement.js
#	src/plugins/jsx/index.js
2017-01-27 23:12:20 +01:00
Daniel Tschinder
e614032504 Change location of ObjectTypeIndexer to match flow (#228) 2017-01-27 23:08:20 +01:00
jeromew
898c4a7623 Add a parseExpression public method (#213) 2017-01-27 20:13:02 +01:00
Dmytro
b6b4610cea added keywords to package.json (#323) 2017-01-27 19:44:09 +01:00
Daniel Tschinder
d2faddf0d9 Fix export default async function to be FunctionDeclaration (#324) 2017-01-27 19:43:06 +01:00
Toru Kobayashi
c424156751 Rename flow AST Type ExistentialTypeParam to ExistsTypeAnnotation (#322) 2017-01-27 19:42:15 +01:00
Kai Cataldo
e09ea222c9 Remove babel-runtime from packages' dependencies (#5218) 2017-01-27 09:04:35 -05:00
wtgtybhertgeghgtwtg
e5aa501327 Bump detect-indent. (#5226) 2017-01-27 09:02:48 -05:00
Artem Yavorsky
3f95a767f2 [7.0] Add legacy-decorators to stage-1. Fixes #5220 (#5225) 2017-01-27 09:02:10 -05:00
Fabian Finke
a97be35984 Add example to spread README [skip ci] (#5227) 2017-01-27 13:39:39 +01:00
Anderson Vasques
0766f29591 [7.0] Use lerna's --independent mode + changes (fixes #5221)
Adding version `independent` and cacheDir `.changelog`
2017-01-26 20:01:54 -05:00
Artem Yavorsky
bc02c95ef0 Fixes #143. Log correct targets. (#155) 2017-01-26 19:53:52 -05:00
Sven SAULEAU
446b4a7dbd docs: remove link to REPL (#5216) 2017-01-26 14:50:23 -06:00
Thomas Roch
a52265c79e docs: fix do expressions JSX example (#5214) [skip ci] 2017-01-26 11:04:56 -05:00
Brian Ng
963249fc4b Fix compat-table link in contributing.md 2017-01-26 09:54:48 -06:00
Sven SAULEAU
931cee7ab8 docs: [skip ci] update README (#5212) 2017-01-26 08:00:23 -05:00
Sven SAULEAU
aa7817bafb transform-regenerator README pt2 (#5203)
* docs: [skip ci] remove comments in JSON

* docs: [skip ci] nit remove duplicated babelrc
2017-01-24 15:32:18 +01:00
Sven SAULEAU
7fe59c38fe docs: [skip ci] update README (#5202) 2017-01-24 08:23:35 -06:00
Sven SAULEAU
2a1db1c250 docs: [skip ci] update README (#5200) 2017-01-24 08:00:31 -06:00
wtgtybhertgeghgtwtg
398b0326a3 [7.0] Bump home-or-tmp for babel-register. (#5189) 2017-01-23 23:35:44 -05:00
Brian Ng
33b8cc5cbb Update yarn lockfile (#152) 2017-01-23 18:23:04 -05:00
Brian Ng
3e41a2dacb Update README examples to fix website [skip ci] (#151) 2017-01-23 18:22:52 -05:00
Chau Nguyen
2ee3a017f0 [7.0] Added yarn.lock (#5175)
* Added yarn.lock

* Updated bootstrap npm install commands to yarn and added yarn caching
2017-01-23 18:15:33 -05:00
Andrew Levine
9929baaca8 Don't parse class properties without initializers when classProperties is disabled and Flow is enabled (#300) 2017-01-23 23:56:39 +01:00
Brian Ng
b69dc51be0 Fix missing parens when function expressions is tag (#5193) 2017-01-23 08:45:57 -08:00
Sven SAULEAU
c638985aca docs: [skip ci] update README (#5194) 2017-01-23 10:48:35 -05:00
Vivek Kumar Bansal
728072f47b [7.0] Remove old babel-runtime code (#5187) 2017-01-21 11:25:29 -05:00
Scott Arnold
20a5249dea [7.0] Drop support for Node 5 (#5186) 2017-01-21 10:14:49 -05:00
Henry Zhu
661102c7ea Merge branch 'master' into 7.0
# Conflicts:
#	.travis.yml
#	CHANGELOG.md
#	lerna.json
#	packages/babel-cli/package.json
2017-01-21 08:52:14 -05:00
Andres Suarez
e9d87ed55c Remove path-is-absolute in favor of builtin path.isAbsolute (#5179) 2017-01-21 08:33:34 -05:00
Brian Ng
d76092b2dd Internal: Run coverage only once (#5182) 2017-01-21 08:20:03 -05:00
Daniel Tschinder
b6c3b5aa83 Cleanup and splitup parser functions (#295)
This makes it easier to integrate the estree plugin.
2017-01-20 23:52:16 +01:00
Henry Zhu
3a0d1599cd Internal: only build once on CI (#5177) 2017-01-20 17:46:09 -05:00
Daniel Tschinder
0a00aff2fe Do not allow overwritting of primitive types (#314)
* Do not allow overwritting of primitive types

* Better name for method
2017-01-20 22:22:25 +01:00
Brian Ng
461ed45942 Fix parse error when destructuring set with default value (#317) 2017-01-20 22:21:40 +01:00
Daniel Tschinder
55df6631fa Address comments on flow type imports (#312) 2017-01-20 22:20:13 +01:00
Daniel Tschinder
d5cd2c3231 Allow imports in declare module (#315)
* Allow imports in declare module {}

* Rename bodyElement to bodyNode
2017-01-20 22:19:50 +01:00
Mathias Bynens
f2df08e253 AST spec: fix casing of RegExpLiteral (#318) [skip ci] 2017-01-20 11:05:21 -05:00
Henry Zhu
d7a0ef19f1 Run in dev on build otherwise it runs with coverage plugin (#5159) [skip ci] 2017-01-20 10:08:01 -05:00
Sergey Rubanov
7aa6387835 Add Node 7 to CI (#5165) 2017-01-20 10:07:32 -05:00
Mathias Bynens
090f7abda4 [7.0] babel-preset-stage-2: Add transform-unicode-property-regex (#3683)
This enables the use of Unicode property escapes of the form `\p{…}` and `\P{…}` in regular expressions with the `u` flag enabled.

More info: https://mathiasbynens.be/notes/es-unicode-property-escapes
Proposal: https://github.com/mathiasbynens/es-regexp-unicode-property-escapes
Plugin: https://github.com/mathiasbynens/babel-plugin-transform-unicode-property-regex
2017-01-20 08:17:25 -05:00
Colin
1aa7a2a1a3 Remove "class-constructor-call" syntax and transform plugins (#5119)
* removed class-constructor-call syntax and transform plugins and all references to them

* #5112, removed another reference to constructor call
2017-01-20 10:42:56 +01:00
Sergey Rubanov
d0b42d4313 Update babel-core browserify fixture (#5164) 2017-01-20 10:29:44 +01:00
Logan Smyth
85eec9ffef CHANGELOG for 6.22.2 2017-01-19 22:08:10 -08:00
Logan Smyth
7de9fa07fb v6.22.2 2017-01-19 22:03:27 -08:00
Logan Smyth
396634a51d Merge pull request #5162 from loganfsmyth/fix-5161
Break out of argument processing properly.
2017-01-19 22:00:58 -08:00
Logan Smyth
6528fe105e Break out of argument processing properly. 2017-01-19 21:47:11 -08:00
Adonis K
12886ea495 [7.0] Remove stage 4 plugins from stage 3 preset (#5126)
* remove trailing function commas from stage-3 preset (#5117)

trailing function commas is now a finished proposal and was moved to stage 4 (https://github.com/tc39/proposal-trailing-function-commas)

* remove the exponentiation operator from stage-3 preset (#5117)

exponentiation-operator is now a finished proposal and was moved to stage 4 (https://github.com/rwaldron/exponentiation-operator)

* remove async function to es2015 generator from stage-3 preset (#5117)

async functions is now a finished proposal and was moved to stage 4 (https://github.com/tc39/ecmascript-asyncawait)
2017-01-19 23:03:49 -05:00
Sergey Rubanov
b978996ba4 Remove add-module-exports use internally (#5131) 2017-01-19 23:02:19 -05:00
Jordan Jones
1742035a98 [7.0] Fixes #5108, browser.js and browser.js test removed (#5124)
* Fixes #5108, browser.js and browser.js test removed

* Moved api/node.js to index.js and adjusted associated file references
2017-01-19 22:43:11 -05:00
Janus Troelsen
e4ba28c294 [7.0] Dependencies: Upgrade regexpu-core to ^4.0.2 (#5028) 2017-01-19 22:33:46 -05:00
Anderson Vasques
81c3578adc [7.0] Remove old code used for backwards compatibility (#5122)
[7.0] Remove old code used for backwards compatibility in babel-polyfill

Fixes #5121
2017-01-19 22:32:16 -05:00
Chau Nguyen
d710e6dd5b [7.0] Drop flowUsesCommas option from babel-generator (#5123) 2017-01-19 22:24:13 -05:00
Sergey Rubanov
3a5ce620c8 [7.0] Deprecate babel-core/register.js (#5132)
* Deprecate babel-core/register.js

* add error when using `babel-core/register`
2017-01-19 22:22:45 -05:00
Shubheksha Jalan
c468b15a15 [7.0] removed old code from transform-runtime (#5142) 2017-01-19 22:20:04 -05:00
Henry Zhu
fabfc463f1 v6.22.1 changelog [skip ci] 2017-01-19 22:17:33 -05:00
Henry Zhu
368485828f v6.22.1 2017-01-19 22:12:53 -05:00
Henry Zhu
b06763f1a3 force update core/cli 2017-01-19 22:09:37 -05:00
Jason Aslakson
ef25bebfa8 fix issue #5012 - Cannot read property 'declarations' of null (#5019)
- temporary fix
2017-01-19 21:36:18 -05:00
Henry Zhu
ef3ab66847 Merge pull request #5025 from siddharthkp/patch-1
Drop support for Node 0.12 💀
2017-01-19 21:25:16 -05:00
Henry Zhu
e2c5a513f6 Create circle.yml 2017-01-19 20:42:25 -05:00
Henry Zhu
2471d5ebf3 Merge pull request #5041 from xtuc/remove-0.10-support
Remove node 0.10 support (CI)
2017-01-19 20:24:22 -05:00
Henry Zhu
e9fc38bcd3 v6.22.0 2017-01-19 19:33:22 -05:00
Henry Zhu
cc227f44a6 Merge pull request #5157 from babel/revert-5135-run-sandbox-tests
Revert "Run Babel's unittests in a custom sandbox."
2017-01-19 19:25:29 -05:00
Henry Zhu
03c88baf8d 6.22.0 changelog [skip ci] (#5158) 2017-01-19 19:24:23 -05:00
Henry Zhu
4106dd3db1 Revert "Run Babel's unittests in a custom sandbox." 2017-01-19 18:43:50 -05:00
Kilian Valkhof
4cefa5bcc0 Use external Electron to Chromium library (#144)
* Replace manual electron-to-chromium list and function with external library

* test fixtures for electron: Switch to electron 1.4, with known chrome version and update expected output

* update tests: electron 1.0 used chrome 49, not 50

* import only the relevant function from electron-to-chromium

* electron fixtures: Use number instead of string

* If both chrome and electron are defined, choose the lower version to preserve

* Add to test cases to verify correct handling of chrome number
2017-01-19 17:41:02 -05:00
Erik Desjardins
bca170ad79 Avoid duplicating impure expressions in object rest destructuring (#5151)
* avoid duplicating impure initializers in object rest destructuring

* reuse existing VariableDeclarations in object rest destructuring, to fix two issues:

1. inserting an additional VariableDeclaration after the current one may change order of operations, which is unsafe if a future VariableDeclarator refers to a destructured variable.

2. The entire VariableDeclaration is removed when all properties are rest properties, indiscriminately removing other variables
2017-01-18 21:32:44 -05:00
Brian Ng
235b1ba264 Merge pull request #146 from babel/typos
Fix few typos
2017-01-18 19:20:40 -06:00
Brian Ng
69870774e7 Fix few typos 2017-01-18 19:12:13 -06:00
Daniel Tschinder
a1bfa0253a Update yarn.lock 2017-01-18 20:43:31 +01:00
Eric Baer
80f93f3d87 Merge pull request #125 from babel/feature/extract-option-validation
Extract option normalization into independant file
2017-01-18 09:18:27 -08:00
Eric Baer
05353d5392 Extract option normalization into independant file 2017-01-18 09:01:06 -08:00
greenkeeper[bot]
1150c0d3fb chore(package): update flow-bin to version 0.38.0 (#313)
https://greenkeeper.io/
2017-01-18 16:49:12 +01:00
Toru Kobayashi
3871236723 transform-react-constant-elements hoists Composite Components (#5137) [skip ci] 2017-01-17 14:47:04 -05:00
Logan Smyth
c76b8eec82 Run Babel's unittests in a custom sandbox. (#5135) 2017-01-17 14:46:23 -05:00
Daniel Tschinder
999b655ca6 Disallow import type { type a } from … (#305) 2017-01-17 20:34:20 +01:00
Eric Baer
960ca93b7f Update yarnfile 2017-01-17 09:29:36 -08:00
Daniel Tschinder
56ac8b8f83 Increase cache timeout to 12h for top badges 2017-01-17 11:16:30 +01:00
Daniel Tschinder
7d4de327d0 remove style flat as it is default now 2017-01-17 11:03:16 +01:00
Brian Ng
8c35b320d3 Bump eslint-config-babel and fix lint (#5129) 2017-01-17 10:51:16 +01:00
Artem Yavorsky
2457c8ee14 [skip ci] Fix dependency status extension. (#5144) 2017-01-16 17:28:55 -06:00
Sergey Rubanov
292c3ca206 Refactor test packages to use ES modules instead of CJS (#5138) 2017-01-16 11:25:04 -05:00
Artem Yavorsky
b315fc6135 [skip ci] Add babel-preset-env to maintained list. (#5136) 2017-01-16 08:35:01 -05:00
Daniel Tschinder
bd001767fb Revert "Temporary rollback for erroring on trailing comma with spread (#154)" (#290)
This reverts commit 5bac6e8ad9.
2017-01-16 10:50:51 +01:00
Brian Ng
c5462e1a30 Remove classConstructorCall plugin (#291) 2017-01-16 10:49:42 +01:00
Dan Harper
28c467e8fe Fix ObjectTypeCallProperty static (#298)
* add failing test for ObjectTypeCallProperty static (#297)

* fix ObjectTypeCallProperty static
2017-01-16 10:42:13 +01:00
Gabriel Peña
00f03bb3b0 Remove '*' as a plugin option (#301) 2017-01-16 10:34:23 +01:00
Daniel Tschinder
5977479f57 Call inner function instead of 1:1 copy to plugin (#294) 2017-01-16 10:21:44 +01:00
Kai Cataldo
ad5698ed19 devDeps: eslint-config-babel v5.0.0 (#139) 2017-01-15 22:34:53 -05:00
Logan Smyth
e863790e7e Fix linting error from merged PR. 2017-01-15 15:29:26 -08:00
Logan Smyth
c5fb56e66c Bump out chokidar dependency for the new awaitWriteFinish option. 2017-01-15 14:45:48 -08:00
Logan Smyth
40746f3dcb Merge pull request #3698 from hayeah/master
Watch mode should wait for file write. (T7411)
2017-01-15 14:44:45 -08:00
Logan Smyth
a98c9ae9dc Merge pull request #4790 from peterm0x/master
fixes invalid line offsets in merged sourcemaps
2017-01-15 14:36:33 -08:00
Logan Smyth
7200626021 Merge pull request #5088 from christophehurpeau/fix-issue-4851
fix: plugin-transform-object-rest-spread param with default value
2017-01-15 14:27:56 -08:00
Logan Smyth
87c201fa47 Merge pull request #5043 from zertosh/no-lodash-is
Replace "lodash/is*" and "lodash/each" with native equivalents
2017-01-15 14:22:24 -08:00
Mark Wubben
20c9dca798 Document babelrc option (#5101)
The core package accepts a babelrc option, which if set to false stops
the transforms from using .babelrc and .babelignore files. Document
this option and remove the --no-babelrc CLI flag, referring to the CLI
documentation instead.

[skip ci]
2017-01-15 16:04:23 -06:00
Christophe Hurpeau
4a1965511f fix: plugin-transform-object-rest-spread param with default value 2017-01-15 14:02:08 -08:00
Logan Smyth
e18dc7a6d3 Avoid destructuring in untranspiled script. 2017-01-15 13:54:54 -08:00
Andres Suarez
658f13e030 Replace uses of "lodash/each" with native equivalents 2017-01-15 13:54:54 -08:00
Andres Suarez
2bee765e6b Replace lodash is* with equivalent typeof check 2017-01-15 13:53:58 -08:00
Logan Smyth
1ab58d6dae Merge pull request #5042 from zertosh/no-lodash1
Use native or lodash util module where full "lodash" is required
2017-01-15 13:53:30 -08:00
Andres Suarez
85b3aec747 Use native or lodash util module where full "lodash" is required 2017-01-15 13:35:00 -08:00
Logan Smyth
5d31316fb1 Merge pull request #5093 from existentialism/issue5090
Ensure array is always copied during destructure
2017-01-15 13:10:02 -08:00
Sven SAULEAU
00a34b9c2e fix: [skip ci] removed description (#5130) 2017-01-15 21:48:47 +01:00
Logan Smyth
17b711fa70 Merge pull request #5008 from babel/fix-5004
Don't try to visit ArrowFunctionExpression, they cannot be named
2017-01-15 11:47:52 -08:00
Sven SAULEAU
d67b55e88f fix: [skip ci] update supported environments 2017-01-15 19:45:07 +01:00
Brian Ng
da75840794 Merge pull request #138 from yavorsky/debug-example
README: Update `debug: true` example.
2017-01-15 11:46:22 -06:00
greenkeeper[bot]
68a173c97c Update eslint-config-babel to the latest version 🚀 (#299)
* chore(package): update eslint-config-babel to version 6.0.0

https://greenkeeper.io/

* Fix linting
2017-01-15 11:12:49 +01:00
Brian Ng
47bb77d352 Update babel-core options in README (#5114)
* Add wrapPluginVisitorMethod option to babel-core README [skip ci]

* fix typo

* alpha-sort options

* add note about introspection [skip ci]
2017-01-14 16:01:52 -05:00
Logan Smyth
3c2e9c0021 Merge pull request #5110 from loganfsmyth/flowtype-codegen
Validate importKind and ensure code generation exists.
2017-01-14 10:41:25 -08:00
Henry Zhu
672adba9a1 enable prefer const (#5113) 2017-01-14 09:48:52 -05:00
Sven SAULEAU
982850731e fix: [skip ci] consistent documentation (#5111) 2017-01-14 09:45:20 -05:00
Brian Ng
9d78213ab6 Improve error message on attempt to destructure named import (#288) 2017-01-14 15:38:30 +01:00
Henry Zhu
d3f3aced40 mention-bot: remove comments [skip ci] 2017-01-14 09:29:45 -05:00
Daniel Tschinder
b918554d73 Correct indent eslint rule config (#276)
* Change indent rule to correctly lint

* Remove rule again
2017-01-14 15:11:50 +01:00
greenkeeper[bot]
62d1970f77 Update eslint-config-babel to the latest version 🚀 (#293)
* chore(package): update eslint-config-babel to version 5.0.0

https://greenkeeper.io/

* fix lint warnings
2017-01-14 15:04:10 +01:00
Sven SAULEAU
1691fc959f Add mention-bot (#5057) [skip ci] 2017-01-14 08:21:58 -05:00
Kai Cataldo
a465d2580e devDeps: remove eslint-plugin-babel (#292) 2017-01-14 08:01:13 -05:00
Logan Smyth
80a757819f Validate importKind and ensure code generation exists. 2017-01-13 22:17:39 -08:00
Logan Smyth
2e6713209c Merge pull request #5035 from jeffmo/import_type_shorthand
Strip Flow's new shorthand import-type specifiers
2017-01-13 21:56:18 -08:00
Brian Ng
761079fac0 Add examples to computed-props and for-of READMEs [skip ci] (#5096) 2017-01-13 20:23:13 -05:00
Artem Yavorsky
2450f7a5ae Add configuration example to clarify debug: true 2017-01-14 02:57:29 +02:00
Jeff Morrison
b820d8ebc9 Strip Flow's new shorthand import-type specifiers 2017-01-13 13:24:33 -05:00
Simon Lydell
d2113d4881 babel-code-frame: Upgrade to js-tokens@3 (#5094)
That version brings a big performance boost.
2017-01-13 12:11:44 -05:00
Sérgio Batista
3a1c0c84fb Fix broken repository url (#5100) 2017-01-13 15:16:07 +01:00
Artem Yavorsky
5fe1ee3a6a README: Update debug: true example. 2017-01-13 12:18:24 +02:00
Daniel Tschinder
7a3e717f15 Update yarn.lock 2017-01-12 22:55:00 +01:00
Daniel Tschinder
8f7a19e3ad Update cross-env to 3.x 2017-01-12 22:53:48 +01:00
Sergey Rubanov
b72d4d40a5 [7.0] Remove node 0.10, 0.12 and 5 from Travis (#284)
* Remove node 0.10, 0.12 and 5 from Travis

* add engines to package.json
2017-01-12 22:51:05 +01:00
Daniel Tschinder
5785f0ce72 Merge branch 'master' into 7.0 2017-01-12 22:42:25 +01:00
Daniel Tschinder
13bebfdf45 Fail tests that have expected.json and throws-option (#285)
* Fail tests that have expected.json and throws

* Remove obsolete test files
2017-01-12 22:38:41 +01:00
Brian Ng
46d9339488 arrow 2017-01-11 17:12:09 -06:00
Henry Zhu
28e54d4d5f Update compat-table, build data (#135) 2017-01-11 15:03:10 -05:00
Brian Ng
a749907bc2 Ensure array is always copied during destructure 2017-01-11 09:23:21 -06:00
Brian Ng
cb260bff06 Merge pull request #136 from yavorsky/changelog-typo
Fix CHANGELOG’s v1.1.8 updates typo.
2017-01-11 08:01:13 -06:00
Artem Yavorsky
7552cb5b0a Fix CHANGELOG’s v1.1.8 updates typo. 2017-01-11 12:46:35 +02:00
Daniel Tschinder
aa1a4be5ec 6.15.0 2017-01-10 22:38:45 +01:00
Daniel Tschinder
fdc106c9b6 Update yarn.lock 2017-01-10 22:37:36 +01:00
Daniel Tschinder
0f0b7290f4 Changelog 6.15.0 (#283)
* Update CHANGELOG.md

* Update CHANGELOG.md [skip ci]
2017-01-10 22:35:19 +01:00
Henry Zhu
6edb5a46a1 1.1.8 2017-01-10 14:34:05 -05:00
Henry Zhu
70bebfae93 update changelog [skip ci] 2017-01-10 14:33:55 -05:00
Sven SAULEAU
ed13a4ab05 Refactor tokenizer types file (#263)
* refactor(tokenizer): use class for keywork tokens

* refactor(tokenizer): re-use constacts in types

* refactor(tokenizer): binop token type

* feat(tokenizer): use beforeAndStartExpr for shortcut

* fix(tokenizer): typo in keywordTokenType

* refactor(tokenizer): don't use spread operator

* refactor(tokenizer): constant for isLoop, isAssign, prefix, postfix

* fix(tokenizer): remove constant beforeAndStartExpr

* style(tokenizer): space after comma
2017-01-10 20:22:56 +01:00
Mathias Bynens
ed625cb2e1 Remove String.fromCodePoint shim (#279)
This is not necessary anymore if we drop support for Node.js v0.10 and v0.12.

Ref. https://github.com/babel/babel/issues/4315.
2017-01-10 20:14:11 +01:00
Ryan Plant
5055b335b2 Rename folder to avoid Windows-illegal characters (#281) 2017-01-10 14:12:13 -05:00
greenkeeper[bot]
6773279039 Update eslint-config-babel to the latest version 🚀 (#273)
* chore(package): update eslint-config-babel to version 4.0.0

https://greenkeeper.io/

* Fix prefer-const

* Update package.json
2017-01-10 19:42:43 +01:00
Brian Ng
fa8f09bc6e Include yarn.lock and update CI (#124) 2017-01-10 12:05:35 -05:00
Artem Yavorsky
74f2fb17a1 Transformations before logs (#128) 2017-01-10 12:03:07 -05:00
Daniel Tschinder
cd9aaf2a58 Fix syntax error in .travis.yml 2017-01-10 15:06:08 +01:00
Roman Yakobnyuk
e56c318eed remove unnecessary extension (#131) 2017-01-09 17:47:31 -05:00
Henry Zhu
db7e87b219 1.1.7 2017-01-09 11:05:45 -05:00
Ryan Tsao
39d18679e1 Fix getBindingIdentifiers in babel-types (#5068)
* Added getBindingIdentifier tests

* Added failing test for getBindingIdentifiers

* Fix babel-types getBindingIdentifiers
2017-01-09 09:08:07 -05:00
Daniel Tschinder
dc617129f6 Optimize removal-hooks for ArrowFunctions (#5076) 2017-01-09 09:05:23 -05:00
Karsten Gohm
de1a76413f Static function call result comment does not match variable content (#5077)
static staticProperty, defined in line 18, value is 'babeliscool' but comment on line 33 the given sample output is 'babelIsCool'. 
this commit fixes this inconsistency
2017-01-09 09:02:19 -05:00
Daniel Tschinder
008a29cb5f Update yarn.lock 2017-01-08 00:33:39 +01:00
greenkeeper[bot]
326670dd29 chore(package): update rollup to version 0.41.0 (#272)
https://greenkeeper.io/
2017-01-08 00:28:44 +01:00
Henry Zhu
9031ea073c 1.1.6 2017-01-06 17:34:29 -05:00
Henry Zhu
7ef4313141 v1.1.6 changelog [skip ci] 2017-01-06 17:34:23 -05:00
Marco Massarotto
1815ffab14 Explicitly resolve lowest browser version (#121)
stop relying on browserlist returning a list sorted by browser version
fix #119
2017-01-06 17:18:43 -05:00
Anthony Zotti
d1cd179c45 Update LICENSE (#5058) 2017-01-05 22:12:12 +01:00
Andrew Levine
cec8bc0354 Add some test coverage for decorators stage-0 plugin (#250) 2017-01-05 22:07:40 +01:00
Andrii Bida
3ef99d1467 Fix typo in README.md (#5070)
Minor typo fix: added the missing space.
2017-01-05 14:43:26 -06:00
Henry Zhu
dc46adf519 test actual requires from useBuiltIns (#95)
* test actual requires from useBuiltIns

* only run on npm 3 for now
2017-01-05 10:21:56 -05:00
Andres Suarez
796c6c0763 Remove unused dependency (#5038) 2017-01-05 08:17:16 -05:00
Brian Ng
2a8d3173d3 Remove unused define-map helper from computed-properties (#5053) 2017-01-05 08:16:35 -05:00
Vladimir Kurchatkin
3267e5f365 Don't set inType flag when parsing property names (#266)
* Don't set inType flag when parsing property names

* Add inPropertyName type definition

* Move inPropertyName check before this.curContext()
2017-01-05 12:25:57 +01:00
greenkeeper[bot]
dd4c4ead2d chore(package): update rollup to version 0.40.0 (#270)
https://greenkeeper.io/
2017-01-05 12:24:31 +01:00
Henry Zhu
0ac127ce60 v1.1.5 changelog [skip ci] (#118) 2017-01-04 13:00:30 -05:00
Henry Zhu
a9181a218c 1.1.5 2017-01-04 12:44:18 -05:00
Jeff Morrison
9ea4e9dead Add support for Flow shorthand import type (#267) 2017-01-03 10:52:18 +01:00
Brian Ng
76e12a3cae Show error if target version is not a number (#107) 2017-01-02 23:55:32 -05:00
Henry Zhu
ec99493e53 Merge pull request #109 from yavorsky/debug-targets
Fix targets for debug.
2017-01-02 23:55:05 -05:00
Alex Rattray
68bb1c6598 Allow this.state.clone() when parsing decorators (#262)
Adding the line `this.state = this.state.clone();` in a parser plugin 
(specifically, in my case `parseExprAtom`)
would break decorators. 

This change fixes that.
2017-01-02 10:37:05 +01:00
Ryan Duffy
1c13800efd Use fromCodePoint to convert high value unicode entities (#243)
* Use fromCodePoint to convert high value unicode entities

* Include polyfill for String.fromCodePoint

* copy and adapt fromCodePoint into String.fromcodepoint

In order to avoid modifying String as the polyfill does, I've copied
the source from the polyfill and adapted it return the polyfill
function if the native version does not exist. Once support for node
versions that lack fromCodePoint is dropped, this polyfill can be
removed.

* move license notice to top of file
2017-01-02 10:15:56 +01:00
Vladimir Kurchatkin
3dc403974c flow: allow leading pipes in all positions (#256) 2017-01-02 10:13:53 +01:00
Daniel Tschinder
b875ed755b Update yarn.lock 2017-01-02 10:00:13 +01:00
Daniel Tschinder
0fb1be4744 User external-helpers (#254)
Add yarn.lock as recommended
2017-01-02 09:57:55 +01:00
greenkeeper[bot]
7e6b0dac5c chore(package): update rollup to version 0.39.0 (#269)
https://greenkeeper.io/
2017-01-02 09:57:05 +01:00
Brian Ng
f611cab0f5 Fix some doc lint issues (#5061)
* Remove duplicate usage section from transform-es2015-classes [skip ci]

* Fix doc lint issue with transform-function-bind [skip ci]
2017-01-02 09:01:08 +01:00
Brian Ng
ad23d2ee39 Drop unneeded eslint-plugin-flow-vars dep (#115) 2017-01-01 22:25:50 -05:00
Sven SAULEAU
39cda64fe2 docs: [skip ci] incorrect snippet language (#5059) 2017-01-01 14:59:50 +01:00
Sven SAULEAU
b443f3e158 Merge pull request #5051 from gitanupam/patch-1
Adding more info to the Install section
2016-12-29 08:28:49 +01:00
greenkeeper[bot]
d3507eb5ce chore(package): update rollup to version 0.38.0 (#265)
https://greenkeeper.io/
2016-12-28 22:59:57 +01:00
Sven SAULEAU
fbeadc46ea [skip ci] merge documentation with the website 2016-12-28 21:49:40 +01:00
gitanupam
438c872e64 Adding more info to the Install section
It was confusing to see the Install command for babel-present-react again when the earlier command to install CLI also included babel-preset-react. Hence the edit.
2016-12-28 16:24:00 +05:30
Brian Ng
b1635f8c05 Fix some README links [skip ci] (#5045) 2016-12-27 09:30:14 -05:00
Sven SAULEAU
90279f102f docs: remove compiler support for 0.10 2016-12-25 20:54:38 +01:00
Sven SAULEAU
8b25e21520 build: remove Circle CI 2016-12-25 20:54:20 +01:00
Artem Yavorsky
1fa3916f75 Use parsed targets for Using targets log. 2016-12-23 13:28:33 +02:00
Artem Yavorsky
63c0931340 Make plugin output single-lined. 2016-12-23 13:22:45 +02:00
Artem Yavorsky
c0b8f5b604 Fix targets for debug. 2016-12-23 01:42:30 +02:00
Janus Troelsen
b2e6926042 Upgrade glob to v7 (#5027) 2016-12-22 23:57:53 +01:00
Henry Zhu
b583829809 remove plugin links, just use the website [skip ci] (#5031) 2016-12-22 11:06:00 -05:00
Sven SAULEAU
1f116e1e9d Merge pull request #5011 from babel/add-team
Add Team section [skip ci]
2016-12-22 16:49:28 +01:00
Logan Smyth
f89461906d Merge pull request #5026 from chicoxyzzy/dont_add_spaces_in_template_literals
Remove unnecessary spaces around template element
2016-12-21 21:19:08 -08:00
Sven SAULEAU
1672982873 fix: require debug directly instead of debug/node 2016-12-21 18:09:58 +01:00
chico
07b5b0edf8 fix one more fixture 2016-12-21 19:28:36 +03:00
chico
2d7703afd9 Like was discussed in Slack chat with @ljharb and @hzoo spaces was added with no particular reason.
https://babeljs.slack.com/archives/discussion/p1481744017001806

I'm still not sure if everything here is correct (for example source maps)
2016-12-21 19:14:39 +03:00
Siddharth Kshetrapal
868c9ecc11 change node version in contributing 2016-12-21 12:35:16 +05:30
Siddharth Kshetrapal
7135751750 Drop support for Node 0.12 💀 2016-12-21 12:28:28 +05:30
Logan Smyth
ce0c620a9f Merge pull request #4729 from rmacklin/add-resolvePlugin-and-resolvePreset
Add resolvePlugin and resolvePreset methods to babel-core API
2016-12-20 08:42:27 -08:00
Sven SAULEAU
8edc1d9530 Merge pull request #5014 from babel/xtuc-patch-2
Update babel-core's README
2016-12-18 15:21:51 +01:00
Logan Smyth
1a8150ef97 v6.21.1 2016-12-17 21:15:33 -08:00
Logan Smyth
405697558e v6.21.1 changelog [skip ci] 2016-12-17 21:09:26 -08:00
Logan Smyth
545162ff1a Merge pull request #5015 from loganfsmyth/revert-react-jsx
Revert babel-helper-builder-react-jsx change from #4988
2016-12-17 21:07:56 -08:00
Logan Smyth
dbc07220ae Revert babel-helper-builder-react-jsx change from #4988 2016-12-17 20:50:03 -08:00
Sven SAULEAU
9d76f0b2de [skip ci] update README 2016-12-17 16:37:45 +01:00
Sven SAULEAU
3ef8e61d72 [skip ci] update babel-core's README 2016-12-17 12:41:49 +01:00
Sven SAULEAU
aaa250c17a [skip ci] Split members in README 2016-12-17 11:20:02 +01:00
Sven SAULEAU
9fd3f204dd [skip ci] update README 2016-12-17 11:12:36 +01:00
Sven SAULEAU
84bae86ae2 [skip ci] update README
Add xtuc to members
2016-12-17 10:50:24 +01:00
Henry Zhu
96084983e6 Add Team section [skip ci] 2016-12-16 20:38:27 -05:00
Henry Zhu
6cb4e8ddcc changelog [skip ci] 2016-12-16 18:07:31 -05:00
Henry Zhu
783a0bdc9c 1.1.4 2016-12-16 18:05:23 -05:00
Henry Zhu
44b140af23 1.1.3 2016-12-16 18:03:33 -05:00
Henry Zhu
da8ed9643b fix debug 2016-12-16 18:03:29 -05:00
Henry Zhu
e3abd80927 1.1.2 2016-12-16 17:27:00 -05:00
Henry Zhu
c6afaa74d4 fix include/exclude for built-ins (#102) 2016-12-16 17:26:15 -05:00
Henry Zhu
77d9e3e5c4 v6.21.0 2016-12-16 16:55:53 -05:00
Henry Zhu
3c28b4e1ac remove old code/license [skip ci] 2016-12-16 16:54:08 -05:00
Henry Zhu
542e4e9ee1 update babel-types readme [skip ci] 2016-12-16 16:50:41 -05:00
Henry Zhu
a73115f401 update core [skip ci] 2016-12-16 16:49:58 -05:00
Henry Zhu
8442dbdf29 v6.21.0 changelog [skip ci] (#5010) 2016-12-16 16:43:18 -05:00
Dan Harper
d90aaf2c76 Print Flow optional & type annotations in function params with defaults (#4872)
Fixes #4863
2016-12-16 15:31:05 -05:00
Brian Ng
01bc43464e Ensure directives get printed in block statements (#4873) 2016-12-16 15:30:14 -05:00
Justin Ridgewell
2bbc36d25e JSXSpreadChildren, throw in transform-react-jsx (#4988) 2016-12-16 15:30:00 -05:00
Henry Zhu
670ee996c8 Merge pull request #4940 from appden/fix-react-constant-elements
Fix React constant element bugs
2016-12-16 15:29:05 -05:00
Christoph Pojer
003d03789f Merge pull request #4979 from davidaurelio/generator-raw-mappings
babel-generator: Expose raw mappings
2016-12-16 20:00:48 +00:00
Henry Zhu
bfe4faa0d9 fix tests 2016-12-16 11:50:57 -05:00
Justin Ridgewell
852348d700 Fix default parameter - rest parameter edge case (#3572)
When the rest parameter shared the same name as a default identifier
for a param, the loop would be hoisted outside the function!

```js
var a = 1;

for (var _len = arguments.length, a = Array(_len > 1 ? _len - 1 : 0),
_key = 1; _key < _len; _key++) {
  a[_key - 1] = arguments[_key];
}

function foo2() {
  var b = arguments.length <= 0 || arguments[0] === undefined ? a :
arguments[0];

  assert.equal(b, 1);
}
foo2(undefined, 2);
```

And if you tried to reference any index or `#length`, it’d blow up and
refuse to transpile.
2016-12-16 10:53:52 -05:00
Brian Ng
196cdd4dce Bail on sharing comments with siblings if key is a string (#5007) 2016-12-16 10:52:48 -05:00
Henry Zhu
69a9f6bf70 babel-helper-transform-fixture-test-runner: pass require as a global (#4999) 2016-12-16 10:51:37 -05:00
Henry Zhu
c1e2b0dddc internal: don't run watch with the test env (skip building with code coverage) [skip ci] (#5005) 2016-12-16 10:51:18 -05:00
Diogo Franco (Kovensky)
31b85a36dd Add fixture for known bug 2016-12-16 11:25:42 +09:00
Diogo Franco (Kovensky)
ccf2f56085 Don't try to visit ArrowFunctionExpression, they cannot be named
They will still be visited if the arrow functions are transformed to regular
functions.

Fixes #5004
2016-12-16 11:14:47 +09:00
David Aurelio
2907d663dc add comments 2016-12-16 01:12:50 +00:00
Sven SAULEAU
dabac6ed5f [skip ci] update README (#100) 2016-12-15 13:30:28 -05:00
Henry Zhu
a6cbb76a0b Merge pull request #96 from babel/readme-tweaks
Tweak README
2016-12-14 23:00:26 -05:00
Brian Ng
72f2cc59ed edits 2016-12-14 21:14:19 -06:00
Brian Ng
4760d2ed09 Merge pull request #97 from babel/readme-improvements
Improve README
2016-12-14 20:48:11 -06:00
Diogo Franco
88227f0677 Merge branch 'readme-tweaks' into readme-improvements 2016-12-15 11:39:23 +09:00
Diogo Franco
bf9ff5c4e6 Improve README 2016-12-15 11:17:41 +09:00
Brian Ng
f4788264c5 Tweak README 2016-12-14 19:57:10 -06:00
James Long
ba96b91f40 Fix source location for JSXEmptyExpression nodes (fixes #248) (#249) 2016-12-14 16:32:36 -05:00
Henry Zhu
e06faa99da fix sizing [skip ci] 2016-12-14 10:31:23 -05:00
Henry Zhu
63f673593e typo [skip ci] 2016-12-14 10:30:43 -05:00
Henry Zhu
a025cf1890 changelog for v6.20.1 to v6.20.3 [skip ci] 2016-12-14 10:29:47 -05:00
Henry Zhu
d1160cabb1 mention repl/link [skip ci] 2016-12-14 09:09:39 -05:00
Henry Zhu
cd2a9b0418 add semver label [skip ci] 2016-12-14 09:07:54 -05:00
David Aurelio
4cb7e5009a Add missing property descriptor values 2016-12-14 10:18:18 +00:00
Henry Zhu
dbcd9f4ad6 v1.1.1 changelog [skip ci] 2016-12-13 18:27:40 -05:00
Henry Zhu
01415d3fd8 1.1.1 2016-12-13 18:11:53 -05:00
Henry Zhu
7e8fbd5177 fix issue with using Object.values 2016-12-13 18:11:45 -05:00
Henry Zhu
c9ff11ccb8 1.1.0 2016-12-13 18:00:47 -05:00
Henry Zhu
206f60767b fixes [skip ci] 2016-12-13 18:00:11 -05:00
Henry Zhu
b5e00eeb5b changelog 1.1.0 [skip ci] (#93) 2016-12-13 17:59:23 -05:00
greenkeeper[bot]
4958225645 chore(package): update rollup to version 0.37.0 (#253)
https://greenkeeper.io/
2016-12-13 23:50:07 +01:00
Henry Zhu
45370e3553 add exclude option, rename whitelist to include (#89) 2016-12-13 16:16:54 -05:00
greenkeeper[bot]
9adfd4c4e2 chore(package): update flow-bin to version 0.37.0 (#255)
https://greenkeeper.io/
2016-12-13 10:31:59 +01:00
Brian Ng
0ad9b7a177 Merge pull request #88 from babel/feature/move-erroneous-dependency-to-dev
Move linting dependency to be dev only
2016-12-12 12:03:58 -06:00
Eric Baer
81c157b285 Cleanup lib before rebuilding (#87) 2016-12-12 12:34:27 -05:00
Eric Baer
3ef4001521 Move linting dependency to be dev only 2016-12-12 09:31:45 -08:00
Eric Baer
e379681b58 Update pathnames to aviod uppercase + consistent with other babel projects 2016-12-12 08:59:52 -05:00
Henry Zhu
8622d0af39 lint [skip ci] 2016-12-12 08:57:51 -05:00
Artem Yavorsky
635e76c85a Optimize result filtration. (#77) 2016-12-12 08:48:18 -05:00
Henry Zhu
823facba3f call out useBuiltIns [skip ci] 2016-12-12 08:47:06 -05:00
Eric Baer
9439b7fe1a Refactor build data for clarity/consistency (#81) 2016-12-12 08:11:19 -05:00
Eric Baer
4a27c280ba Update linting rules to cover all js (#82) 2016-12-12 08:02:44 -05:00
Yuta Hiroto
68148b8a05 Fix links in CONTRIBUTING.md [skip ci] (#4989) 2016-12-12 08:00:16 -05:00
Eric Baer
a9d99fd135 Update eslint config to align with other babel projects (#79) 2016-12-12 00:33:18 -05:00
Henry Zhu
51fd3dafd1 add electron, opera to examples [skip ci] 2016-12-11 21:30:27 -05:00
Henry Zhu
69161decd3 add some other projects! [skip ci] 2016-12-11 21:27:49 -05:00
Henry Zhu
0ed97ce941 make installing runtime/transform-runtime clearer [skip ci] (#4991) 2016-12-11 21:04:24 -05:00
Muhammad Habib Rohman
8346c0db41 Fix typo (#78) [skip ci] 2016-12-11 19:18:07 -05:00
Nazim Hajidin
a98e1a0604 Fix PR link in changelog. (#75) [skip ci] 2016-12-10 16:21:17 -05:00
Henry Zhu
37c1e40e5c update example [skip ci] (#74) 2016-12-10 12:07:07 -05:00
Henry Zhu
b78eb34fa6 v1.0.2 changelog [skip ci] (#73) 2016-12-10 11:40:35 -05:00
Henry Zhu
21dfdd8bbb 1.0.2 2016-12-10 11:34:07 -05:00
Brian Ng
3b60dc5444 Fix issue with Object.getOwnPropertySymbols (#71) 2016-12-10 11:33:22 -05:00
Henry Zhu
9a69fff935 1.0.1 2016-12-10 10:20:22 -05:00
Henry Zhu
f1619e9b16 v1.0.1 changelog (#69) [skip ci] 2016-12-10 10:15:59 -05:00
Henry Zhu
44c40cf7ab fix regenerator import (#68) 2016-12-10 10:11:15 -05:00
Henry Zhu
b8f03ee09d 1.0.0 2016-12-09 15:51:53 -05:00
Henry Zhu
552f587082 changelog (#65) 2016-12-09 15:49:04 -05:00
Henry Zhu
64ed1ba167 add tests for electron option
Closes gh-55
2016-12-09 14:42:26 -05:00
Paul Betts
a38f07181d Map Electron versions to Chromium ones 2016-12-09 14:42:11 -05:00
Henry Zhu
b44949025a Merge pull request #56 from babel/builtins-option
add useBuiltIns option
2016-12-09 11:57:46 -05:00
Brian Ng
7b5e6f1e50 Add example to es2015-unicode-regex [skip ci] (#4983) 2016-12-09 11:55:19 -05:00
Henry Zhu
08cd975eb4 always include web polyfills for now 2016-12-09 11:23:46 -05:00
Henry Zhu
d2976bed13 remove console.log, fix tests 2016-12-09 11:23:46 -05:00
Brian Ng
66ab523dd6 Use array features for symbol and array.iterator (#64) 2016-12-09 11:23:46 -05:00
Henry Zhu
d318916416 do not count against if core-js does not implement 2016-12-09 11:23:46 -05:00
Henry Zhu
541ebb5e5f also import regenerator when the transform is required 2016-12-09 11:23:46 -05:00
Henry Zhu
8e2aa82991 also transform 'core-js' 2016-12-09 11:23:46 -05:00
Henry Zhu
5d32ca6bb3 prevent duplicate imports 2016-12-09 11:23:46 -05:00
Henry Zhu
69e9138637 extra tests 2016-12-09 11:23:46 -05:00
Henry Zhu
771e5d2cd6 account for multiple features (#62) 2016-12-09 11:23:46 -05:00
Henry Zhu
bd1ed28242 separate years, add es2016, es2017 2016-12-09 11:23:46 -05:00
Brian Ng
4d40b6ab5b Add builtins for object and es7 string 2016-12-09 11:23:46 -05:00
Artem Yavorsky
99c078e92a Add logs for polyfills. (#59) 2016-12-09 11:23:46 -05:00
Henry Zhu
6ffd13af85 fixes 2016-12-09 11:23:46 -05:00
Henry Zhu
a238bf368a update readme 2016-12-09 11:23:46 -05:00
David Aurelio
7ea283eb82 babel-generator: Expose raw mappings
Exposes raw mappings when source map generation is enabled. To avoid the cost of source map generation for consumers of the raw mappings only, `.map` is changed to a getter that generates the source map lazily on first access.
2016-12-09 09:55:42 +00:00
Henry Zhu
71a9e3275d v6.20.3 2016-12-08 21:55:37 -05:00
Logan Smyth
5aa87aab8d Calculate the correct arity for async functions with destructuring - fixes #4977 (#4978) 2016-12-08 21:51:24 -05:00
Henry Zhu
d597678def v6.20.2 2016-12-08 20:15:21 -05:00
Henry Zhu
cfc1e5cb38 fix object spread (#4976) 2016-12-08 20:13:57 -05:00
Henry Zhu
10d75f6d8a fix clean lib 2016-12-08 19:45:26 -05:00
Henry Zhu
07d49ffabf update readme [skip ci] 2016-12-08 19:33:55 -05:00
Henry Zhu
2bb9ab04e3 v6.20.1 2016-12-08 19:32:27 -05:00
Henry Zhu
88bc28c414 Fix nested object spread (#4974) 2016-12-08 19:30:50 -05:00
Henry Zhu
608e77e389 v6.20.0 2016-12-08 18:25:39 -05:00
Henry Zhu
16a05166b2 v6.20.0 changelog [skip ci] (#4971)
* v6.20.0 changelog [skip ci]
* remove old license since rewrite [skip ci]
2016-12-08 18:17:33 -05:00
Brian Ng
db04f99124 Raise limit on code size before compacting (#4965) 2016-12-08 18:08:56 -05:00
Ben Newman
16c84fb353 Use regenerator-transform to implement babel-plugin-transform-regenerator (#4881)
* Use regenerator-transform to implement babel-plugin-transform-regenerator.

Though I believe this is safe to merge, you may want to wait to merge it
until https://github.com/facebook/regenerator/pull/259 is merged. That
pull request also provides more explanation of why I think moving the
implementation of Regenerator back to its original repository is a good
idea. I'm happy to compromise on anything necessary to make this happen.

Note that the regenerator-transform version is pegged to an exact version
(0.9.7). Past experience has taught me that releasing new versions of
Regenerator is almost impossible if client projects are allowed to pull in
new patch versions automatically. I will happily submit a pull request
whenever a new version is released.

* Remove never-used babel-plugin-transform-regenerator/.test directory.

* regenerator-transform to 0.9.8
2016-12-08 15:17:03 -05:00
Boopathi Rajaa
73ff13f326 Add getBindingIdentifierPaths/getOuterBindingIdentifierPaths (#4876) 2016-12-08 12:43:14 -05:00
Justin Ridgewell
32aa1f75d6 Hoist generateDeclaredUidIdentifier helper function (#4934) 2016-12-08 12:42:22 -05:00
Daniel Tschinder
375838db35 Prepare tests for multiple fixture runners. (#240)
* Prepare tests for multiple fixture runners.

* Replace ES2015
2016-12-08 17:58:53 +01:00
wtgtybhertgeghgtwtg
7a18a01411 Add .eslintignore and .travis.yml to .npmignore. (#63) [skip ci] 2016-12-08 11:49:29 -05:00
Denis Pushkarev
492e79f76d update regenerator-runtime in babel-polypill (#4966) 2016-12-08 10:58:22 -05:00
Henry Zhu
f8f78f50e5 Temp fix for make watch [skip ci] (#4967) 2016-12-08 10:42:31 -05:00
Ben Newman
26b4e0909e Add (and fix) failing test of function parameter bindings in a catch block (#4880)
* Add failing test of function parameter bindings in a catch block.

This test can be run in isolation via the following command:

  TEST_GREP='block-scoping.*function in catch' make test-only

This test fails because BlockScoping#getLetReferences accidentally
considers the parameters of the function declaration as let bindings in
the catch scope. When the name of the catch parameter is the same as one
of the function's parameter names, the function declaration will be
unnecessarily wrapped to isolate its parameters from the outer scope.

While the extra wrapping may not seem harmful in this case, this behavior
is a symptom of a deeper problem that causes very subtle bugs in transform
code involving catch parameters and function declarations. This test case
was just the simplest example I could find to demonstrate the problem.

I have a proposed fix for this problem that I will push as soon as the
tests fail for this commit.

* Make BlockScoping#getLetReferences ignore function parameters.
2016-12-08 10:16:48 -05:00
Ben Newman
44fe114939 Upgrade regenerator-runtime to version 0.10.0. (#4877)
This changes the behavior of `runtime.awrap` to match the output of https://github.com/leebyron/async-to-gen.

See this commit for further explanation of why this change is a good idea: e62a7e5008
2016-12-08 10:13:53 -05:00
wtgtybhertgeghgtwtg
d1c640ea61 Add /.test and /src to babel-plugin-transform-regenerator .npmignore. (#4961) [skip ci] 2016-12-08 10:12:29 -05:00
Logan Smyth
80dfdd2a43 Only base async fn arity on non-default/non-rest params - fixes #4891 (#4901) 2016-12-08 09:48:15 -05:00
Sean Larkin
39c92160f7 Add generator support for Import (#4945) 2016-12-07 18:22:12 -05:00
Sven SAULEAU
455d888ce8 update package documentation (#4948) [skip ci] 2016-12-06 14:24:52 -05:00
Andrew Levine
30545e883f Freeze current plugins list for "*" option, and remove from README.md (#245) 2016-12-06 14:09:36 -05:00
Henry Zhu
219f629267 update readme [skip ci] 2016-12-05 22:51:33 -05:00
Henry Zhu
066445ca30 add downloads badge [skip ci] 2016-12-05 22:28:28 -05:00
Kai Cataldo
4072dfddab Add watch script for dev (#234) 2016-12-05 16:54:18 -05:00
Sven SAULEAU
cf37677c90 Update README.md (#4937) [skip ci] 2016-12-05 13:39:14 -05:00
Sven SAULEAU
351c1d3b4f Update README [skip ci] (#4938) 2016-12-05 13:36:31 -05:00
Scott Kyle
c438209718 Fix constant elements hoisted before declarator (#4804)
When multiple declarators are present in a declaration, we want to insert the constant element inside the declaration rather than placing it before because it may rely on a declarator inside that same declaration.
2016-12-03 20:19:32 -08:00
Scott Kyle
5a9509205b Fix constant elements hoisted out of block (#4419)
When block scoped variables caused the block to be wrapped in a closure, the variable `bindings` remained in parent function scope, which caused the JSX element to be hoisted out of the closure.
2016-12-03 19:54:53 -08:00
Brian Ng
b81cf12c7b Add example to transform-react-display-name docs (#4939)
* Add example to transform-react-display-name docs [skip ci]

* Normalize in/out markup in transform-react docs [skip ci]
2016-12-03 20:09:07 -05:00
wtgtybhertgeghgtwtg
930512e91f Add test to babel-plugin-syntax-trailing-function-commas .npmignore. (#4936) 2016-12-03 08:15:18 -05:00
Tommaso
27e201e0e1 Update plugins READMEs from babel.github.io [skip ci] (#4931) 2016-12-02 17:07:16 -06:00
Henry Zhu
d06270498b add some tests 2016-12-02 17:58:31 -05:00
Henry Zhu
3a7a1b9221 add more features 2016-12-02 16:47:38 -05:00
Brian Ng
36c6fcaf23 Add math builtins 2016-12-02 16:04:07 -05:00
Henry Zhu
7afe25bda1 change format 2016-12-02 16:04:02 -05:00
Henry Zhu
c09532f035 plugin transforms the imports/requires 2016-12-02 15:33:27 -05:00
Henry Zhu
6c58d93602 setup the babel plugin to transform the babel-polyfill calls + pass the data option to the plugin from the preset 2016-12-02 13:04:21 -05:00
Henry Zhu
60efc0dd10 add useBuiltIns option 2016-12-02 11:43:36 -05:00
Christophe Hurpeau
81575bcdfe Fix for object-rest with parameters destructuring nested rest (#4883) 2016-12-01 23:58:07 -05:00
Joe Haddad
06820ca17d Add forceColor option to babel-code-frame (#4913) 2016-12-01 23:43:08 -05:00
Kanitkorn Sujautra
b43191d402 Update transform-object-rest-spread's README from babel.github.io [skip ci] (#4930) 2016-12-01 23:42:27 -05:00
Kanitkorn Sujautra
fcc5b8963b Update transform-object-assign's README from babel.github.io [skip ci] (#4929) 2016-12-01 23:39:45 -05:00
Michael Kühnel
75720a3243 monorepo doc: Add another con (#4927) [skip ci] 2016-12-01 17:28:04 -05:00
Henry Zhu
0f583c0d1f mention [skip ci] in PR template (#4928) 2016-12-01 17:08:13 -05:00
Brian Ng
f71efbce92 Update transform-es2015 READMEs from babel.github.io [skip ci] (#4926)
Signed-off-by: Brian Ng <bng412@gmail.com>
2016-12-01 16:11:36 -05:00
Kai Cataldo
5fb4353778 Throw error when exporting non-declaration (#241)
* Throw error when exporting non-declaration

fixes #238

* Do check ahead of parsing export statement
2016-12-01 21:03:13 +01:00
Brian Ng
723c90e8f0 Tweak example in transform-jsx-source README [skip ci] (#4925) 2016-12-01 11:28:04 -05:00
Brian Ng
c2b3ea793f Update async READMEs from babel.github.io [skip ci] (#4919) 2016-11-30 12:24:59 -05:00
Brian Ng
66dfd8f0c1 Fix some React transform README issues [skip ci] (#4917) 2016-11-30 12:19:54 -05:00
Henry Zhu
e21dcec087 update readmes [skip ci] 2016-11-29 21:23:53 -05:00
Daniel Tschinder
f0cdf136bd Remove shouldIgnore check (#4907)
Otherwise tasks will never be marked as disabled
2016-11-29 20:36:50 -05:00
Henry Zhu
e86f62b304 README: add --save-dev [skip ci]
Closes gh-4910
2016-11-29 08:40:27 -05:00
Sven SAULEAU
2311b5b53a README: remove dollar in sh snippets [skip ci] 2016-11-29 08:39:23 -05:00
Henry Zhu
f3e4b9a7b7 add example [skip ci] 2016-11-29 08:32:46 -05:00
Kanitkorn Sujautra
287ee0fda8 Docs/babel plugin check es2015 constants (#4908) [skip ci] 2016-11-29 08:18:30 -05:00
Brian Ng
4a14202e92 Update React transform READMEs from babel.github.io [skip ci] (#4903)
* Update React transform READMEs from babel.github.io [skip ci]

* Drop inline-elements polyfill message (move to website)
2016-11-28 20:50:17 -05:00
Sven SAULEAU
51e8fd1868 Update babel-types README (#4905) [skip ci] 2016-11-28 20:22:59 -05:00
greenkeeper[bot]
5630380026 Update dependencies to enable Greenkeeper 🌴 (#233)
* chore(package): update dependencies

https://greenkeeper.io/

* cross-env 3 is not compatible to node 0.10

* ignore cross-env
2016-11-28 23:22:42 +01:00
Benjamin E. Coe
db67d7fdce Switch to nyc, babel-plugin-istanbul & codecov-node for code coverage (#4885)
* Switch to nyc, babel-plugin-istanbul & codecov-node for code coverage

This setup (very much like Babylon's) let us trace code coverage back to the `src/` directories of packages.

* Exclude package tests from coverage report

* fix: upgrade to version of nyc that tweaks a couple more things for babel

* fix: remove comment based on @hzoo's review
2016-11-28 14:17:52 -05:00
Sven SAULEAU
f98d824ae7 Fix babel-types README (#4899) [skip ci] 2016-11-28 11:09:41 -05:00
Daniel Tschinder
1d9e509df2 Fix eslint (#4897)
* Fix eslint call

* Fix linting errors
2016-11-26 11:24:38 -05:00
Henry Zhu
53de56d069 simple intro [skip ci] (#4890) 2016-11-24 16:47:48 -05:00
Henry Zhu
457131f219 v0.0.9 changelog [skip ci] 2016-11-24 15:58:09 -05:00
Henry Zhu
bcc2ddbf4e 0.0.9 2016-11-24 15:55:12 -05:00
Henry Zhu
b03180a26c add opera at the end 2016-11-24 15:54:54 -05:00
Sergey Rubanov
56817f8e7c Update data generation for latest compat-table (#50)
* Update data generation for latest compat-table. See https://github.com/kangax/compat-table/pull/964

* fix compat-table version
2016-11-23 23:20:52 -05:00
Henry Zhu
54ce049760 fix headings [skip ci] 2016-11-23 08:09:47 -05:00
Henry Zhu
5739755a48 Add opera (#48) 2016-11-23 07:57:24 -05:00
Henry Zhu
7f93092bdc update description [skip ci] 2016-11-23 07:52:47 -05:00
Henry Zhu
9d0518b715 Readme updates from babel.github.io [skip ci] (#4884) 2016-11-22 14:17:17 -05:00
Boopathi Rajaa
7e020272c1 Fix path.evaluate for references before declarations (#4875) 2016-11-20 22:44:56 -05:00
Brian Ng
3a27f49c57 Fix identation with empty leading ObjectTypeProperty (#4862) 2016-11-19 10:47:41 -05:00
Henry Zhu
19bb830c50 use *, add test for assign-expression in parameter (#4865) 2016-11-19 10:45:00 -05:00
Henry Zhu
9b6bb3cb9b 6.14.1 2016-11-17 19:09:24 -05:00
Henry Zhu
225adb100b v6.14.1 changelog [skip ci] 2016-11-17 19:08:57 -05:00
Henry Zhu
89a606ce11 document * [skip ci] 2016-11-17 19:06:16 -05:00
Daniel Tschinder
6d3b63454c Allow plugins:["*"] (#229) 2016-11-17 19:04:58 -05:00
Henry Zhu
cd041541b8 Fix bug + Generate test fixtures if no expected.js (#4858) 2016-11-17 17:53:46 -05:00
Nikolai Tillmann
efefe828f9 Preserve null in babel-types' clone and deepClone. (#4853)
* Preserve null in babel-types' clone and deepClone.
* Also respect undefined when cloning.
* Updating last test to reflect original test case "[,0]"
2016-11-17 08:52:04 -05:00
Vesa Laakso
cf8591543d 💅 Fix CHANGELOG.md nail polish emoji (#47) [skip-ci] 2016-11-17 07:56:57 -05:00
Henry Zhu
e6901792a1 pr template [skip ci] 2016-11-17 00:29:45 -05:00
Henry Zhu
b86f618a5a npm downloads [skip ci] 2016-11-16 15:41:58 -05:00
Henry Zhu
38340777d6 0.0.8 changelog [skip ci] 2016-11-16 12:30:44 -05:00
Henry Zhu
713ef4427d 0.0.8 2016-11-16 12:28:14 -05:00
Henry Zhu
1115bec3c3 Only console.log the debug info once (#46) 2016-11-16 12:27:39 -05:00
Henry Zhu
d42c6ea3d2 update rest-spread [skip-ci] 2016-11-16 11:30:05 -05:00
Henry Zhu
754a6ed8c0 v6.19.0 2016-11-16 11:15:30 -05:00
Daniel Tschinder
03352cb480 Fix date in Changelog 2016-11-16 16:52:59 +01:00
Daniel Tschinder
38dcafc8ac 6.14.0 2016-11-16 16:32:32 +01:00
Daniel Tschinder
186a58ac31 6.14.0 (#221) [skip ci]
* 6.14.0

* fixes [skip ci]

* fixes [skip ci]
2016-11-16 16:29:11 +01:00
Henry Zhu
ca33c8fa05 v6.19.0 changelog [skip ci] (#4846) 2016-11-16 10:27:28 -05:00
Henry Zhu
54dc01440b add jsonCompatibleStrings option [skip ci] 2016-11-15 16:53:33 -05:00
Henry Zhu
4462d59acd refactor: switch ancestory/descendant logic [skip ci]
- Ref https://github.com/babel/babel/pull/4836#discussion_r88118790 @jridgewell
2016-11-15 16:41:08 -05:00
Boopathi Rajaa
55a47a8819 Add path utilities isAncestor and isDescendant (#4836)
* Add path utilities isAncestor and isDescendant

* Create ancestry.js
2016-11-15 16:36:45 -05:00
Moti Zilberman
f8ddd80f96 Greater spec compliance for class properties (#4544)
* Desugar class properties to Object.defineProperty per spec
* Define uninitialized static class properties with value=undefined
* Make class-properties increased spec compliance opt-in (spec: true)
2016-11-15 16:35:51 -05:00
Juriy Zaytsev
cf3a38fb40 Add jsonCompatibleStrings option to generator (#4827) 2016-11-15 15:03:41 -05:00
Henry Zhu
8475b6ec02 fix lint 2016-11-15 14:51:26 -05:00
Sam Pepose
db85bdc3fc Added flowCommaSeparator option for object types (#3547) 2016-11-15 14:43:42 -05:00
Henry Zhu
6a6ec8785b Start babel-types tests, add isNodesEquivalent (#3553) 2016-11-15 14:24:20 -05:00
Daniel Tschinder
2caee29703 Run npm test with sourceMaps (#222) 2016-11-15 13:32:02 -05:00
Henry Zhu
c36f523737 updated PULL_REQUEST_TEMPLATE [skip ci] (#4844) 2016-11-15 12:08:19 -05:00
Henry Zhu
46b216cfa7 Add toc, team section [skip ci] (#4802) 2016-11-15 12:04:47 -05:00
Richy HBM
c162cfc2f8 Update PR template to close an issue via the PR (#4842) [skip ci] 2016-11-15 11:33:29 -05:00
Henry Zhu
5e0508d57c object rest - fix when destructuring in variables/parameters (#4755)
* object rest - fix when destructuring in variables/parameters

* fixes + ExportNamedDeclaration support

* Account for CatchClause

* support ForXStatement

* support assignment expression? + PR fixes
2016-11-15 11:31:03 -05:00
Shine Wang
5075f3cb6f Bug fix for printing minified literals (#4830)
* Fixed minified literal generator: now prints the shorter of `raw` and `value`.
2016-11-15 10:50:57 -05:00
Boopathi Rajaa
dbc1371ba9 Add clearCache and clearPath as separate APIs under traverse (#4835) 2016-11-15 10:48:59 -05:00
Ryan Clark
b4c56ce9f9 Fix typo (#226) [skip ci] 2016-11-14 20:37:32 -05:00
Henry Zhu
d0c884b9d4 Merge pull request #4789 from guybedford/system-dynamic-import
Support import() as contextual import in system module format
2016-11-14 18:00:06 -05:00
Sergey Rubanov
9ca27436a9 Update data generation for latest compat-table. See https://github.com/kangax/compat-table/pull/960 (#44) 2016-11-14 17:42:44 -05:00
Henry Zhu
ac26f3cdfb Rename ios_saf in browserslist data to ios, ignore unknown browsers (#43)
* Rename ios_saf in browserslist data to ios, ignore unknown browsers

browserslist queries, especially ones with percentages, often bring in mobile browsers that _probably_ have the similar support level as desktop ones, but since there's no support for them in the data, including them here would just lead to all plugins being enabled always.

It's also easy to get crazy things like `op_mini` or `and_uc` in the results.

Browserslist also reports iOS Safari as `ios_saf`, while the data uses `ios`, so it needs to be renamed.

* Fix lint
2016-11-14 15:19:47 -05:00
Henry Zhu
62ae3c7ee8 Fix system transformer to ensure consistent modules iteration (#4832)
* include test for number specifiers

* use ordered modules array over object properties
2016-11-14 13:17:54 -05:00
Daniel Tschinder
58887ed14e Run tests of flow with babylon (#225)
* Run tests of flow with babylon

* Fix travis

* Fix typo

* Again...

* Brtter hint

* proper exit code

* Fix some flase-positives and better reporting

* Enable some plugins, that flow supports by default
2016-11-14 18:16:36 +01:00
Henry Zhu
48873f886a Correctly eat a semicolon at the end of DelcareModuleExports (#223) 2016-11-14 10:25:19 -05:00
lion
862b387ad7 👕 Fix crlf to lf (#4837) 2016-11-13 21:42:08 +01:00
lion
7b8ba2d9ef FIx typo in CHANGELOG.md [skip ci] (#4838) 2016-11-13 21:41:32 +01:00
Daniel Tschinder
ad88d461d3 Correctly eat a semicolon at the end of DelcareModuleExports 2016-11-13 14:29:46 +01:00
Daniel Tschinder
c30a556615 Replace emojis with github tags 2016-11-13 10:35:04 +01:00
Bernhard Häussner
01ed943deb Parse flow nested array type annotations like number[][] (#219)
* Parse flow nested array type annotations like number[][]

Fixes #217.

* Do not parse a newline separated array statement into a flow type annotation

* Get rid of lineBreak dependency in flow.js in favor of higher level method
2016-11-13 10:22:16 +01:00
guybedford
76702a3a57 use ordered modules array over object properties 2016-11-11 17:48:14 +02:00
guybedford
bd251f236b include test for number specifiers 2016-11-11 17:48:13 +02:00
guybedford
d8c83bba52 make syntax-dynamic-import optional 2016-11-11 10:15:31 +02:00
guybedford
d62403753c babel-plugin-syntax-dynamic-import as a dependency of babel-plugin-transform-es2015-modules-systemjs 2016-11-11 09:57:44 +02:00
guybedford
11a2f07692 support import() as contextual import in system module format 2016-11-11 09:57:44 +02:00
Diogo Franco
d407ddc00c Fix lint 2016-11-11 01:43:21 +09:00
Diogo Franco
cbd827b9db Rename ios_saf in browserslist data to ios, ignore unknown browsers
browserslist queries, especially ones with percentages, often bring in mobile browsers that _probably_ have the similar support level as desktop ones, but since there's no support for them in the data, including them here would just lead to all plugins being enabled always.

It's also easy to get crazy things like `op_mini` or `and_uc` in the results.

Browserslist also reports iOS Safari as `ios_saf`, while the data uses `ios`, so it needs to be renamed.
2016-11-11 01:32:17 +09:00
Moti Zilberman
6cb023590a Count Babel tests towards Babylon code coverage (#182)
* Add code coverage from Babel tests

* Configure nyc correctly for Babel test coverage

* Guard against nyc config conflicts if Babel switches to nyc in the future

* Move .nyc_output from Babel build dir to root
2016-11-09 17:24:57 +01:00
Kai Cataldo
e260381e06 Throw error for reserved words enum and await (#195)
* Throw error for reserved words enum and await when source type is module

* Extract reserved word check into method

* Fix tests
2016-11-09 16:29:02 +01:00
Gabe Levi
643124744f Optional names for function types and object type indexers (#197)
* Use .gitattributes to ignore files with weird newlines

* [Flow] Make parameter names in function types optional

* [Flow] Anonymous function types with single params can omit parens

* [Flow] Optional names for object indexer keys

* Add noAnonFunctionType explicitly to state

* Adjust gitattributes as files have been fixed
2016-11-09 16:22:53 +01:00
Thomas Grainger
e05bbeefd1 Fix strange line endings (#214) 2016-11-09 16:19:00 +01:00
Samuel Reed
5678e61c0f fix binding kind of destructured variables. (#4813)
Fixes #4516 and any other code that hoists into a scope
where function params are destructured.
2016-11-08 13:51:54 -05:00
Scott Stern
723ca0eef8 Chore: FLOW command in makefile and logic in .travis.yml(issue#4710). (#4807) 2016-11-04 08:26:45 -04:00
Henry Zhu
f8a02a8a9f 0.0.7 2016-11-02 19:00:46 -04:00
Henry Zhu
4019d20945 fixes [skip ci] 2016-11-02 18:21:14 -04:00
Henry Zhu
d8b3447766 add changelog [skip ci] 2016-11-02 18:18:55 -04:00
Henry Zhu
bbeb311aa0 intro example [skip ci] 2016-11-02 18:09:15 -04:00
Henry Zhu
4b08a02b22 fix link [skip ci] 2016-11-02 18:07:53 -04:00
Henry Zhu
fd0821563e toc [skip ci] 2016-11-02 18:04:40 -04:00
Henry Zhu
f6a8d5eff2 doc fixes [skip ci] 2016-11-02 17:44:31 -04:00
Henry Zhu
a5daad4d32 Use compat-table equals option (#36)
* Use compat-table equals option

* fixes
2016-11-02 17:09:32 -04:00
Henry Zhu
d40c684723 hardcode a current node version option (#35) 2016-11-02 16:17:42 -04:00
Henry Zhu
9e97b59a2f fixes [skip ci] 2016-11-02 12:02:23 -04:00
Henry Zhu
414acf5fda Change default behavior to act the same as babel-preset-latest (#33)
* Do not throw on empty options, and default to latest preset

* fix lint
2016-11-02 11:57:26 -04:00
Henry Zhu
aa61aabb82 run lint separately (#32) 2016-11-02 11:09:51 -04:00
Henry Zhu
69e93fdb89 add 'whitelist' option (#31)
Ref https://github.com/babel/babel-preset-env/issues/16
2016-11-02 10:55:45 -04:00
Henry Zhu
85b5141cee add more aliases 2016-11-02 10:16:30 -04:00
Henry Zhu
8356dd18a2 Simple changelog [skip ci] 2016-11-01 19:53:57 -04:00
Henry Zhu
a47341930a Update plugin data: firefox 52 supports async/await! (#29) 2016-11-01 17:57:45 -04:00
Henry Zhu
dcb9e9dd66 Add fixture helper for tests (#28) 2016-11-01 17:46:49 -04:00
Henry Zhu
b68e9bfba7 v6.18.1-v6.18.2 changelog [skip ci] 2016-11-01 17:39:05 -04:00
Henry Zhu
7b64a9d914 v6.18.2 2016-11-01 17:30:53 -04:00
Henry Zhu
1a974e58d0 v6.18.1 2016-11-01 17:17:16 -04:00
Henry Zhu
9681b530e9 Allow relative paths in babelrc options in options.json (#4797) 2016-11-01 16:58:28 -04:00
Daniel Tschinder
4141683935 Add node 7 2016-11-01 21:00:50 +01:00
Greenkeeper
96404aa4fe chore(package): update flow-bin to version 0.34.0 (#204)
https://greenkeeper.io/
2016-11-01 16:51:56 +01:00
Daniel Tschinder
ca0de3b7d4 Correct repo [skip ci] 2016-11-01 16:51:12 +01:00
Daniel Tschinder
87707c18ca Create github Templates (#209) [skip ci]
* Create PULL_REQUEST_TEMPLATE.md

* Create ISSUE_TEMPLATE.md
2016-11-01 11:49:30 -04:00
Henry Zhu
a21100f6b3 show less packages [skip ci] (#4801) 2016-11-01 09:04:19 -04:00
Henry Zhu
b6647dd9f5 Update eslint, use codeframe formatter (#4796) 2016-10-30 18:53:53 -04:00
Greenkeeper
2b6ff53459 chore(package): update flow-bin to version 0.34.0 (#4792)
https://greenkeeper.io/
2016-10-29 10:15:25 +02:00
Justin Ridgewell
15eeeb6559 Fix line endings (#4793) 2016-10-28 23:44:00 -04:00
Peter Mikula
fad6483aac fixes invalid line offsets in merged sourcemaps 2016-10-28 21:36:40 +03:00
Henry Zhu
e1ac315653 fix readme [skip ci] 2016-10-26 17:34:00 -04:00
Henry Zhu
572bc9c199 v6.13.1 changelog [skip ci] 2016-10-26 12:11:54 -04:00
Henry Zhu
b5de37fcd7 6.13.1 2016-10-26 12:08:01 -04:00
Henry Zhu
2ba3dcf4ff add clean command [skip ci] (#201) 2016-10-26 10:56:27 -04:00
Andrew Levine
beb8db6264 Use rollup for bundling to speed up startup time (#190) 2016-10-26 10:44:21 -04:00
Henry Zhu
d1b0886d46 add ForAwaitStatement (async generator already added) [skip ci] (#196) 2016-10-25 16:25:25 +02:00
Greenkeeper
ec49648038 chore(package): update chai to version 3.5.0 (#4776)
https://greenkeeper.io/
2016-10-25 12:24:25 +02:00
Diogo Franco
35b795ce54 Fix Valid example to be actually valid (#4773)
* Fix Valid example to be actually valid

* Rename 'pluginName' to 'presetName' in the example
2016-10-25 11:27:20 +02:00
Henry Zhu
cfc5d3feae docs [skip ci] 2016-10-24 18:58:30 -04:00
Henry Zhu
46e15d9557 v6.18.0 for babel-runtime [skip ci] 2016-10-24 18:46:56 -04:00
Henry Zhu
a6ea9111a5 v6.18.0 changelog fixes [skip ci] 2016-10-24 17:36:07 -04:00
Henry Zhu
12f9cd0826 v6.18.0 2016-10-24 17:18:36 -04:00
Henry Zhu
aae09a27d6 update readme [skip ci] 2016-10-24 16:04:45 -04:00
Henry Zhu
094096c9b3 v6.18.0 changelog (#4726) [skip ci]
* changelog: emoji for docs [skip ci]

* v6.18.0 changelog [skip ci]
2016-10-24 15:44:46 -04:00
Andrew Levine
555ee0cb51 Don't treat JSXIdentifier in JSXMemberExpression as HTML tag. Closes #4027 (#4765) 2016-10-24 10:42:50 -04:00
Andrew Levine
de46827be7 Handle remapping of JSXIdentifier to MemberExpression in CommonJS transform. Closes #3728 (#4763) 2016-10-24 10:23:43 -04:00
Andrew Levine
7cfe5c13e3 Add TEST_DEBUG env var option for test.sh, to enable node 6 debugger (#4764) 2016-10-23 23:58:25 -04:00
Greenkeeper
905efd1f26 chore(package): update browserify to version 13.1.1 (#4762)
https://greenkeeper.io/
2016-10-24 00:54:41 +02:00
Moti Zilberman
fd4667e649 Increase test coverage (#4742)
* Add tests for path type inferers

* Add test for babel-types.valueToNode

* Add tests for babel-types.toKeyAlias

* Add tests for babel-types.toStatement

* Add tests for babel-types.toExpression

* Lint fixes in babel-traverse/test/inference
2016-10-23 10:51:09 +02:00
Juriy Zaytsev
beda884f41 Make getBinding ignore labels; add Scope#getLabel, Scope#registerLabel (#4758)
* Make getBinding ignore labels; add Scope#getLabel, Scope#registerLabel

* generateUid: account for labels again
2016-10-21 17:19:59 -04:00
Sam Goldman
7bb430aeea Add variance node type and generate property variance annotations (#4697)
* Add variance node type and generate property variance annotations

babel/babylon#161 adds parsing support for property variance
annotations. This PR adds the necessary node type for the new Variance
node and generate support for all the positions where variance can now
appear.

* Variance is no longer a separate node type

This diff also adds tests to class properties and to the
flow-strip-types transform.

* Add test + fix for edge case with variance and class proeprties
2016-10-21 16:05:36 -04:00
Daniel Tschinder
930cdd01a7 6.13.0 2016-10-21 16:39:40 +02:00
Daniel Tschinder
b77a57faf8 Changelog 6.13.0 (#193) [skip ci]
* Update CHANGELOG.md

* Add link to flow docs [skip ci]

* type [skip ci]
2016-10-21 16:39:02 +02:00
Henry Zhu
8af614022c readme on ie [skip ci] 2016-10-20 20:09:56 -04:00
Kai Cataldo
7443f9e1c2 Add make command to delete node_modules (#4748) 2016-10-19 07:58:35 -04:00
Henry Zhu
4b3aaae9c0 fixes [skip ci]
Ref https://github.com/babel/babel/issues/4590#issuecomment-254359917
2016-10-17 19:53:29 -04:00
Moti Zilberman
6bc10b5573 Support ObjectExpression in static path evaluation (#4746) 2016-10-17 18:55:02 -04:00
Daniel Tschinder
d9dd32860a Fix replacing for-of if inside label (#4736)
This replaces the label instead of the for-of itself as we already
integrate the label in the replacement nodes.
Fixes #3858
2016-10-17 17:27:13 -04:00
Moti Zilberman
e047a1b89a Flow: Allow class properties to be named static (#184)
Related: #158
2016-10-17 15:55:50 -04:00
Moti Zilberman
d14c8bd894 Fix .gitattributes line ending setting (#191)
h/t @nhajidin in babel/babel#4744
2016-10-17 15:53:54 -04:00
Simen Bekkhus
9c2794dc85 Replace path-exists with fs.existsSync (#4731)
It's not deprecated anymore, see nodejs/node#8364
2016-10-17 14:31:49 -04:00
Moti Zilberman
05bdd4822a Merge pull request #4744 from nhajidin/fix-checkout
Fix line endings on checkout
2016-10-17 18:56:47 +03:00
Brian Ng
dfe896dd54 Avoid unnecessary +0 in transform-es2015-parameters (#4738) 2016-10-17 17:09:55 +02:00
Jordan Gensler
391e5bd813 [import()] Initial support for dynamic-import (#4699)
* [import()] Initial support for function-like import

* [import()] Renaming import-functions to dynamic-import

* [stage-2] Fixing lint error

* add to package.json
2016-10-17 11:02:00 -04:00
Nazim Hajidin
71e0e00bfe Fix line endings on checkout 2016-10-17 10:51:49 -04:00
Daniel Tschinder
0d72a89df6 Fix flowtype and add inType to state (#189)
this improves the performance slightly
2016-10-17 10:45:46 -04:00
Moti Zilberman
b8eeddf960 Automatically generate missing expected.js fixtures (#4735)
This is much like Babylon's existing behavior around `expected.json`. The equivalent of babel/babylon#188 is already applied here, to guard against silent failure (and a potential false positive) if a test is accidentally committed without its expected.js.
2016-10-17 16:39:32 +02:00
Andrew Levine
01e984fd0f Allow "async" as identifier for object literal property shorthand (#187) 2016-10-17 10:33:18 -04:00
Brian Ng
478bba0ade Fix few typos in issue/pr templates (#4739) [skip ci] 2016-10-17 00:20:24 -04:00
Richard Macklin
6ec93d782b Extract resolveFromPossibleNames to remove duplicated logic
"DRY"s the duplicated algorithm in resolvePlugin and resolvePreset
2016-10-16 11:18:43 -07:00
Richard Macklin
4ea1007645 Remove unneeded tests
Previously these were testing the logic that is now encapsulated in
getPossiblePresetNames and tested in a unit test
2016-10-16 11:07:16 -07:00
Richard Macklin
e24f07dfda Extract resolvePreset method to babel-core public API
This encapsulates the logic for turning an acceptable preset name into
the absolute path for that preset. It can be used to preprocess a
presets list to map each preset to its absolute path, which is necessary
if `babel.transform` is going to be executed on a file outside the
directory subtree where the presets are installed.

This adds a getPossiblePresetNames helper encapsulating the logic for
what preset names we should try to resolve, and the resolvePreset method
just calls this helper and actually resolves them.
2016-10-16 11:06:47 -07:00
Richard Macklin
f4389a1886 Extract resolvePlugin method to babel-core public API
This encapsulates the logic for turning an acceptable plugin name into
the absolute path for that plugin. It can be used to preprocess a
plugins list to map each plugin to its absolute path, which is necessary
if `babel.transform` is going to be executed on a file outside the
directory subtree where the plugins are installed.

This adds a getPossiblePluginNames helper encapsulating the logic for
what plugin names we should try to resolve, and the resolvePlugin method
just calls this helper and actually resolves them.
2016-10-16 10:52:13 -07:00
Moti Zilberman
9b6e243736 Raise error on duplicate definition of __proto__ (#183)
Spec: http://www.ecma-international.org/ecma-262/6.0/#sec-__proto__-property-names-in-object-initializers

This brings back to life a bit of dead code in Parser.prototype.checkPropClash, and enables several tests that were previously disabled.
2016-10-16 15:16:38 +02:00
Moti Zilberman
7c18bf83cc Increase test coverage (#175)
* Increase test coverage

* Test for error when binding `this` in destructuring pattern

* Ignore coverage of inAsync check in parseAwait - already checked externally

* Ignore coverage of default case in checkPropClash

* Remove unused parameter isAsync from parseParenAndDistinguishExpression

* Ignore coverage of an `else` branch in flowParseTypeParameterDeclaration

* Flow: remove unused parameters to flowParseTypeAnnotatableIdentifier

* Flow: ignore coverage of pass-through throw statement in parseConditional

* Flow: Add test for error on property with type param

* Flow: ignore coverage of pass-through throw statements in parseMaybeAssign, parseArrow

* Add test for error on XML-style comment in module code

* Update test for error on method in object pattern

* Test for error: "Only '=' operator can be used for specifying default value"
2016-10-16 15:04:13 +02:00
Moti Zilberman
490ae9a44c Error on missing expected.json fixture in CI (#188) 2016-10-16 07:55:41 -04:00
Henry Zhu
2dc919d4c6 contributing updates [skip ci] 2016-10-15 19:27:24 -04:00
Henry Zhu
9299921d07 increase git depth [skip ci] 2016-10-15 18:52:14 -04:00
Andrew Levine
9f8ab29213 Change usage of "suite"/"test" in unit-tests to "describe"/"it" (#4734)
Fixes #4733
2016-10-15 18:45:35 -04:00
Andrew Levine
c0038221d7 Run ESLint on test files, and fix lint errors in test files (#4732) 2016-10-15 18:27:48 -04:00
Moti Zilberman
fd218abffb Add .gitattributes forcing LF line endings (#4730) 2016-10-15 10:29:12 -04:00
Henry Zhu
520d69b125 contributing a new plugin [skip ci] 2016-10-15 10:12:23 -04:00
Moti Zilberman
394c9543c9 Add .gitattributes and .editorconfig for LF line endings (#179)
* Add .gitattributes forcing LF line endings

* Add .editorconfig from Babel
2016-10-15 11:08:12 +02:00
Daniel Tschinder
0bbe1e1eec Readd missin .eslinignore for IDEs 2016-10-15 10:33:05 +02:00
Sam Goldman
26809e8ce7 Property variance type annotations for Flow plugin (#161)
* Property variance type annotations for Flow plugin

Non-method properties and indexers of object types, declare class, and
interfaces can be "positive" or "negative." Class fields, but again not
methods, can also have variance.

This PR generalizes the variance annotations for type parameters into a
new node type, and reuses that node for those properties.

The code for object types is reused for interfaces and declare classes.
The changes there are straightfoward.

The code for class fields is reused for object literals, which do not
support variance annotations (currently). This code is a bit sketchy,
because we always parse variance annotations in the `parsePropertyName`
extension, then error in a the subsequent parse phase for object
literals (`parseObjPropValue`) or class methods (`parseClassMethod`).

* Remove bogus unreachable code, clarify variance parsing conditional

* Don't use a new node type for variance annotations

Adding a new node type, specifically changing the TypeParameter node's
variance property to be node-valued, is a breaking change. We might
choose to make this breaking change in a later version.

* s/start/variancePos
2016-10-14 23:13:27 +02:00
Moti Zilberman
b5877f04b1 Fix up #172 (#177)
* Update two esprima tests to the new "expected TOKEN" messages

* Update dynamic-import to use "expected (" error message
2016-10-14 16:50:07 -04:00
Moti Zilberman
76de1cc8a4 Update tests for changed error messages in Babylon (#4727)
Depends on babel/babylon#172.
2016-10-14 16:25:56 -04:00
Henry Zhu
3525c00397 v6.12.0 changelog [skip ci] (#176) 2016-10-14 16:17:17 -04:00
Henry Zhu
a88a8e9c15 6.12.0 2016-10-14 16:14:54 -04:00
Henry Zhu
6b4a19d520 test fixes 2016-10-14 16:14:38 -04:00
Henry Zhu
9ecf763218 lint [skip ci] 2016-10-14 16:12:05 -04:00
Moti Zilberman
d3af158ba5 Annotate more errors with expected token (#172)
Expanding on #150, this allows `unexpected()` to accept the expected token type instead of a message string.
This overload is then used in a couple more places (that independently implement a logic similar to `expect()`'s) to construct an `Unexpected token, expected FOO` message.
2016-10-14 16:10:09 -04:00
Moti Zilberman
2827d660fc Make special case for class property initializers in shadow-functions (#4502) 2016-10-14 15:21:11 -04:00
Brian Ng
fde16f10fa Add useBuiltIns option to helper-builder-react-jsx (#4655) 2016-10-14 21:18:39 +02:00
Sam Goldman
15183078e6 Add EmptyTypeAnnotation (#4724)
Added to Flow in facebook/flow#c603505583993aa953904005f91c350f4b65d6bd
Parser support added in babel/babylon#171.
2016-10-14 15:16:02 -04:00
Dan Harper
99fbcefa65 allow keyword in Flow object declaration property names with type parameters (#146) 2016-10-14 21:15:00 +02:00
Dan Harper
f7c1af1c1f allow keyword in object/class property names with Flow type parameters (#145) 2016-10-14 21:13:00 +02:00
Jordan Gensler
c63c1bc728 [dynamic-import] Implementing import() syntax (#163) 2016-10-14 14:54:21 -04:00
Kai Cataldo
50baac3251 Remove babel-doctor from babel-cli (#4725)
* Remove babel-doctor from babel-cli

fixes #4678

* Throw when babel-doctor is used
2016-10-14 14:49:16 -04:00
Jamesernator
dc4140dc5f Fixed incorrect compilation of async iterator methods (#4719) 2016-10-14 14:38:57 -04:00
Daniel Tschinder
4c445fd5f8 Remove kcheck (#173) 2016-10-14 12:12:55 -04:00
Daniel Tschinder
b31834ad29 Allow typeAnnotations for yield epressions (#174) 2016-10-14 12:07:46 -04:00
Moti Zilberman
9fc51d6292 Consolidate contiguous var declarations in destructuring transform (#4690)
* Consolidate contiguous var declarations in destructuring transform

Fixes #3081.

* Simplify var node coalescing in es2015-destructuring

* Revert "Simplify var node coalescing in es2015-destructuring"

This reverts commit 15cb373f0726f68225f7080a7ae206a63af174ee.

* More careful condition for var coalescing in es2015-destructuring
2016-10-14 11:51:22 -04:00
Sam Goldman
44f77bd724 Add EmptyTypeAnnotation (#171)
I also noticed that there was missing test coverage for builtin types,
so I added a test for that, which includes the newly added type as well
as the other existing types.
2016-10-13 19:22:13 -04:00
Henry Zhu
71790aace0 update eslint-config, fixes, add commands (#4721)
* update eslint-config, fixes, add commands

* switch plugin
2016-10-13 21:37:07 +02:00
Henry Zhu
5ab09c9617 0.0.6 2016-10-12 22:21:26 -04:00
Henry Zhu
d84ea7f478 ignore scripts 2016-10-12 22:21:23 -04:00
Henry Zhu
3604ff24c3 0.0.5 2016-10-12 22:18:02 -04:00
Henry Zhu
63d4aecf89 android/ios 2016-10-12 22:14:13 -04:00
Henry Zhu
a082a73869 add ie 2016-10-12 22:09:53 -04:00
Henry Zhu
3df730b490 cleanup 2016-10-12 22:08:22 -04:00
Henry Zhu
208e0ed4a4 error when no targets option is passed 2016-10-12 22:07:14 -04:00
Henry Zhu
15f05c0e9e back to upstream, update data for new ff 2016-10-12 21:46:43 -04:00
Henry Zhu
da318cd209 fix browserslist docs [skip ci] 2016-10-12 21:41:27 -04:00
Artem Yavorsky
03f6cae25f Adds browsers property to use browserslist's queries (#19)
* Use browserslist to parse browsers from query.

* Update README.

* Use int values.

* Allow `isPluginRequired` use browserslist queries.

* Fix conflicts during different versions merging.

* Add tests for browserslist queries.

* Early return for getTargets.

* Update README: Describe `browsers` option.

* fix doc [skip ci]

* Move to dependencies [skip ci]

* Remove unused const.

* Use doublequotes for strings.
2016-10-12 21:37:50 -04:00
Henry Zhu
c300230a59 v6.11.6 changelog [skip ci] 2016-10-12 19:39:59 -04:00
Henry Zhu
c6e36eff86 6.11.6 2016-10-12 19:37:16 -04:00
Jeroen Engels
e14f93d1bb Fix crash when exporting with destructuring and sparse array (#170)
* Create reproducible crash when exporting with destructuring and sparse array

* Fix crash when exporting with destructuring and sparse array
2016-10-12 19:36:08 -04:00
Paul Sanchez
4a3893a49e Add Caveat section to Readme.md (#24) [skip ci]
* Add Caveat section to Readme.md

The Caveat section details some known issues and workaround when targeting specific environments and using specific plugins.

* fixes [skip ci]
2016-10-12 13:33:38 -04:00
Henry Zhu
b1fc65530d v6.11.4 changelog [skip ci] 2016-10-12 11:58:11 -04:00
Henry Zhu
066826f7fa skipped v6.11.4 [skip ci] 2016-10-12 11:56:14 -04:00
Henry Zhu
ebe7c8a90c 6.11.5 2016-10-12 11:53:46 -04:00
Henry Zhu
b05bd7839a fixes [skip ci] 2016-10-12 11:52:26 -04:00
Henry Zhu
02d6cc6ccb v6.11.4 changelog [skip ci] (#168) 2016-10-12 11:50:40 -04:00
Henry Zhu
6e17a646ff changelog emoji [skip ci] 2016-10-12 11:33:19 -04:00
Henry Zhu
09f135f9a1 fix spacing [skip ci] 2016-10-12 11:33:03 -04:00
Daniel Tschinder
d4d6d05d25 Slightly better error messages (#150)
* Slightly better errors

Instead of "Unexpected token" we now print
"Unexpected token, expected <type.label>"
2016-10-12 10:38:26 -04:00
Henry Zhu
668428097c add deprecated in readme for class-constructor-call [skip ci] 2016-10-12 10:17:19 -04:00
Henry Zhu
ccff8fa286 add deprecated in readme for class-constructor-call [skip ci] 2016-10-12 10:17:03 -04:00
Henry Zhu
9a979b5618 add deprecated description for class-constructor-call [skip ci] 2016-10-12 10:16:43 -04:00
Flavio Corpa
9b02a6d298 Add missing description to all package.json files (#4703) [skip ci] 2016-10-12 10:15:50 -04:00
Henry Zhu
9c7d8c4cad update phab links explanation [skip ci] 2016-10-12 08:45:52 -04:00
Daniel Tschinder
1dca51f8ab Enable babel for tests (#4564)
* Enable babel for tests

This enables babel for tests by using a mocha compiler
It uses the babel config from package.json
Transformed OptionsManager test to es2015 to see if it works
Removed the 5s timeout from cli tests, as the default timeout is already 10s, this should probably fix the timouts on travis that we had in babylon
Also run the cli tests on travis, they were disabled if istanbul active, but istanbul is always active on travis so we were never running this tests.

* ignore scripts directory

* only register for tests

* Set only flag correctly
2016-10-12 10:56:50 +02:00
Kai Cataldo
4fc0a3839e Fix: Allow identifier async for default param in arrow expression (#165)
fixes #118
2016-10-12 10:46:40 +02:00
Eric Rozell
c2387f0444 fix(shouldIgnore): filename normalization should be platform sensitive (#4631)
* fix(shouldIgnore): filename normalization should be platform sensitive

shouldIgnore normalizes the path of the filename prior to running any "only" regexes or functions. The normalization uses "slash", which has some undesirable special cases for non-ASCII characters and longer paths. Changing the normalization behavior to always replace path separators.

There is no real need to add additional tests, because the tests are not run in an environment where path.sep !== '/'.

* Minor style fix to use double quotes.

* Remove conditional for regex replace to keep consistent behavior.

* whitespace [skip ci]
2016-10-11 16:02:50 -04:00
Kai Cataldo
27ee74ea14 Better error messaging when preset options are given without a corresponding preset (#4685) 2016-10-11 16:56:53 +02:00
Henry Zhu
417a9c8dc3 mention process.versions.node [skip ci] 2016-10-11 09:10:11 -04:00
Kai Cataldo
7dd45f7465 Check for duplicate named exports in exported rest elements/properties (#164) 2016-10-10 10:10:16 -04:00
Henry Zhu
efbeb06c63 explain how it works [skip ci] 2016-10-08 11:20:03 -04:00
Daniel Tschinder
760bbd6014 🚀 Update home-or-tmp to version 2.0.0 (#4660) 2016-10-07 16:48:45 -04:00
Brian Ng
0aa3ac2bb5 Update babel parser options (#4688)
* Update babel parser options
2016-10-07 14:30:47 -04:00
Henry Zhu
d11eace18c 0.0.4 2016-10-06 23:55:53 -04:00
Henry Zhu
4903395cbf remove integer error for node, add debug option (#18) 2016-10-06 23:55:37 -04:00
Henry Zhu
d11c2af388 0.0.3 2016-10-06 23:09:57 -04:00
Henry Zhu
d221bfba91 Temp rm experimental (#17)
* Temporarily remove experimental plugins since not used

* readme
2016-10-06 23:05:34 -04:00
Henry Zhu
a665d4a5ae update node data, fix version issues (#13) 2016-10-06 22:33:03 -04:00
Henry Zhu
2697bfd820 clarify proposals [skip ci] 2016-10-06 19:38:43 -04:00
Henry Zhu
46a4d9c22d readme [skip ci] 2016-10-06 18:11:18 -04:00
Henry Zhu
fb60b88601 update readme [skip ci] 2016-10-06 18:10:46 -04:00
Henry Zhu
6b9404ab52 fixes, run build script in node 0.10 with babel-node (#12)
* fixes, run build script in node 0.10 with babel-node

* try node
2016-10-06 17:08:13 -04:00
Ville Immonen
77a6d686ba Build the browser data from ES compatibility table (#8)
Use the data from https://github.com/kangax/compat-table to build the
browser data.

Each Babel plugin is mapped to a list of features in the compatibility
table (in `data/pluginFeatures.js`), and the minimum supporting
version looked up from the compatibility test data. The script builds
the final browser data file in `data/plugins.json`.
2016-10-06 14:23:01 -04:00
Rubens Mariuzzo
655ae2cada Syntax highlighting added (where missing) (#11) [skip ci] 2016-10-06 10:35:12 -04:00
Dan Harper
33eb56ab09 fix error when constructor default arg refers to own static property or self (#4666)
(closes #4253)
(closes #4442)
2016-10-05 17:52:42 -04:00
Gyandeep Singh
6cfd3d91b2 Update: Eslint to 3.0 and update CI builds (fixes #4638) (#4680) 2016-10-05 17:44:25 -04:00
Moti Zilberman
0366d1ad19 Handle side effects correctly in rest params index expressions (#4348) (#4674) 2016-10-05 21:59:41 +02:00
Moti Zilberman
7a7704fea0 Fix block scoping transform for declarations in labeled statements (#4669)
* Fix block scoping transform for declarations in labeled statements (#4122)

* DRY block-scoping
2016-10-05 21:47:21 +02:00
Moti Zilberman
a62905c61d Remove travis short-circuit script (#4676) 2016-10-05 11:27:55 -04:00
Moti Zilberman
12d2673038 Add test for rest params name collision with top-level name (#4333) (#4673) 2016-10-05 10:15:04 -04:00
Daniel Tschinder
a15f992feb 🚀 Update fs-readdir-recursive to 1.0.0 (#4662)
* 🚀 Update fs-readdir-recursive to 1.0.0

* Revert chalk change
2016-10-05 09:57:02 -04:00
Daniel Tschinder
6d863baef8 🚀 Update chai to version 3.0.0 (#4664) 2016-10-05 09:56:26 -04:00
Sebastiaan Deckers
7977c9249e Babel API example (#4675) [skip ci]
Just a minor fix. I'm new to Babel's API and this tripped me up. Seems like it happened to others before (e.g. #2859). Guessing this came from an earlier `var babel = require('babel-core')` which does work.
2016-10-05 09:50:11 -04:00
Moti Zilberman
f5b5d8f337 Avoid repeating impure (template) literals when desugaring **= (#4403) (#4672) 2016-10-05 11:10:12 +02:00
Dan Harper
9e17aaf043 retain return types on ObjectMethods in transform-es2015-shorthand-properties (#4670) 2016-10-04 21:32:43 -04:00
Henry Zhu
9e6ac7b693 typo [skip ci] 2016-10-04 20:56:05 -04:00
Henry Zhu
338e6364a3 update pkgs [skip ci]
- remove babili pkgs
- remove deprecated (class constructor)
- add new
2016-10-04 20:53:54 -04:00
Dan Harper
7f772e94ce retain method return types on transform-es2015-classes (closes #4665) (#4668) 2016-10-04 18:22:29 -04:00
Daniel Tschinder
680f35f606 Update links to estree 2016-10-04 18:02:56 +02:00
Kai Cataldo
76e69277d7 Check for duplicate named exports in exported destructuring assignments (#144)
* Check for duplicate named exports in exported destructuring assignments

* Refactor duplicate error reporting

* Remove unnecessary check
2016-10-04 15:06:26 +02:00
Daniel Tschinder
fc54264f70 update json5 to version 0.5.0 (#4649) 2016-10-04 08:32:32 -04:00
Daniel Tschinder
2dcee25d37 Exclude super from being assign (#4642)
Assigning of super is not allowed `var ref = super;` This fix adds an exception into
the explode helper so that super stays untouched and does not get assigned.
2016-10-03 21:04:26 -04:00
Daniel Tschinder
ab3cff7cc3 Update detect-indent to version 4.0.0 (#4652) 2016-10-03 21:02:03 -04:00
Daniel Tschinder
3a69b8a252 Update globals to version 9.0.0 (#4651) 2016-10-03 21:01:06 -04:00
Daniel Tschinder
e0dbb1e770 Inline shebang-regex (#4650) 2016-10-03 20:58:26 -04:00
sugargreenbean
c57e0e88a5 changed bool to boolean as well as updated tests (#4646) 2016-10-03 19:31:56 -04:00
Gyandeep Singh
cc86799151 Docs: Fix babel-plugin-transform-async-generator-functions heading (#4656) [skip ci] 2016-10-03 18:16:40 -04:00
Brian Ng
9eb99dec9f Tweak license for GitHub display (#4653) 2016-10-03 16:17:16 -04:00
Henry Zhu
7ed15e298a mention issues [skip ci] 2016-10-03 15:03:36 -04:00
Daniel Tschinder
5de1feac1d Fix README 2016-10-03 00:46:49 +02:00
Henry Zhu
7c2302a02f 6.11.4 2016-10-01 20:08:48 -04:00
Henry Zhu
5bac6e8ad9 Temporary rollback for erroring on trailing comma with spread (#154) 2016-10-01 20:08:25 -04:00
Henry Zhu
1285131e3e v6.11.3 changelog [skip ci] (#153)
* v6.11.3 changelog [skip ci]
2016-10-01 17:33:31 -04:00
Henry Zhu
45c68c7311 6.11.3 2016-10-01 16:33:29 -04:00
Henry Zhu
4847403b84 add npm run changelog 2016-10-01 16:33:10 -04:00
Henry Zhu
e50b3c890f v6.17.0 2016-10-01 15:23:18 -04:00
Henry Zhu
fc3912217f v6.17.0 changelog [skip ci] (#4637) 2016-10-01 15:10:24 -04:00
Henry Zhu
6afbacbdf7 Add emoji to changelog label/headings [skip ci] 2016-10-01 14:24:41 -04:00
Daniel Tschinder
5a8070a397 Forward bound shadowed function when hoisting identifiers (#4635)
This change ensures that when hoisting an identifier we do not hoist it up to
the first no shadowed function, but rather up to the bound shadowed function
2016-10-01 13:24:12 -04:00
Bruno Jouhier
f9ccee9d83 fixed babel/babel#4632 - missing parentheses around yield expression … (#4633)
* fixed babel/babel#4632 - missing parentheses around yield expression in conditional test

* babel/babel#4632 - added test
2016-10-01 12:58:59 -04:00
Daniel Tschinder
16716ea3de Fix rest parameters with flow type casting (#4636)
Do not skip TypeCastExpressions when finding referenced identifiers as the
type cast contains valid non flow code that we need to visit.
2016-10-01 12:58:14 -04:00
Henry Zhu
fe2b9d73ed update .PHONY [skip ci] 2016-10-01 11:15:23 -04:00
Dan Harper
0e02a18216 fix regression in transform-flow-comments for class properties (#4623) 2016-10-01 00:56:09 -04:00
Daniel Tschinder
46339463bd Resolve presets with named exports correctly (#4620) 2016-09-30 18:27:40 -04:00
Henry Zhu
78b2763e78 transform-async-generator: use babel-runtime 6 (#4626) 2016-09-30 18:26:46 -04:00
Juriy Zaytsev
1d728750c9 Add retainFunctionParens option (#4621)
* Add retainParens option

* Add doc, remove option

* Add negation test

* Make sure parens are not added

* Change name

* Change dir name
2016-09-30 18:05:33 -04:00
Henry Zhu
1bf315d388 0.0.2 2016-09-30 17:41:26 -04:00
Henry Zhu
b4acfc31d9 Fix: export default 2016-09-30 17:41:22 -04:00
Henry Zhu
6f363b60bb Move async-generators to stage-3 (#4617) 2016-09-30 17:29:18 -04:00
Daniel Tschinder
7877829fcb Add static errors for object rest (#149)
* Fix parsing object rest

This makes object-rest-spread behave according to spec and only
allow one rest operator and enforces it to be the last
param in the object.

Also move all object-rest-spread tests to a own folder.

* Show nicer error messages
2016-09-30 11:37:55 -04:00
Greenkeeper
949febbcf0 chore(package): update flow-bin to version 0.33.0 (#4614)
https://greenkeeper.io/
2016-09-30 10:21:43 +02:00
Henry Zhu
159779d582 Merge pull request #4611 from babel/async-gen-stg-2
Async gen stg 2
2016-09-29 15:41:47 -04:00
Henry Zhu
efa0affea1 move object-rest-spread to stage-3 2016-09-29 15:26:47 -04:00
Henry Zhu
0ab904e2d9 Add transform-async-generator-functions to stage-2 2016-09-29 15:24:58 -04:00
Henry Zhu
37419b44b9 v6.16.3 2016-09-29 11:46:53 -04:00
Joakim
aa0aada8ad Forcing source-map-support module into node environment, so its not tricked by jsdom (#4607) 2016-09-29 17:01:31 +02:00
Henry Zhu
6abc28e532 update types readme [skip ci] 2016-09-29 08:47:24 -04:00
Henry Zhu
b3e04da882 v6.16.2 2016-09-29 08:46:45 -04:00
Daniel Tschinder
5a1984aa41 make babel-helper-remap-async-to-generator bc with babel 6.15 and lower (#4603) 2016-09-29 08:14:39 -04:00
Dan Harper
682e9658c9 Fix bodyless async functions (#4600)
* fix bodyless async functions (#4599)

* Do the same in the async-generator-functions transform
2016-09-29 12:01:37 +02:00
Henry Zhu
6d82ee297e fix link [skip ci] 2016-09-28 18:29:03 -04:00
Henry Zhu
08c0557b26 v6.16.1 2016-09-28 17:25:12 -04:00
Henry Zhu
64cdbf7ca0 Add back babel-runtime (#4591) 2016-09-28 17:21:36 -04:00
Henry Zhu
6d22f258db v6.16.0 2016-09-28 15:38:45 -04:00
Henry Zhu
4f2637e1ec v6.16.0 changelog [skip ci] (#4545)
* v6.16.0 changelog [skip ci]

* Small fixes

* Typo 🙈
2016-09-28 13:49:02 -04:00
Dan Harper
8709899b42 fix flow-strip-types/flow-comments removing entire ClassProperty (#4587) 2016-09-28 18:25:33 +02:00
Henry Zhu
5ea57d5e9c fix tests and add exec test 2016-09-27 17:37:21 -04:00
zenparsing
26e79c5433 Implement support for async generator functions and for-await statements 2016-09-27 17:37:21 -04:00
jezell
9cc0981c51 get / set are valid property names in default assignment (#142) 2016-09-27 23:29:16 +02:00
Simon Lydell
bf0e256c3a babel-code-frame: Highlight strings with green (not red) (#4579)
- Red makes it look like something is wrong with the string.
- On Ubuntu-based systems, it looks kinda broken.
- The error markers (`>` and `^`) as well as invalid tokens are already
  marked with red. By not having strings red, the most important
  information -- the error location -- is more visible.

This is a continuation of commit fa1de5ce (PR #4572).
2016-09-27 15:35:17 -04:00
Simon Lydell
e40aad53a4 Improve syntax highlighting colors (#4572)
- Highlight the error location markers in bold red.
- Dim the line number gutter with grey.
- Don't highlight brackets. Few editor color schemes do.
- Add JSX tag highlighting.
- Don't highlight punctuators with bold. That looks bad on Ubuntu based
  systems. Instead, highlight them the same way as JSX tags, which
  results in really nice JSX highlighting.
- Highlight capitalized variable names.
- Make invalid tokens stand out with a red background.
2016-09-27 11:10:51 -04:00
Henry Zhu
b2eb5eca6f babel-core: add options for different parser/generator (#3561)
* babel-core: add options for different parser/generator

* test for experiemental plugins, other babylon options

* fix passing options into parser

* Fix when no code is provided

* fixup tests

* fix tests again

* use filename and fallback to cwd
2016-09-27 09:09:31 -04:00
Maxime Thirouin
90f3f9049f babel-register: update source-map-support to latest (#4577)
This allows in some case when you use other modules that use this source-map-support lib to get only a single version at the root of node_modules. For example, this can prevent issues when requiring using webpack Banner plugin (compiled code is not always requiring dependencies as you would expect).
2016-09-27 14:55:35 +02:00
Daniel Tschinder
50d2c5e930 Update CONTRIBUTING.md 2016-09-27 10:46:03 +02:00
Henry Zhu
afbe3997a8 babel-code-frame: add options for linesBefore, linesAfter (#4561)
* babel-code-frame: add options for linesBefore, linesAfter

* add example, use list of keywords

* a [skip ci]

* Update index.js
2016-09-26 16:12:35 -04:00
Moti Zilberman
03d772c2ec Computed class properties (#4500)
* Support computed class property names (#4499)

** Depends on babel/babylon#121 **

* `babel-types`: Add `computed` field to `ClassProperty`

* `babel-plugin-transform-class-properties`: handle computed property names correctly

* `babel-generator`: add tests for class properties (computed/literal, static/instance)

* doc: Update babel-types with ClassProperty.computed

* chore(package): update babylon to v6.11.0

* babel-types: move ClassProperty.computed to be last builder arg
2016-09-26 17:46:00 +02:00
Micha Reiser
a81a0d0f84 Fix fileName options passed to babylon (#4570)
The filename options used by babylon is called `sourceFilename` and not `filename`. Therefore the option should be adjusted to be called `sourceFilename`.
2016-09-26 16:31:05 +02:00
Daniel Tschinder
4115bcb97d Fix travis 2016-09-26 10:05:16 +02:00
Henry Zhu
fc2b3cb465 Fixes T2299: Prevent REPL from printing implicit 'use strict' (#4562)
* Fixes T2299: Prevent REPL from printing implicit 'use strict'

* Test for T2299

* make fixes
2016-09-25 23:29:37 -04:00
Daniel Tschinder
702259d483 Only exit if the TRAVIS_COMMIT_RANGE is not empty (#4565) 2016-09-25 23:29:13 -04:00
Logan Smyth
819cde936c Merge pull request #4511 from motiz88/fix-4462
Fix UpdateExpression handling in es2015-modules-commonjs, resolve #4462
2016-09-25 14:16:53 -07:00
Justin Ridgewell
c2ed9de7fb Flip default parameter template (#4515)
* Flip default parameter template

YMMV, I saved ~10b on a 2kb library. Not noticeable at the small scale, by why not do it anyway?

I've (unscientifically) found that flipping the default parameter conditional yields better gzip results. I think this is due to the slightly longer string it can now repeatedly match:

```js
// old
var param = arguments.length <= 0 || void 0 === arguments[0] ? null : arguments[0]
--------------------------------------------------------------^

// new
var param = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null
------------------------------------------------------------------------^
```

Though it's entirely likely gzip will also choose up to the index of the arguments if you many default parameters at different indexes.

* Update tests
2016-09-25 14:05:53 -07:00
Logan Smyth
08b45ca853 Merge pull request #4534 from BoomTownROI/master
Fix issue with minified libraries and code coverage
2016-09-25 13:59:43 -07:00
Kay J
4dcc981d6a Removed unnecessary 'return' statements. (#3653)
* Removed unnecessary 'return' statements.

Returning a 'Promise' value in 'promise.then()' makes promise chains.
Used memory and promises are not garbage collected
until finishing 'helpers.asyncToGenerator'.

* Update test
2016-09-25 13:57:59 -07:00
Logan Smyth
66a4aec1f9 Merge pull request #4566 from loganfsmyth/fix-3695
Allow presets to be ES6 default exports.
2016-09-25 12:52:42 -07:00
Justin Johansson
bae59470da Upgraded all babel-preset-xxxs but babel-preset-es2015 to export syntax 2016-09-25 12:27:32 -07:00
Logan Smyth
ef794198e9 Allow presets to be ES6 exports. 2016-09-25 11:41:43 -07:00
Justin Johansson
e16a1657ab Align all babel-preset-xxx packages dir structures with status quo 2016-09-25 11:41:43 -07:00
Daniel Tschinder
c2d2702cf9 Fix destructuring evaluation with call expressions (#4552)
* Fix destructuring evaluation with call expressions

Do not optimize destructions with callExpressions, as the call
might change the value of a variable that we are assigning to.

Fixes #4054

* Also deopt on member expressions

members expressions might be getters who have side effects
2016-09-24 19:08:53 -04:00
Daniel Tschinder
a83262026f Remove unused dependency babel-register (#4560) 2016-09-24 11:46:08 -04:00
Henry Zhu
ca7c48ff28 fix travis docs check (#4556) 2016-09-24 10:11:52 -04:00
Daniel Tschinder
d6f4d85284 Do not include babel-register in every test (#3669)
This is not necessary
2016-09-24 14:51:01 +02:00
Henry Zhu
44d44a20f9 changelog update 2016-09-23 00:51:29 -04:00
Henry Zhu
a1c0ef220a Don't build on *.md change [skip ci] 2016-09-23 00:50:36 -04:00
Henry Zhu
6ce192d883 6.11.2 changelog [skip ci] 2016-09-23 00:49:06 -04:00
Henry Zhu
fbd3f6a183 6.11.2 2016-09-23 00:44:36 -04:00
Henry Zhu
1d04d12794 Don't do the duplicate check if not an identifier (#140) 2016-09-23 00:44:13 -04:00
Henry Zhu
d7533e899f Internal: cancel build with only .md changes (#4547) 2016-09-22 17:59:47 -04:00
Daniel Tschinder
101e9e5636 Fix styling 2016-09-22 22:31:30 +02:00
Daniel Tschinder
4b11aad516 6.11.1 (#138)
* Update CHANGELOG.md

* Update CHANGELOG.md
2016-09-22 22:30:41 +02:00
Henry Zhu
8a544542db 6.11.1 2016-09-22 16:01:02 -04:00
Daniel Tschinder
952d50faf9 Make exportIdentifiers and array so that base object properties are not accounted (#137) 2016-09-22 16:00:39 -04:00
Henry Zhu
3210bbbce0 6.11.0 2016-09-22 14:08:21 -04:00
Henry Zhu
b1584cac6a link to example pr [skip ci] 2016-09-22 14:05:20 -04:00
Henry Zhu
0ca8f167c7 6.11.0 changelog [skip ci] (#136)
* 6.11.0 changelog [skip ci]

* add examples [skip ci]
2016-09-22 14:03:44 -04:00
Moti Zilberman
774e6b446b Rephrase "assigning/binding to rvalue" errors to include context (#119) (#123)
* Rephrase "assigning/binding to rvalue" error messages with context (#119)

* Fix code style in parser/lval.js

* istanbul ignore some unused branches in parser/lval.js

* Fix code style again in parser/lval.js
2016-09-22 12:02:20 -04:00
Kai Cataldo
1db8c02d05 Remove duplicate default error (#4543)
* Revert "Throw error for multiple exports default (#3518)"

This reverts commit aa51dd4a3d.

* Fix export default tests
2016-09-22 12:00:18 -04:00
Kai Cataldo
650e33376a Disallow duplicate named exports (#107)
fixes #69
2016-09-22 10:20:47 -04:00
Moti Zilberman
4e1fbd48d5 Add support for computed class property names (#120) (#121) 2016-09-21 21:24:59 -04:00
Henry Zhu
c07919bc9b Add support for preset organization shortcuts (#4542)
* add support for @org shortcats, fixes #4362

* add shortcut test

* fixes
2016-09-21 16:44:13 -04:00
Kai Cataldo
f3a6e4b0ae Fix tests with duplicate named exports (#4538)
* Fix babel-plugin-transform-flow-strip-types tests

* Fix babel-plugin-transform-es2015-modules-umd tests

* Fix babel-generator tests

* Fix babel-plugin-transform-es2015-modules-systemjs tests

* Fix babel-plugin-transform-es2015-modules-commonjs tests

* Fix babel-plugin-transform-es2015-modules-amd tests
2016-09-21 10:52:59 +02:00
Dan Harper
b68918e377 fix static falling through in declare class Flow AST (#135) 2016-09-21 00:17:55 -04:00
Henry Zhu
a793107bf3 fix lint 2016-09-20 14:04:15 -04:00
Logan Smyth
46eb99b18b Use the real sourcemap API and handle input sourcemaps - fixes T7259 (#3456) 2016-09-20 13:39:01 -04:00
Alberto Piai
8f6d4ae5cf Fix typeof Symbol.prototype (#3686)
* formatting

* fix `typeof Symbol.prototype`

Babel uses a helper function to return the correct value for `typeof
obj` when obj is a Symbol and support for Symbol has been polyfilled.

This function assumes that `obj.constructor === Symbol` implies `typeof
obj === 'symbol'`.

This isn't true when obj is `Symbol.prototype`. In that case (REPL from
node 6, the same holds in Firefox):

```
> Symbol.prototype.constructor === Symbol
true
> typeof Symbol.prototype
'object'
>
```

AFAICS, that's the only case where the assumption doesn't hold.

The test added by this patch fails only on node 0.10, as 0.12 already
has a native implementation of Symbol and the polyfill code doesn't run.

This caused a problem in core-js when it's compiled with babel (the
issue was isolated by @skozin here:
https://github.com/zloirock/core-js/issues/189#issuecomment-209864582).
2016-09-20 12:19:09 -04:00
Daniel Tschinder
9cb73d8e96 fix call to this.parseMaybeAssign with correct arguments (#133) 2016-09-20 09:42:14 -04:00
Basil Hosmer
cb4b2b0744 flow plugin: generate exact object type annotations (#3702) 2016-09-20 11:10:55 +02:00
Dan Harper
fa7321f978 add tests for other module formats, from #4524 (#4532) 2016-09-20 11:04:07 +02:00
Dan Harper
f859830e54 Fix: export default arrows with function naming (#4524) 2016-09-19 21:58:37 -04:00
Rob Landers
c5504c4807 Update context.js
Fix queue size
2016-09-19 15:12:33 -04:00
Daniel Tschinder
8d2fdb1515 let travis handle depth 2016-09-19 20:39:06 +02:00
Henry Zhu
374908611c add semver note to changelog [skip ci] (#131)
* add semver note to changelog [skip ci]

* fix [skip ci]
2016-09-19 11:40:37 -04:00
Henry Zhu
df60dcbb98 6.10.0 2016-09-19 11:32:59 -04:00
Henry Zhu
399bc6e931 explanation + fix [skip ci] 2016-09-17 23:11:41 -04:00
Moti Zilberman
e64d86c1eb If loading a preset fails, show its name/path (#4506) (#4517) 2016-09-17 23:01:08 -04:00
Daniel Tschinder
cbbc1c7333 fix default exported classes without a name (#4518)
* fix default exported classes without a name

This correctly requeues class without name so the es3 transform can
transform the default keyword.

* Replace phabricator issue number with github
2016-09-17 22:50:54 -04:00
Daniel Tschinder
590ad4d24f Replace phabricator tickets with github ones in code comments (#4519) 2016-09-17 22:50:02 -04:00
Brian Donovan
ec34e5acc7 Remove unused thisReference argument to getSuperProperty. (#4520) 2016-09-17 22:47:52 -04:00
Daniel Tschinder
1fce4cb42a Fix striping of typeParameters from arrow functions (#4521)
the typeParameters field was missing in the visitors and therefore
never visited by babel-traverse

Fixes #4483
2016-09-17 22:46:45 -04:00
Steve Mao
c04a8594ae fix typo: interspatial (#129) 2016-09-16 10:28:11 +02:00
Henry Zhu
8fc6c28900 add note about spec-compliancy and semver (#128)
* add note about spec-compliancy and semver

* review [skip ci]
2016-09-15 19:24:19 -04:00
Henry Zhu
d000ead2b3 6.10.0 changelog [skip ci] 2016-09-15 19:23:54 -04:00
Daniel Tschinder
f91da191a1 Include typeParameter location in the arrow function expression (#126) 2016-09-15 19:08:33 -04:00
Timothy Gu
643d3f37a4 Implement ES2016 check for simple parameter list in strict mode (#106)
* Slightly simplify logic

* Implement ES2016 check for simple parameter list in strict mode

See e.g. ECMA-262 7.0 14.1.2:

> It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
> IsSimpleParameterList of FormalParameters is false.

Similar clauses cover arrow functions, generator functions, methods, and
generator methods, as well as async functions and async arrow functions.
2016-09-15 19:58:01 +02:00
Dan Harper
64145b07e3 error on invalid flow type annotation with default assignment (#122) 2016-09-15 19:35:03 +02:00
Dan Harper
dc3036627b Fix Flow return types on arrow functions (#124)
* fix: arrow return type on next line is valid

https://github.com/babel/babel-eslint/issues/348

* fix: arrow on line after return type annotation is invalid

* lint
2016-09-15 19:27:11 +02:00
Daniel Tschinder
abf6ca8e5e Add tests for export extensions (#127)
The case which includes a namespaced and default import was not tested yet
2016-09-15 19:24:11 +02:00
Daniel Tschinder
0adca96529 Fix Contributing guidelines [skip ci] 2016-09-15 18:39:10 +02:00
Henry Zhu
7f24f0966b 0.0.1 2016-09-13 17:06:51 -04:00
Moti Zilberman
43e0cfb08d Fix UpdateExpression handling in es2015-modules-commonjs, resolve #4462 2016-09-13 19:06:52 +03:00
Basil Hosmer
ddbda7dd04 exact object type annotations for Flow plugin (#104)
* exact object type annotations for Flow plugin

* Couple tweaks per suggestions

* s/==/===/

* add test for unexpected token in flowObjectType Semicolon
2016-09-13 10:07:23 -04:00
Daniel Tschinder
de975b9660 Use plain js to do the pre/postpublish for the polyfill (#3694)
* Use plain js to do the pre/postpublish for the polyfill

* remove dist on clean [skip ci]
2016-09-13 09:09:11 -04:00
Daniel Tschinder
ff78fb19f7 Only set options in cli if different from default (#4507)
* CLI: Only set options if different from default 

Currently default values (like comments: true) will be set always for the transform.
This behaviour dos not allow for setting this options from babelrc as the default would always have precedence.

* Add new tests for comments
Also ensure that the babelrc in the fixture folder is copied over to the
working directory during tests
2016-09-13 08:25:08 -04:00
Daniel Tschinder
993f887240 Test for ignore with starting slash (#4509) 2016-09-12 22:48:06 +02:00
Andy Kant
5e9e659a7f Support custom ports for V8 Inspector (#4508) 2016-09-12 21:00:02 +02:00
Dan Harper
41f2bbc104 Flow: Fix generating arrow functions with param (#4504)
* transform-flow-comments, single arrow param support #4503

* further tests for printing single arrow func param flow code

* cleanup
2016-09-12 08:27:49 -04:00
Timothy Gu
5249b9d809 Remove ES2015 tests than do not parse in ES2016 (#4501)
These tests are originally from Traceur, which does not fully support
ES2016.

See babel/babylon#106 for a rationale why these code blocks are not
valid ES2016.
2016-09-11 21:58:38 -04:00
Henry Zhu
d2d34ba8e7 object rest spread useBuiltIns option (#4491)
* feat(transform-object-rest-spread): add polyfill=false option to avoid extends helper

* object-rest-spread: add useBuiltIns option

* add test for invalid option
2016-09-09 18:38:50 -04:00
Henry Zhu
3d93a2ab9c circle.yml: use later version of 0.10 2016-09-09 18:38:02 -04:00
Henry Zhu
7041e0b46f add example of a test that requires throwing an error [skip ci] 2016-09-09 18:09:52 -04:00
Henry Zhu
015035cd27 6.9.2 changelog [skip ci] 2016-09-09 11:02:16 -04:00
Henry Zhu
7d561e7a04 6.9.2 2016-09-09 10:54:59 -04:00
Henry Zhu
75cb271134 Package.json: remove dependencies object [skip ci] 2016-09-09 10:51:48 -04:00
Henry Zhu
5f9c381f9c update packages, use es2015 loose mode, remove babel-runtime transform (#110)
* update packages, use es2015 loose mode, remove babel-runtime transform

* reuse [skip ci]

* remove runtime
2016-09-09 10:47:07 -04:00
Mathias Bynens
b9919bdc48 babel-generator: Ensure ASCII-safe output for string literals (#4478)
Ref. #4477.
2016-09-08 18:04:52 -04:00
Henry Zhu
e5b9c92d3d mention the redirect url [skip ci] 2016-09-08 12:08:44 -04:00
Henry Zhu
2b4e49dd64 Docs: github issues [skip ci] 2016-09-07 17:14:55 -04:00
Daniel Tschinder
a1b46f1640 Issue and PR templates (#3690) [skip ci]
* Create PULL_REQUEST_TEMPLATE.md

* Create ISSUE_TEMPLATE.md

* Use label names in PR template

* Update ISSUE_TEMPLATE.md

* Update ISSUE_TEMPLATE.md

* Update ISSUE_TEMPLATE.md
2016-09-07 16:37:49 -04:00
Henry Zhu
1445dadb23 Remove unused regenerator deps (#3703) 2016-09-07 11:24:57 -04:00
Daniel Tschinder
69a9ba86ae Enable partial code coverage (#109) 2016-09-06 15:14:19 +02:00
Henry Zhu
e2a4738020 add badges [skip ci] 2016-09-06 09:10:38 -04:00
Henry Zhu
989211b914 add example [skip ci] 2016-09-06 00:11:46 -04:00
Henry Zhu
143e2d3cbf update [skip ci] 2016-09-05 23:52:15 -04:00
Henry Zhu
1d1efe3205 typo [skip ci] 2016-09-05 23:45:44 -04:00
Henry Zhu
4997e184d5 fixes [skip ci] 2016-09-05 23:45:21 -04:00
Henry Zhu
ba5aa48b0c update readme [skip ci] 2016-09-05 23:43:23 -04:00
Henry Zhu
2c97212fd4 modules/loose opts from es2015 preset, add travis (#6)
* modules/loose opts from es2015 preset, add travis

* Update .travis.yml

* fix plugin function [skip ci]
2016-09-05 23:39:50 -04:00
Daniel Tschinder
e3d5a7d646 Update contributing [skip ci] (#108)
* Update contributing [skip ci]

* typo
2016-09-05 23:31:46 +02:00
Daniel Tschinder
71dff8c834 Allow overwritting of sourceRoot (#3685)
Also replaces lodash/extend with Object.assign
2016-09-03 12:12:34 -04:00
Greenkeeper
460714b126 chore(package): update flow-bin to version 0.32.0 (#3697) [skip ci]
https://greenkeeper.io/
2016-09-03 12:04:01 -04:00
Henry Zhu
e5961592c4 babel-code-frame: babel-runtime not necessary (#3699) 2016-09-03 12:03:34 -04:00
Howard Yeh
32232dd30e Watch mode should wait for file change. (T7411) 2016-09-03 16:33:22 +08:00
Bo Borgerson
8f790ceeed Satisfy the "space-infix-ops" eslint rule (#3696)
Future proofing against https://github.com/babel/eslint-config-babel/pull/1.

Only one violation, even without enforcement!
2016-09-02 18:50:03 -04:00
Henry Zhu
d81e154aca remove kcheck, unused devDeps (#3693)
remove unused packages (devDeps)
2016-09-02 08:44:39 -04:00
Greenkeeper
2664c1658d chore(package): update shelljs to version 0.7.4 (#3681)
https://greenkeeper.io/
2016-09-01 23:56:35 +02:00
Henry Zhu
6d7417ba1b Update babel-types docs, contributing, babel-cli [skip ci]
Closes gh-3684
2016-09-01 16:15:32 -04:00
Eric Baer
78c21a282a Implement very basic (but working) functionality (#3)
* Implement very basic (but working) functionality

* Correct PR based on feedback
2016-09-01 11:55:50 -04:00
Henry Zhu
b3dca4fb5a v6.15.0 2016-09-01 11:03:06 -04:00
Henry Zhu
13d76e98d6 v6.15.0 changelog [skip ci] (#3691)
* v6.15.0 changelog [skip ci]

* add [skip ci]

* add [skip ci]
2016-09-01 10:54:41 -04:00
Ben Briggs
c94abcc170 Add support for preserving comments in babel-template. (#3689)
* Add support for preserving comments in babel-template.

* Add an API section to babel-template.
2016-09-01 10:50:25 -04:00
Ryan Biwer
23ea626241 Fix block scope remapping (fixes T7525) (#3662) 2016-09-01 10:48:32 -04:00
Boopathi Rajaa
953dd1df48 Fix toExpression converting arrow functions to function expressions without block body (#3687) 2016-08-31 17:01:59 -04:00
Henry Zhu
174e44f656 fix broken test from old PR 2016-08-31 14:55:38 -04:00
Boopathi Rajaa
477a72a975 Fix bug undefined reference for export declaration (#3629)
+ (Fix https://phabricator.babeljs.io/T7534)
+ Export declaration class/function/var ids now add the export
declaration path as the referenced one.
2016-08-31 14:42:33 -04:00
Stanislav Sysoev
33da726638 Not null check in babel-helper-builder-binary-assignment-operator-visitor (#3647)
Fix: T7537 — https://phabricator.babeljs.io/T7537

When transforming super call in class constructor, part of ast is replaced using method "replaceWithMultiple" here:
https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-es2015-classes/src/vanilla.js#L379

It leads to removing the node (replacing it with null) here:
https://github.com/babel/babel/blob/master/packages/babel-traverse/src/path/replacement.js#L51

But parent ExpressionsStatement is still untouched and when it reaches visitor generated in here
https://github.com/babel/babel/blob/master/packages/babel-helper-builder-binary-assignment-operator-visitor/src/index.js#L18

It blows up because expression is null from previous visitors.
2016-08-31 14:41:49 -04:00
Eric Baer
d32e7413ab Warm people in the README that this is a wip project (#2) 2016-08-31 14:13:00 -04:00
Dan Abramov
4ac0df00f1 Add an option for custom runtime (#3612) 2016-08-31 13:59:43 -04:00
Logan Smyth
288e956699 Merge pull request #3676 from loganfsmyth/non-circular-types
Remove the cycle from babel-types/babel-traverse.
2016-08-31 10:20:41 -07:00
Henry Zhu
dbe48b5157 init data (#1) 2016-08-30 17:56:04 -04:00
Daniel Tschinder
dc56c0b54d Change to export codecoverage as json (#102) 2016-08-30 23:50:56 +02:00
Logan Smyth
a0ca5ed61e Remove the cycle from babel-types/babel-traverse. 2016-08-29 19:13:19 -07:00
Daniel Tschinder
e0b2c86950 Remove deprecated plugin from README.md (#101)
As we probably remove it anyway in the next major we can already at least not expose it in the readme.
2016-08-29 11:06:23 -04:00
Henry Zhu
b871a49e3a fix link [skip ci] 2016-08-25 14:38:28 -06:00
Diogo Franco
cd6130116d Mention how arrow functions' spec uses .bind (#3679) 2016-08-24 20:32:51 -06:00
Henry Zhu
5ce325c399 v6.14.0 2016-08-24 17:40:46 -06:00
Henry Zhu
f834a24b50 Add v6.14.0 changelog [skip ci] (#3677)
* Add v6.14.0 changelog [skip ci]

* fixes [skip ci]
2016-08-24 18:05:47 -05:00
Daniel Tschinder
abec2a70e9 changelog 6.9.1 2016-08-24 11:25:39 +02:00
Henry Zhu
ee1eb59077 Latest tests (#3674)
* add preset-latest tests

* test for es2015-preset spec option
2016-08-23 18:29:40 -04:00
Henry Zhu
32d5c7195e 6.9.1 2016-08-23 17:48:08 -04:00
Henry Zhu
c8b32485a0 Update readme - es2017 [skip ci] 2016-08-23 17:47:20 -04:00
Daniel Tschinder
27ad69d43f Fix declare class with qualified type identifier (#97)
This makes declare class extends behave the same way as in flow
The ast-token after the extends keyword, might be either Identifier or
QualifiedTypeIdentifier

To do that this commits splits the parseGenericType into two functions,
one for parsing genericType and on for qualifiedTypeIdentifier
2016-08-23 17:29:23 -04:00
Dan Harper
efab40154e Fix arrow functions with destructuring, types & default value (#94)
Flow's "toAssignable" override wasn't calling the inner function,
resulting in the destructuring in an AssignmentPattern not having the
node type changed from ObjectExpression to ObjectPattern, resulting in
"Binding rvalue" thrown from "checkLVal()"
2016-08-23 17:27:39 -04:00
Daniel Tschinder
db0705bc51 Fix issues with flow-types and async function (#95)
the typeAnnotation was not correctly resolved in async
functions
2016-08-23 17:22:01 -04:00
Daniel Tschinder
2cfae60b15 Fix issues with default object params in async functions (#96)
This change allows async functions to have a spread argument which
defines a default value.
2016-08-23 17:19:49 -04:00
Daniel Tschinder
4506822180 Remove exponentiationOperator, asyncFunctions, trailingFunctionCommas (#98)
* This removes the exponentiationOperator as it is now in es2016

* Remove from tests

* Remove asyncFunctions and restructure test dirs

* Remove trailingFunctionCommas
2016-08-23 17:11:01 -04:00
Daniel Tschinder
10cd6519d8 Fix class inheritance in IE <=10 (T3041) (#3527)
* Fix class inheritance in IE9 & IE10 (T3041)

Internet Explorer 9&10 do not support __proto__ at all, don't have
Object.setPrototypeOf(), but have Object.getPrototypeOf().

Because of this setting the prototype is not possible, which makes the
babelHelpers.inherits() function to set __proto__ although not supported.

Afterwards Object.getPrototypeOf() is used, but this one is not
respecting the "custom" property __proto__ that we set.

The solution is to check for __proto__ first and afterwards fallback to
Object.getPrototypeOf().

* Do the same logic in babel-helper-replace-supers

* Fix tests

* Extract creation of prototype nodes to small helper
2016-08-23 15:08:44 -04:00
Thomas Aylott
2a4186faf3 Fixes #6726 ignore config option (#3644)
https://phabricator.babeljs.io/T6726
2016-08-23 14:55:37 -04:00
Diogo Franco
53ed4e5eb8 Support 'spec' option on babel-preset-es2015 (#3671)
Allows enabling the spec options in the couple of presets that have it.

Generally enables a slower, but more correct codepath.
2016-08-23 14:28:19 -04:00
Henry Zhu
3bf479789d add options to babel-preset-latest (#3673) 2016-08-23 14:27:43 -04:00
Diogo Franco
1e6257bdcb Fixes modules test to actually test modules (#3672)
* Fixes modules test to actually test modules

It is a mystery how these tests ever passed before.

* Correct test -> suite
2016-08-23 14:06:02 -04:00
Sota Yamashtia
3d0ef3a001 Create preset babel-preset-latest (#3625) 2016-08-23 11:07:23 -04:00
Henry Zhu
20551cf729 Docs: add babel-preset-es2017, change version [skip ci] 2016-08-23 09:32:30 -04:00
Sota Yamashtia
68d7032e0f Add es2017-preset (#3624) 2016-08-23 09:29:38 -04:00
Daniel Tschinder
b06eed30c3 Ensure correct version of babel installed for preset options (#3668) 2016-08-22 08:49:56 -04:00
Greenkeeper
0a8fc15169 chore(package): update istanbul to version 0.4.5 (#3666)
https://greenkeeper.io/
2016-08-22 11:27:17 +02:00
Guy Bedford
de2791a696 ensure consistent expression value for post-assignment unary expressions (#3650) 2016-08-20 12:21:17 -04:00
Paul O’Shannessy
55f37a1b1e Use arrow syntax for ObjectTypeProperty FunctionTypeAnnotations (#3663)
This fixes an issue where optional properties would get transformed to
an invalid syntax. The easiest solution was to make all FunctionTypes
get transformed to the arrow syntax (previously everything went the
other way).
2016-08-20 10:37:56 -04:00
Sebastian McKenzie
07b3dc18a0 Add wrapPluginVisitorMethod option to allow introspection and metrics tracking of plugins (#3659) 2016-08-20 10:36:52 -04:00
Daniel Tschinder
ea69362249 set sourceRoot in babel-register transform (#3608) 2016-08-18 22:42:57 +02:00
Adam Leventhal
0d1e1ee10c incorrect handling of returns nested in switch cases (#3618) 2016-08-18 10:14:07 -04:00
Boopathi Rajaa
183d9570f9 Fix bug where redeclaration of var doesn't deopt (#3559)
* Fix bug where redeclaration of var doesn't deopt. (Close T7470)

* [evaluate] Add tests for cases - let/const/different scopes
2016-08-17 19:23:09 -04:00
Daniel Tschinder
b6496718a7 Correct codecoverage paths (#93) 2016-08-17 18:21:25 +02:00
Sebastian McKenzie
4a19661346 Generate names field for identifiers to get correct names mappings (#3658) 2016-08-16 13:43:55 -04:00
Kai Cataldo
aa51dd4a3d Throw error for multiple exports default (#3518)
Fixes https://phabricator.babeljs.io/T7242
2016-08-16 13:21:00 -04:00
Daniel Tschinder
8bef3156be Correct code example 2016-08-16 19:07:56 +02:00
Daniel Tschinder
308de41992 Add support for the new declare module.exports of flow. (#3570) 2016-08-16 16:54:00 +02:00
Daniel Tschinder
56c7d5a67d Update CHANGELOG.md [skip ci] (#91) 2016-08-16 16:34:51 +02:00
Logan Smyth
2aaee8b8d4 Strip flow-only class props without needing transform-class-properties. (#3655) 2016-08-16 10:30:04 -04:00
Henry Zhu
043da1a26a Revert "Revert "Use es2015 loose mode after publish (#3639)"" (#3645)
This reverts commit a2d66c0fc8.
2016-08-16 16:28:05 +02:00
Sebastian McKenzie
dc6a5d2f86 6.9.0 2016-08-16 15:11:06 +01:00
Sebastian McKenzie
4af484b805 Merge pull request #65 from danez/fix-syntax-error-pos
Fixes SyntaxError position with flow optional type
2016-08-16 15:06:25 +01:00
Sebastian McKenzie
43cdd2f5b0 Merge pull request #57 from danez/fix-arrow-location
Fix arrow param locations with flow types
2016-08-16 15:06:19 +01:00
Sebastian McKenzie
0b87d4c97c Add identifier name to node loc field (#90) 2016-08-16 09:41:10 -04:00
Henry Zhu
090f8cd10f Internal: remove comments (#3657) 2016-08-15 11:40:10 -04:00
Jordan Scales
ca27cf135d Revert "Merge pull request #3641 from babel/guy-fieri" (#3646)
This reverts commit 033681af89, reversing
changes made to a2d66c0fc8.

I brought you into this world, and I can take you out.
2016-08-15 11:35:39 -04:00
Daniel Tschinder
69e914baeb Set correct include patterns for code-coverage 2016-08-14 12:39:41 +02:00
Greenkeeper
2abef9dbaa chore(package): update nyc to version 8.0.0 (#88)
https://greenkeeper.io/
2016-08-14 12:37:25 +02:00
Greenkeeper
0b23e5cc2d chore(package): update babel-plugin-istanbul to version 2.0.0 (#89)
https://greenkeeper.io/
2016-08-14 12:27:05 +02:00
Henry Zhu
d034c24b8e Initial commit 2016-08-13 23:48:33 -04:00
Marcelo Jorge Vieira
a61596472a Fixed typo in README.md (#3651)
Replaced 'seperate' with 'separate'
2016-08-12 10:39:00 +02:00
Sebastian McKenzie
033681af89 Merge pull request #3641 from babel/guy-fieri
Fix exports of babel-core
2016-08-09 10:52:26 +10:00
James Kyle
10f4546fef Remove unnecessary import 2016-08-08 17:34:01 -07:00
James Kyle
f36d07d303 Fixes from PR comments 2016-08-08 17:32:58 -07:00
James Kyle
a2d66c0fc8 Revert "Use es2015 loose mode after publish (#3639)"
This reverts commit 154922c0f7.
2016-08-06 12:33:07 -07:00
Greenkeeper
0a6d333531 chore(package): update ava to version 0.16.0 (#86)
https://greenkeeper.io/
2016-08-06 18:29:38 +02:00
James Kyle
9eb12e2c34 Fix lint 2016-08-05 12:40:50 -07:00
James Kyle
fd89bd136f Fix exports of babel-core 2016-08-05 12:36:08 -07:00
Henry Zhu
154922c0f7 Use es2015 loose mode after publish (#3639) 2016-08-05 10:23:45 -04:00
Brian Donovan
a1c0b5a118 Update test name to reflect reality. (#3640)
Originally pointed out by @Kovensky in https://github.com/babel/babel/pull/3635#discussion_r73652441.
2016-08-05 10:12:33 -04:00
Henry Zhu
94c05225e5 Changelog for v6.13.2 [skip ci] 2016-08-05 09:57:12 -04:00
Henry Zhu
a8324712a5 v6.13.2 2016-08-05 09:51:34 -04:00
Henry Zhu
96f31ed38f Merge pull request #3638 from babel/christophehurpeau-patch-2
[Bug Fix] option manager: val = val.buildPreset should be before the check if the preset supports options
2016-08-05 09:49:33 -04:00
Henry Zhu
7213e57ee2 add tests, be able to pass preset options to test helper 2016-08-05 09:36:52 -04:00
Christophe Hurpeau
425d460ebf [Bug Fix] option manager: val = val.buildPreset should be before the check if the preset supports options 2016-08-05 12:06:07 +02:00
nhducit
3b5a94ed0f Add a white space (#3636) 2016-08-05 10:28:31 +02:00
Logan Smyth
65b733c894 Changelog for 6.13.1. 2016-08-04 21:25:20 -07:00
Logan Smyth
f3ad8a8392 v6.13.1 2016-08-04 21:12:12 -07:00
Logan Smyth
11badb556f Add comment to explain enumerability logic. 2016-08-04 21:06:59 -07:00
Logan Smyth
af50e3194e Merge pull request #3635 from loganfsmyth/fix-back-compat
Fix backward-compatibility of babel-preset-es2015 - fixes T7536
2016-08-04 21:06:16 -07:00
Logan Smyth
66317b10db Fix backward-compatibility of babel-preset-es2015 - fixes T7536 2016-08-04 20:55:20 -07:00
Henry Zhu
39865ce746 fix typos [skip ci] 2016-08-04 21:35:46 -04:00
Henry Zhu
eaea1276a4 add quotes [skip ci] 2016-08-04 21:34:53 -04:00
Henry Zhu
6ab3e35075 v6.13.0 2016-08-04 19:34:51 -04:00
Henry Zhu
a4e2856a2e Docs: add v6.13.0 changelog [skip ci] (#3631)
* Docs: add v6.13.0 changelog [skip ci]

* add link to babel/notes [skip ci]
2016-08-04 19:23:11 -04:00
Henry Zhu
c6354a2132 es2015: transpile the preset, modify modules option to support "amd,umd,systemjs" as well, tests (#3627)
* es2015: transpile the preset, at spec option

* es2015: add support for modules option

* fixes + tests

* fixup preset error messsage

* es2015: update readme [skip ci]

* pass loose to other module transforms
2016-08-04 17:54:04 -04:00
Erik Desjardins
aeb42c2228 Fix bug where path.evaluate treats repeated identifiers as undefined (#3557)
* babel-traverse: add test to demonstrate repeated identifiers being evaluated to `false`

* fix typo: `value` -> `val`

* path.evaluate: only mark item as resolved if we're confident
2016-08-04 16:58:41 -04:00
Daniel Tseng
d0c82f0d8a Missing FlowType definition opts.deprecatedAlias (#3628)
Added missing FlowType definition `opts.deprecatedAlias` for `defineType()` in `babel-types/src/definitions/index.js`
2016-08-04 13:40:41 -04:00
Logan Smyth
897f553dc7 Support passing options to presets. (#3331) 2016-08-03 22:14:16 -04:00
Sebastian McKenzie
c9a7bed6d0 Merge pull request #83 from gabelevi/flow
Small fix for parsing type parameter declarations
2016-08-04 00:37:37 +10:00
Henry Zhu
a959ebe223 Misc: remove deps from syntax plugins (#3604) 2016-08-02 23:11:50 -04:00
Henry Zhu
c331a94943 Show a more informative error message when using the decorator transform and link to the legacy one [skip ci] (#3626) 2016-08-02 20:47:03 -04:00
Henry Zhu
c1a597ffdc Misc: update npm owners [skip ci]
Will remove when we add this to lerna https://github.com/lerna/lerna/pull/294
2016-08-02 09:09:09 -04:00
Henry Zhu
be02536f18 remove minify plugins (will be in another repo) (#3621) 2016-08-02 07:20:08 -04:00
Greenkeeper
8354120664 chore(package): update mocha to version 3.0.0 (#3622)
https://greenkeeper.io/
2016-08-02 10:49:11 +02:00
Douglas Wade
f3d3c899c1 Move decorators to stage 2 (#3613) 2016-08-02 10:47:45 +02:00
Kristóf Poduszló
8f60dbb4a9 Move babel-plugin-transform-class-properties to stage 2 (#3611) 2016-08-01 21:12:52 -04:00
Henry Zhu
1f82a26902 Notes (#3619) [skip ci]
* Docs: remove centering on text [skip ci]

* add link to notes [skip ci]
2016-07-30 15:28:21 -04:00
battaile
3a677400f8 add description (#3614) [skip ci] 2016-07-29 14:49:39 -04:00
Daniel Tschinder
eb691425b6 Only allow declares inside declare module (#73)
* Only allow declares inside declare module

* Better error message
2016-07-29 20:22:49 +02:00
Gabe Levi
859ed04be9 Small fix for parsing type parameter declarations 2016-07-29 12:45:20 -04:00
Dale Bustad
4811d617ce If supplied, attach filename property to comment node loc. (#80) 2016-07-28 23:12:41 +02:00
Daniel Tschinder
64ca55cfe0 Fixes Syntax error position with flow optional type 2016-07-28 23:09:40 +02:00
Daniel Tschinder
cd987cd8e4 Fix arrow param locations with flow types
This patch corrects the end locations for params in arrow functions
which use type params.
2016-07-28 23:09:19 +02:00
Daniel Tschinder
f576865ce9 Add support for declare module.exports (#72)
* Add support for declare module.exports

* Use doublequotes

* Use expect instead of eat
2016-07-28 22:16:58 +02:00
Max Schaefer
fd18d89d8e Fix accidental fall-through in Flow type parsing. (#82)
When parsing a primary type, `>` would erroneously be treated like `(`.
2016-07-28 22:12:47 +02:00
Henry Zhu
35a258f23f Docs: v6.12.0 changelog [skip ci] 2016-07-27 15:24:15 -04:00
Henry Zhu
698ef139bc v6.12.0 2016-07-27 15:23:17 -04:00
Henry Zhu
18238ac072 Docs: add helpers to readme [skip ci] 2016-07-27 10:58:11 -04:00
Sebastian McKenzie
3b4b3656a8 Fix React constant elements transform from hoisting elements to positions where their referenced bindings haven't been evaluated yet (#3596) 2016-07-27 10:54:21 -04:00
Sebastian McKenzie
8d14f9f4d0 Add helpers: false option to babel-plugin-transform-runtime (#3603) 2016-07-27 10:36:58 -04:00
Henry Zhu
0ff1f089bb Fix: use correct identifier in template - fixes T7509 (#3602) 2016-07-27 09:24:26 -04:00
Logan Smyth
81f0f464e7 Merge pull request #3534 from rmacklin/add-exactGlobals-option-to-umd-transform
Add exactGlobals option to transform-es2015-modules-umd plugin to enable more flexibility in specifying global names
2016-07-26 22:55:27 -07:00
Richard Macklin
55a25c271a Simplify accum to just be a memberExpression not an array 2016-07-26 22:38:40 -07:00
Richard Macklin
fcb50de89b Remove unnecessary checking for "." since the code works in either case 2016-07-26 22:38:40 -07:00
Richard Macklin
6c9f241812 Add test case for overriding exported global name without specifying the moduleId or moduleIds options 2016-07-26 22:38:40 -07:00
Richard Macklin
ac9487abf3 Add the ability to override the exported global using the globals map
when `exactGlobals` is true
2016-07-26 22:38:39 -07:00
Richard Macklin
c252d3dae6 Add exactGlobals option to transform-es2015-modules-umd plugin
to enable more flexibility specifying global names
2016-07-26 22:38:39 -07:00
Richard Macklin
8b0179e2d5 Fix typo in transform-es2015-modules-umd plugin README
and specify json as the language for the subsequent code block
2016-07-26 22:38:39 -07:00
Henry Zhu
930c1d583a Docs: v6.11.6 changelog [skip ci] 2016-07-26 18:15:12 -04:00
Henry Zhu
55f20afe1c v6.11.6 2016-07-26 18:12:25 -04:00
Henry Zhu
7ee2381955 Revert "Correct source map paths for babel-register." (#3599) 2016-07-26 18:07:29 -04:00
Aliaksei Sapach
83522c9cb5 fix: systemjs - hoist named function exports (#3594) 2016-07-26 18:06:42 -04:00
Greenkeeper
dce9ee9d80 Update mocha to version 2.5.3 🚀 (#3597)
* chore(package): update mocha to version 2.5.3

https://greenkeeper.io/

* Allow range for mocha
2016-07-26 08:00:01 -04:00
Henry Zhu
309b5ddbe5 Docs: just show for external deps [skip ci] 2016-07-25 11:50:44 -04:00
Henry Zhu
a8fbc98a6d Docs: showing devDeps aren't that useful in our case [skip ci] 2016-07-25 10:04:14 -04:00
Henry Zhu
c5836b0bc2 Misc: remove unused devDep [skip ci] 2016-07-25 09:44:44 -04:00
Henry Zhu
9f585797a6 Docs: remove more unncessary badges [skip ci] 2016-07-25 09:44:12 -04:00
Henry Zhu
7ac09c2e1c Docs: remove devDeps for packages that only use the test helper [skip ci] 2016-07-25 09:40:32 -04:00
Henry Zhu
21fb122df2 Add badges (#3593)
* Docs: Add badges, update readme [skip ci]

* update [skip ci]

* updates
2016-07-25 09:12:15 -04:00
Henry Zhu
98dea13afa v6.11.5 2016-07-23 14:09:34 -04:00
Henry Zhu
5a92f1c6c5 Docs: v6.11.5 changelog [skip ci] (#3592)
* Docs: v6.11.5 changelog [skip ci]

* fix [skip ci]
2016-07-23 14:01:01 -04:00
Henry Zhu
253918c30f Fix buildExportAll to account for commonjs/amd/systemjs (#3591)
* Fix buildExportAll to account for commonjs/amd

If the re-exported module was generated with Babel and it is a commonjs or amd module and so is the current module, this will result in an attempt to redefine the __esModule property, which throws a runtime error.

* Add test: don't overwrite __esModule on re-export

(Failing.)

* fixup tests

* Add fix for systemjs
2016-07-23 13:21:07 -04:00
Henry Zhu
d6646fb54f Docs: update readme [skip ci] 2016-07-23 09:34:45 -04:00
Rolf Timmermans
c8bd9e3ffb Correct source map paths for babel-register. (#3523) 2016-07-22 11:11:31 -04:00
Keyan Zhang
879f69f0fb infer class name for classes that have static properties (#3589) 2016-07-22 09:50:03 -04:00
Thomas Grainger
a289dfbbab The config name is sourceMaps not sourceMap (#3588) 2016-07-21 10:10:58 +02:00
Henry Zhu
6e58954bce v6.11.4 2016-07-19 21:59:53 -04:00
Henry Zhu
5f9cbeab00 Docs: v6.11.4 changelog [skip ci] (#3587) 2016-07-19 21:50:11 -04:00
Logan Smyth
210c3f7da9 Merge pull request #3564 from jamestalmage/lazy-require-hook
Extract config file resolution from OptionsManager
2016-07-19 18:24:45 -07:00
Logan Smyth
40ec299df5 Merge pull request #3583 from jhen0409/patch-3
Add block if parent is non-block statement for remove-console/debugger
2016-07-18 22:21:10 -07:00
Jhen
6cb3e5ed1f Add statement-no-block test fixture for remove-console/debugger 2016-07-19 13:02:29 +08:00
Jhen
e464b9ab87 Add block if parent is no block statement for remove-console/debugger 2016-07-19 12:56:29 +08:00
Logan Smyth
ab47b439cc Merge pull request #3586 from loganfsmyth/fix-retainLines-generator-issue
Avoid duplicated identifier sharing location - fixes T7436
2016-07-18 20:56:57 -07:00
Logan Smyth
ea426baa07 Avoid duplicated identifier sharing location - fixes T7436 2016-07-18 20:49:14 -07:00
Logan Smyth
a1c2d4dd5d Merge pull request #3584 from loganfsmyth/generator-refactor-cleanup2
babel-generator: More refactoring and optimizations
2016-07-18 19:23:24 -07:00
Logan Smyth
a13bf6e0be Drop the unhelpful 'keyword' helper. 2016-07-18 19:12:22 -07:00
Logan Smyth
1b527eb23c Perform number decimal checks at the token level. 2016-07-18 19:12:21 -07:00
Logan Smyth
9f49c99774 Drop .getLast(). 2016-07-18 19:12:21 -07:00
Justin Ridgewell
9a6890c92f Default parameters cleanup (#3574)
* Remove buildDefaultParamAssign

This seems to have been
[added](https://github.com/babel/babel/commit/4b85b05839017ab2abc03ba2d1
e875a63f002890) in v5.5.4 to address
[#1690](https://phabricator.babeljs.io/T1690). It [became
“dead”](https://github.com/babel/babel/blob/v6.0.0/packages/babel-core/t
est/fixtures/transformation/es6.parameters/default-before-last/expected.
js) (as far as I can tell) in the [v6.0.0
commit](https://github.com/babel/babel/commit/ae7d5367f1c3d438667242d692
5db024f875fccd).

Either way, this code is never executed.

- `pushDefNode` is only called when the param is a default param.
- `buildDefaultParamAssign` (which is inside `pushDefNode`) only runs
of the param index is less than or equals to the lastNonDefaultParam.
AKA, is this param before any non-defaulting params.

Which is a contradiction.

* Small optimization

No need to check if we need an iife if we already know we need one.
2016-07-18 11:03:59 -04:00
Daniel Tschinder
88eec4b852 Support all variations of v8Flags (#3578)
This adds support for specifying v8Flags with dashes. Previously only underscores
were allowed.
Also allows specifying values for v8Flags in the from --flag=value, which was not supported till now.
Also add --inspect support.
2016-07-18 10:36:03 -04:00
Logan Smyth
fdc5b7cb5d Only set the source location when inserting the comment text. 2016-07-17 21:51:01 -07:00
Logan Smyth
4dcec860bd Drop trailing whitespace after all newlines. 2016-07-17 21:51:01 -07:00
Logan Smyth
59fe72ee7d Avoid recalculating the current line. 2016-07-17 21:51:01 -07:00
Logan Smyth
1bbf109e8e Move aux comments entirely into printer. 2016-07-17 21:51:01 -07:00
Logan Smyth
11ee8642fd Drop the 'after' callback from 'print'. 2016-07-17 21:51:01 -07:00
Logan Smyth
59c1945493 Move whitespace handling into statement list printing. 2016-07-17 21:51:01 -07:00
Logan Smyth
5de7433147 Avoid calls to isUserWhitespacable by explicitly marking statement lists. 2016-07-17 21:51:00 -07:00
Logan Smyth
38b91235cc Print inter-node newlines before other node items. 2016-07-17 21:51:00 -07:00
Logan Smyth
6bf52b74c0 Include newline insertion in the call sites of rightBrace. 2016-07-17 12:39:22 -07:00
Logan Smyth
0e05e9f216 Rely on .space and .newline behavior instead of explicit format checks. 2016-07-17 12:39:22 -07:00
Logan Smyth
68bc3d7dfb Standardize on the comment format function. 2016-07-17 12:39:22 -07:00
Logan Smyth
a3c99278ba Move format definition into Printer. 2016-07-17 11:07:26 -07:00
Logan Smyth
0d5cbe6102 Move class static helpers off class. 2016-07-17 11:07:26 -07:00
Logan Smyth
5e730b18bb Instantiate Whitespace in the printer. 2016-07-17 11:07:25 -07:00
Logan Smyth
ca1d601037 Move property definitions to class props. 2016-07-17 11:07:24 -07:00
Logan Smyth
1d0ff341fd Skip mutating the 'ignore' flag when printing. 2016-07-17 11:06:31 -07:00
Daniel Tschinder
88d7e2012c Fix lookahead to not add comments to arrays which are not cloned (#76)
We do not clone arrays in lookahead() but comments were added
to leading/trailing arrays during lookahead, leading to leak to the next next() call.

Also extracted parsing of JSXSpreadChild to own parse function.
2016-07-17 11:08:25 +02:00
Daniel Tschinder
97325592fa Fix exponential operator to behave according to spec (#75) 2016-07-17 11:08:12 +02:00
Logan Smyth
3cc38a0063 Merge pull request #3581 from loganfsmyth/generator-refactor-cleanup
babel-generator: Misc cleanup and stale code removal
2016-07-16 12:44:19 -07:00
Logan Smyth
a255ef9ba1 Merge pull request #3580 from jridgewell/babel-generator
Further optimize babel-generator Buffer
2016-07-16 12:40:55 -07:00
Logan Smyth
44282e4579 Disable indent and inc/dec time. 2016-07-14 22:58:48 -07:00
Logan Smyth
9b8b5112df Remove unneeded _compact assignment. 2016-07-14 22:58:48 -07:00
Logan Smyth
1bf76b0f33 Use .append to force-commit semicolons for empty statements. 2016-07-14 22:58:48 -07:00
Logan Smyth
bd9bb053c3 Flatten aux comment logic. 2016-07-14 22:58:48 -07:00
Logan Smyth
9483f4bd94 Drop old stale code. 2016-07-14 22:58:47 -07:00
Logan Smyth
b841d12c9e Initialize inForStatementInitCounter as a public var. 2016-07-14 22:58:47 -07:00
Logan Smyth
e056c0b9d6 Use the presence of _whitespace to toggle its use. 2016-07-14 22:58:47 -07:00
Logan Smyth
6a74731c6b Drop the private version of ._format 2016-07-14 22:58:47 -07:00
Logan Smyth
55a1ffd266 Mark a bunch of methods private. 2016-07-14 22:58:46 -07:00
Justin Ridgewell
a70755d0e6 Further optimize babel-generator Buffer
We can eek out a bit more speed from Babel generator by turning the
buffer into an array as well.
Re: #3565

```
Items: 2 , time: 4 length: 114
Items: 4 , time: 3 length: 218
Items: 8 , time: 3 length: 426
Items: 16 , time: 2 length: 861
Items: 32 , time: 5 length: 1741
Items: 64 , time: 2 length: 3501
Items: 128 , time: 4 length: 7106
Items: 256 , time: 8 length: 14530
Items: 512 , time: 12 length: 29378
Items: 1024 , time: 24 length: 59147
Items: 2048 , time: 38 length: 121611
Items: 4096 , time: 71 length: 246539
Items: 8192 , time: 131 length: 496395
Items: 16384 , time: 350 length: 1015260
Items: 32768 , time: 573 length: 2063836
Items: 65536 , time: 1263 length: 4160988
Items: 131072 , time: 2143 length: 8448509
Items: 262144 , time: 4859 length: 17230333
```

to

```
Items: 2 , time: 4 length: 114
Items: 4 , time: 3 length: 218
Items: 8 , time: 9 length: 426
Items: 16 , time: 1 length: 861
Items: 32 , time: 5 length: 1741
Items: 64 , time: 1 length: 3501
Items: 128 , time: 3 length: 7106
Items: 256 , time: 7 length: 14530
Items: 512 , time: 9 length: 29378
Items: 1024 , time: 17 length: 59147
Items: 2048 , time: 30 length: 121611
Items: 4096 , time: 61 length: 246539
Items: 8192 , time: 113 length: 496395
Items: 16384 , time: 307 length: 1015260
Items: 32768 , time: 443 length: 2063836
Items: 65536 , time: 1065 length: 4160988
Items: 131072 , time: 1799 length: 8448509
Items: 262144 , time: 4217 length: 17230333
```
2016-07-15 01:27:45 -04:00
Logan Smyth
6b7f3cc4cd Inline comment generation function. 2016-07-14 21:55:08 -07:00
Logan Smyth
475581dc66 Ditch the tiny Position class. 2016-07-14 21:55:08 -07:00
Logan Smyth
8379c21939 Drop unneeded condition in SourceMap class. 2016-07-14 21:54:47 -07:00
Greenkeeper
f5df4b9411 chore(package): update cross-env to version 2.0.0 (#77)
https://greenkeeper.io/
2016-07-14 00:35:13 +02:00
Henry Zhu
3073c63e58 Docs: 6.11.3 changelog [skip ci] (#3576) 2016-07-13 06:50:47 -04:00
Daniel Tschinder
406cd33ca2 Use plugin-babel-istanbul for codecoverage 2016-07-13 11:43:31 +02:00
Henry Zhu
7076c675d9 v6.11.3 2016-07-12 22:33:58 -04:00
Justin Ridgewell
823ffbd87c Fix error in rest parameter length optimization (#3573)
If there aren’t enough arguments to get to the offset index, we would
return an negative length.
2016-07-12 21:12:45 -04:00
Sebastian McKenzie
3fad8cc9a7 Merge pull request #42 from calebmer/feat/jsx-spread-children
Add JSX spread children
2016-07-13 01:32:09 +01:00
Daniel Tschinder
b00ba47e6c run build before publish with production env 2016-07-13 01:02:11 +02:00
Daniel Tschinder
964bd4d609 Add coverage badge 2016-07-13 00:43:26 +02:00
Daniel Tschinder
0b62ecee21 Add sourcemaps for code coverage 2016-07-13 00:27:53 +02:00
Daniel Tschinder
149a339932 Use codecov node client 2016-07-12 23:05:13 +02:00
Daniel Tschinder
f4b8b85f11 Use correct coverage reporter 2016-07-12 22:34:43 +02:00
Daniel Tschinder
47d11ae084 Enable coverage on travis 2016-07-12 22:20:31 +02:00
Daniel Tschinder
15a391d305 Fix tests to not save expected output if we expect the test to fail 2016-07-11 13:35:50 +02:00
James Talmage
0a9cbe6e83 git commit add test for package.json config 2016-07-07 16:58:22 -04:00
James Talmage
8e84196eb8 add tests for env options 2016-07-07 16:36:34 -04:00
Daniel Tschinder
50422c6db1 Add PR numbers to changelog [skip ci] 2016-07-07 10:17:33 +02:00
Daniel Tschinder
ee6a578478 Make a shallow clone of babel for testing
There is no need to retrieve the whole history.
2016-07-07 10:00:04 +02:00
Logan Smyth
57ef3ea8eb Merge pull request #3567 from loganfsmyth/fix-generator-buffer-getlast
Use the first item in the queue since it is the most recent.
2016-07-06 23:45:46 -07:00
Logan Smyth
11d49db23b Use the first item in the queue since it is the most recent. 2016-07-06 23:30:45 -07:00
Logan Smyth
f1a71093f9 Merge pull request #3566 from jridgewell/patch-1
Remove unused Position#unshift
2016-07-06 19:13:53 -07:00
Justin Ridgewell
9cdb24157e Remove unused Position#unshift
Not only is it unused, it'll break things if you push a newline since it doesn't set a new `#column` value.
2016-07-06 21:58:02 -04:00
Logan Smyth
193b9b5797 Merge pull request #3565 from loganfsmyth/codegen-append-only
Make the code generator write-only to avoid exponential time generation
2016-07-06 18:33:00 -07:00
Henry Zhu
46ed49fe3a add 6.8.3,6.8.4 changelog [skip ci] 2016-07-06 19:40:51 -04:00
Henry Zhu
46fc224382 6.8.4 2016-07-06 19:34:38 -04:00
Daniel Tschinder
34a82f716e Fix the location of params, when flow and default value used (#68)
Fixes #67
2016-07-06 17:48:47 -04:00
Daniel Tschinder
83bf84f7cd 6.8.2 changelog [skip ci] (#60) 2016-07-06 17:48:31 -04:00
Logan Smyth
65a677decd Maintain a queue to allow deletion of whitespace/semicolons without accessing buf. 2016-07-05 21:03:29 -07:00
Logan Smyth
cb60808500 Make buffer a property for managing the token queue. 2016-07-05 21:02:46 -07:00
Logan Smyth
c5a6c5c291 Pass values directly to avoid object usage. 2016-07-05 21:01:33 -07:00
Logan Smyth
abb9618e8c Drop array support from endsWith. 2016-07-05 19:44:51 -07:00
Logan Smyth
f908f3fc88 Use 'push' for all cases. 2016-07-04 22:49:59 -07:00
Logan Smyth
caef91672d Remove unnecessary passthrough function. 2016-07-04 22:49:59 -07:00
Logan Smyth
578f48134b Remove removeLast usage. 2016-07-04 22:49:59 -07:00
Logan Smyth
80cd3ca331 Drop one usage of removeLast. 2016-07-04 22:49:59 -07:00
Logan Smyth
d6b1e36d49 Make the 'catchUp' call implicit to source location updates. 2016-07-04 22:49:58 -07:00
Logan Smyth
3680d10b6f Centralize position tracking into buffer. 2016-07-04 22:42:28 -07:00
James Talmage
62ad67e5d9 add tests for build-config-chain 2016-07-03 23:58:44 -04:00
Sebastian McKenzie
e0639505d1 6.8.3 2016-07-03 16:47:35 +01:00
Sebastian McKenzie
22cf1f8826 Merge pull request #63 from danez/performance-regression
Fix performance regression introduced in 6.8.2
2016-07-03 16:46:44 +01:00
Daniel Tschinder
4e2072def8 Fix performance regression introduced in 6.8.2
This commit e6c11a0 (#19) made a big performance regression.
The reason was that parseConditional was always cloning the current state
even if no question mark (potential conditional or flow-optional
token) was at the current position.
Simply checking if questionmark matches the current token solves the problem.

Fixes #62
2016-07-03 11:52:01 +02:00
Logan Smyth
177c092496 Remove sideeffectful position mutation. 2016-07-02 15:38:05 -07:00
Logan Smyth
e4da8cfea5 Use the standard newline function. 2016-07-02 15:38:05 -07:00
James Kyle
c561312bee Adds strictMode option to strict-mode transform (#3562) 2016-07-02 13:27:57 -07:00
Logan Smyth
52683f0018 Use the proper transform plugin for preset-es2016. (#3563) 2016-07-02 14:46:38 -04:00
James Talmage
79d8c5aa14 find list of applicable configs without requiring babel-core or plugins
`build-config-chain.js` creates an array of options which will be passed to `OptionsManager#mergeOptions`. The advantage of separating it out is that `build-config-chain` has a very minimal dependency list. The eventual intent is to allow the require hook to lazy load only when required. In other words, if no required files ever match the patterns `ignore` / `only` patterns, the bulk of babel-core, and the associated plugins, will never be loaded.
2016-07-02 03:04:49 -04:00
Daniel Tschinder
84b1bc52e1 Ensure that build directories are not included in release 2016-06-30 00:59:43 +02:00
Daniel Tschinder
b02dba8d24 Ignore build directory in eslint 2016-06-30 00:55:03 +02:00
Daniel Tschinder
5a74dedeb6 Remove cache because of outdated versions on travis 2016-06-30 00:34:35 +02:00
Daniel Tschinder
7593b802ae Enable babel tests on travis 2016-06-30 00:26:36 +02:00
Daniel Tschinder
5e1e1d296a Merge pull request #56 from babel/hzoo-patch-1
6.8.1 changelog [skip ci]
2016-06-29 19:42:37 +02:00
Logan Smyth
ff4f476abe Update Changelog for 6.11.2. 2016-06-28 23:18:52 -07:00
Logan Smyth
172d81d4fe v6.11.2 2016-06-28 23:14:43 -07:00
Logan Smyth
4126b38b9b Merge pull request #3558 from loganfsmyth/fix-async-func-ref
Fix non-unique 'ref' binding name - fixes T7468
2016-06-28 19:26:52 -07:00
Logan Smyth
ee43c4b735 Merge branch 'master' into fix-async-func-ref 2016-06-28 19:26:39 -07:00
Logan Smyth
231f27f170 Fix non-unique 'ref' binding name - fixes T7468 2016-06-28 19:16:44 -07:00
Henry Zhu
efbd530690 Use secure token for slack notifications from travis (#3556) 2016-06-28 08:45:36 -04:00
Henry Zhu
e390570f9d Docs: 6.11.1 changelog [skip ci] 2016-06-27 17:24:26 -04:00
Henry Zhu
7b9749233e v6.11.1 2016-06-27 17:19:48 -04:00
Forbes Lindesay
3bc3c9a3ed Babel types docs (#3549)
* Update babel-types documentation

Mostly just re-run generate-babel-types-docs but also update for some
more validator types.

* Rebuild docs as part of "build-dost"

* Include fields not in BUILDER_KEYS in babel-types docs

These fields don’t have a shorthand for you to pass them to the helper
method, but they are still useful to know about.

* Fields not included in BUILDER_KEYS cannot be "required"

We don’t ever type-check fields not in BUILDER_KEYS so they are never
required.
2016-06-27 17:01:58 -04:00
Henry Zhu
39f645768c Remove jsx-self from react preset (#3552) 2016-06-27 11:47:37 -04:00
Antonio Diaz
7a15409085 Update to Contributor Covenant v1.4 (#3515) 2016-06-26 20:44:58 -07:00
Henry Zhu
f345c70c96 Docs: 6.11.0 changelog [skip ci] (#3551) 2016-06-26 20:47:41 -04:00
Henry Zhu
470635adb0 v6.11.0 2016-06-26 20:21:26 -04:00
Henry Zhu
22eb40d204 Build: use lerna 2.x beta (#3509)
lerna changelog

update
2016-06-26 17:28:14 -04:00
Logan Smyth
15f267b7af Merge pull request #3550 from loganfsmyth/fix-jsx-self-mistakes
Fix some mistakes in the jsx-self transform.
2016-06-26 13:56:27 -07:00
Logan Smyth
856b1f2923 Fix some mistakes in the jsx-self transform. 2016-06-26 13:52:07 -07:00
Henry Zhu
4dd64dbe0f 6.8.1 changelog [skip ci] 2016-06-24 14:43:37 -04:00
Sebastian McKenzie
376fb835b9 6.8.2 2016-06-24 18:36:50 +01:00
Sebastian McKenzie
d976b56bbe Merge pull request #54 from gabelevi/arrow
[Flow] Arrow function type parameter declarations
2016-06-24 18:36:07 +01:00
Gabe Levi
22374b6bec [Flow] Arrow function type parameter declarations 2016-06-24 10:34:09 -07:00
Sebastian McKenzie
f30f1942b6 Merge pull request #55 from vkurchatkin/gen-getset
flow: allow generic method with name get or set
2016-06-24 18:24:27 +01:00
Vladimir Kurchatkin
f0c7660980 move logic to flow plugin 2016-06-24 20:23:02 +03:00
Vladimir Kurchatkin
d5f75cb2f0 flow: allow generic method with name get or set 2016-06-24 19:47:30 +03:00
Sam Pepose
3ee06187d5 Fixed incorrect newlines with Flow object types (#3548) 2016-06-23 20:38:05 -04:00
Mathias Bynens
115a6543ab Update to regexpu-core@2.0.0 for ES2016 compliance (#3338)
regexpu-core v2.0.0 matches the ES2016 spec. See 9b10d2a597.
2016-06-23 12:03:03 -04:00
Logan Smyth
cae3f60e76 Merge pull request #3546 from sampepose/master
Fixed incorrect printing of array of nullable flow type
2016-06-22 21:31:10 -07:00
Sam Pepose
7d83147e16 Added semicolon 2016-06-22 21:21:53 -07:00
Sam Pepose
199a612131 Fixed incorrect printing of array of nullable flow type 2016-06-22 20:33:43 -07:00
Simon Lydell
3d77ad9381 babel-code-frame: Upgrade to js-tokens@2 (#3533)
That version brings ES2016 support. However, the difference in syntax
highlighting is not distinguishable, because both `*` and `**` get the
same color.
2016-06-22 13:23:21 -04:00
Sergey Rubanov
8fef2bc568 Add es2016 preset (#3531) 2016-06-22 12:16:49 -04:00
Jacob Rask
17ce0a57c5 Promote trailing-function-commas to stage 3 (#3522)
See https://github.com/tc39/proposals
2016-06-22 12:16:14 -04:00
Henry Zhu
93299d9bc4 add new package to react preset package.json 2016-06-22 12:14:36 -04:00
Sebastian McKenzie
9229225f21 Merge pull request #3540 from jimfb/jsx-self
Added jsx-self babel transform plugin
2016-06-22 17:11:25 +01:00
jim
7d0c4ecf17 Added jsx-self babel transform plugin 2016-06-22 09:05:48 -07:00
Sebastian McKenzie
cde17b33bd Merge branch 'master' of github.com:babel/babylon 2016-06-22 15:28:24 +01:00
Henry Zhu
3f266691a8 fix ast links again [skip ci] 2016-06-22 09:54:05 -04:00
Jesse McCarthy
d0edc1c646 Link to new AST spec location (#3544) 2016-06-22 09:51:19 -04:00
Sebastian McKenzie
59537a473b Merge pull request #50 from jmm/ast-spec-link
Fix link to AST spec
2016-06-22 14:49:06 +01:00
Jesse McCarthy
6dac2afd43 Fix link to AST spec
[ci skip]
2016-06-22 09:46:26 -04:00
Sebastian McKenzie
cf6e0d365e rename parser context types 2016-06-22 14:06:58 +01:00
Henry Zhu
c8e35ee70a Test on node 6, remove iojs 2016-06-22 08:58:39 -04:00
Henry Zhu
dcc3b981f9 rm extraneous text [skip ci] 2016-06-22 08:55:41 -04:00
Sebastian McKenzie
3267afd608 Merge pull request #3543 from babel/mv-ast-spec
Move ast spec to babylon [skip ci]
2016-06-22 13:54:19 +01:00
Sebastian McKenzie
0b58ad29ab Merge pull request #46 from babel/ast-spec
Move ast spec from babel/babel [skip ci]
2016-06-22 13:54:05 +01:00
Sebastian McKenzie
b0236b8ede Merge pull request #47 from babel/hzoo-patch-1
Update Output, change links [skip ci]
2016-06-22 13:53:56 +01:00
Sebastian McKenzie
35b6c09f8f Merge pull request #45 from mathiasbynens/unicode-9
Update to Unicode v9
2016-06-22 13:53:25 +01:00
Henry Zhu
2d4c117485 Update Output, change links [skip ci] 2016-06-22 08:50:48 -04:00
Sebastian McKenzie
3524ad510f remove grouped type arrow restriction as it seems flow no longer has it - fixes #44 2016-06-22 13:43:32 +01:00
Henry Zhu
be7d968903 Move ast spec from babel/babel [skip ci] 2016-06-22 08:39:29 -04:00
Henry Zhu
5ead4b3e96 Move ast spec to babylon [skip ci] 2016-06-22 08:39:18 -04:00
Mathias Bynens
b7ed4f5d12 Update to Unicode v9 2016-06-22 14:35:19 +02:00
Sebastian McKenzie
f63802c716 add missing generate-identifier-regex script - fixes #7 2016-06-22 13:24:35 +01:00
Sebastian McKenzie
4ca3cd8d1a remove line terminator restriction after await keyword - fixes #38 2016-06-22 13:18:43 +01:00
Sebastian McKenzie
43e01e40f1 upgrade ava 2016-06-22 13:17:31 +01:00
Sebastian McKenzie
ec0a349ec8 support negative numeric type literals - fixes T7450 2016-06-22 13:17:27 +01:00
Sebastian McKenzie
96a7eadbe4 Merge branch 'danez-fix-flow-optional-type' 2016-06-22 12:52:55 +01:00
Sebastian McKenzie
461261b181 Merge branch 'fix-flow-optional-type' of https://github.com/danez/babylon into danez-fix-flow-optional-type
# Conflicts:
#	src/plugins/flow.js
2016-06-22 12:52:42 +01:00
Sebastian McKenzie
74ee30bfbe Merge pull request #21 from danez/test-babel
Test babel with dev babylon
2016-06-22 12:45:05 +01:00
Sebastian McKenzie
78597290ec Merge pull request #23 from danez/fix-comments
Fix leading comments added from previous node
2016-06-22 12:44:12 +01:00
Sebastian McKenzie
55d47ab7b4 Merge pull request #41 from nene/ast-spec
Document AST differences from ESTree
2016-06-22 12:43:41 +01:00
Sebastian McKenzie
4d2e1dddfb Merge pull request #10 from danez/fix-flow-arrow-spread
Fix flow plugin when flow+arrow+spread used together
2016-06-22 12:36:52 +01:00
Logan Smyth
6efef693a2 Add forgotten attribution. 2016-06-21 09:56:15 -07:00
Logan Smyth
2ad9be1974 Update Changelog for 6.10.4 2016-06-21 09:48:10 -07:00
Logan Smyth
faf024ad44 v6.10.4 2016-06-21 09:43:33 -07:00
Logan Smyth
60e6b74901 Merge pull request #3537 from theJian/master
update minimatch to v3.0.2
2016-06-21 08:14:52 -07:00
Daniel Tschinder
f11a82c96c Adjust cloning of nodes in import/export-specifiers and obj-destructuring (#24)
The cloning caused comments that where added to the original node to be persisted into
the cloned node.
Espree/Acorn does not have any cloning, that's why it is working there.
This change omits comments when cloning, as removing the cloning
causes tests in babel to fail.
2016-06-21 09:55:15 -04:00
Sebastian McKenzie
92d45c3f6c Merge pull request #16 from danez/enable-tests
Enable deactivated tests
2016-06-21 00:03:38 +01:00
Sebastian McKenzie
8977d8c75a Merge pull request #31 from eldereal/master
Allow use react elements after yield statement
2016-06-20 22:50:36 +01:00
A2ZH
49d36e291d update minimatch v3.0.2 2016-06-21 01:01:42 +08:00
Sebastian McKenzie
b2390cca02 deopt on recursion in path.evaluate - fixes T7397 2016-06-19 22:08:39 +01:00
calebmer
a25a4ffdc1 Add JSX spread children 2016-06-19 10:48:20 -04:00
Logan Smyth
5a8a2512d0 Docs: 6.10.3 changelog [skip ci] 2016-06-18 16:58:45 -07:00
Logan Smyth
cc22b1cc23 v6.10.3 2016-06-18 16:55:21 -07:00
Logan Smyth
d2eecfb6cc Merge pull request #3532 from loganfsmyth/allow-empty-exports
Allow empty export statements with no export specifiers - fixes T7439
2016-06-18 13:24:31 -07:00
Logan Smyth
2ba27c73d7 Allow empty 'export {};' statements - fixes T7439 2016-06-18 12:41:44 -07:00
Rene Saarsoo
d7dc857bbf Document AST deviations from ESTree spec
Refs #40
2016-06-18 11:05:48 +03:00
Rene Saarsoo
dd8856d5cc Correct Options heading level in README 2016-06-18 10:30:55 +03:00
Henry Zhu
3ecf417509 typo [skip ci] 2016-06-17 17:49:07 -04:00
Henry Zhu
724699ff5e Docs: 6.10.2 changelog [skip ci] (#3530) 2016-06-17 17:48:16 -04:00
Henry Zhu
bfc90c975d v6.10.2 2016-06-17 17:45:16 -04:00
Henry Zhu
514e40923c cleanup transpiled files in make clean - fixes T7434 [skip ci] (#3528) 2016-06-17 17:24:18 -04:00
Daniel Tschinder
d7c0fbdf5b "name" should not be visited for TypeParameter (#3529)
name is a string and does not need to be visited
2016-06-17 17:21:23 -04:00
Logan Smyth
4e1b4aecfd Merge pull request #3492 from loganfsmyth/codegen-cleanup
Refactor space insertion and remove some unneeded function options
2016-06-16 22:15:56 -07:00
Logan Smyth
df2c3f3d25 Use the common space helper everywhere to ensure we get the smallest output possible. 2016-06-16 22:00:24 -07:00
Logan Smyth
5c74ebb87e Remove unneeded space check. 2016-06-16 22:00:24 -07:00
Logan Smyth
1514d0a1ad Drop some space-insertion logic. 2016-06-16 22:00:23 -07:00
Logan Smyth
39896b4d91 Automatically prepend a space when writing a word immediately after a word. 2016-06-16 22:00:23 -07:00
Logan Smyth
4286cb4f2a Explicitly label standalone tokens and words. 2016-06-16 22:00:23 -07:00
Logan Smyth
e702e67233 Split all of the pushes into individual tokens. 2016-06-16 22:00:23 -07:00
Logan Smyth
22e2c88269 Drop the unneeded noIndent function param. 2016-06-16 22:00:23 -07:00
Logan Smyth
f566700657 Avoid processing indentation for every pushed string. 2016-06-16 21:59:51 -07:00
Logan Smyth
8336aa52e8 Split all of the separators into functions. 2016-06-16 20:31:19 -07:00
Logan Smyth
3e1a661eb6 Use the general list handlers and the default separator. 2016-06-16 20:31:19 -07:00
Logan Smyth
315c075419 Remove the unnecessary push/_push division. 2016-06-16 20:31:19 -07:00
Logan Smyth
528128f62d Avoid looking for raw values for all nodes. 2016-06-16 20:31:19 -07:00
Logan Smyth
710f151d31 Use the standard space helper for comment space. 2016-06-16 20:31:19 -07:00
Logan Smyth
680fcc16d7 Standardize on .endsWith 2016-06-16 20:31:19 -07:00
Logan Smyth
2f790889eb Make sure to roll back the generated position markers when trimming spaces. 2016-06-16 20:31:19 -07:00
Logan Smyth
9ddf9aabfc Don't track position when sourcemaps are off. 2016-06-16 20:31:19 -07:00
Logan Smyth
61e3b1d314 Remove incorrect function/class check. 2016-06-16 20:31:19 -07:00
Logan Smyth
0be2f1cf48 Remove unnecessary ensureSemicolon. 2016-06-16 20:31:19 -07:00
Logan Smyth
67763085ab Be consistent with semicolons. 2016-06-16 20:31:19 -07:00
Logan Smyth
c1ba5e6ac8 Remove unused force param. 2016-06-16 20:31:19 -07:00
Logan Smyth
d042ddfdda Clarify that the code generator class is not public. 2016-06-16 20:31:19 -07:00
Logan Smyth
efea2c19f2 Add more tests for minified output. 2016-06-16 20:31:19 -07:00
Henry Zhu
4a262be436 more links [skip ci] 2016-06-11 12:50:39 -04:00
Logan Smyth
b05643c52f Changelog for 6.10.1. 2016-06-11 00:41:07 -07:00
Logan Smyth
e64aeb7316 v6.10.1 2016-06-11 00:36:09 -07:00
Logan Smyth
57328c1fbd Merge pull request #3526 from loganfsmyth/fix-switch-error
Fix an issue with the switch handing from PR #3490.
2016-06-11 00:32:37 -07:00
Logan Smyth
5ddce1372b Fix an issue with the switch handing from PR #3490. 2016-06-11 00:17:36 -07:00
Logan Smyth
a7801b1e52 Merge pull request #3525 from lxe/skip-shorthand
remove shorthand of --skip-initial-build
2016-06-11 00:16:51 -07:00
Aleksey Smolenchuk
2033c1da30 remove shorthand of --skip-initial-build
-s is already taken by --source-maps
2016-06-10 22:46:24 -07:00
Henry Zhu
8cb32e8cf1 Docs: 6.10.0 changelog [skip ci] (#3524) 2016-06-11 00:19:51 -04:00
Henry Zhu
c5ae951f98 v6.10.0 2016-06-11 00:05:21 -04:00
Henry Zhu
c113b0a7ec Merge pull request #3519 from koenkivits/patch-1
Fix broken links in monorepo.md
2016-06-11 00:00:49 -04:00
Henry Zhu
0dc1a69017 Merge pull request #3520 from babel/babylon-update
Support changes in flow parsing
2016-06-11 00:00:36 -04:00
Henry Zhu
b567c02413 generator tests 2016-06-10 18:05:54 -04:00
Henry Zhu
ff42a744df add back in identifier 2016-06-10 17:07:03 -04:00
Henry Zhu
63e8313788 add type def 2016-06-08 16:16:22 -04:00
Henry Zhu
ad0e1ba6de Support changes in flow parsing 2016-06-08 13:07:58 -04:00
Koen Kivits
867e07cee4 Fix broken links in monorepo.md 2016-06-08 17:45:34 +02:00
Sebastian McKenzie
ca6450b057 6.8.1 2016-06-06 19:21:21 +01:00
Kai Cataldo
dc525edf51 Clean up language/consistency in CONTRIBUTING.md (#3517) 2016-06-04 12:26:31 -04:00
Logan Smyth
61b3a6314b Merge pull request #3490 from jayphelps/T7324
create new lexical env inside switch statement blocks, fixes #T7324
2016-05-30 14:42:29 -07:00
Logan Smyth
85ec7834d0 Merge pull request #3489 from lxe/optinal-nocompile-watch
babel-cli: add --skip-initial-build option to only compile on changes when watching
2016-05-30 14:29:30 -07:00
Henry Zhu
8bbffb4bea Docs: 6.9.2 changelog [skip ci] 2016-05-29 19:19:12 -04:00
Henry Zhu
5b3db3aceb v6.9.2 2016-05-29 19:16:15 -04:00
Henry Zhu
e95ff9effb Fix: for babel-runtime, regenerator-runtime should be a dependency now (#3516) 2016-05-29 19:14:42 -04:00
Henry Zhu
77ac82b9f5 v6.9.1 2016-05-29 15:50:04 -04:00
Henry Zhu
d71072fe97 add changelog for babel-regenerator-runtime removal [ci skip] 2016-05-28 19:10:32 -04:00
Ben Newman
b3acf9100e Make babel-runtime use regenerator-runtime from npm. (#3494)
The source repository for regenerator-runtime can now be found at
https://github.com/facebook/regenerator/tree/master/packages/regenerator-runtime

This also removes the babel-regenerator-runtime package, now that the only
difference between it and regenerator-runtime has been resolved:
bc8d2d672c
2016-05-28 19:04:48 -04:00
Henry Zhu
3d6ae488be Docs: add 6.9.1 changelog [ci skip] (#3513) 2016-05-28 16:29:34 -04:00
Henry Zhu
cfbabe80bb Docs: add to getting started (#3512) [ci skip] 2016-05-28 10:18:11 -04:00
Andrew Johnston
f408f28a02 Fix: assign _this to this when there is no Superclass - Fixes T7364
Closes gh-3508
2016-05-28 09:51:28 -04:00
Lukas Eipert
8532bb8334 update license field with a valid SPDX expression (#3507) 2016-05-28 09:39:06 -04:00
Leonid Nikiforenko
822e8804d5 Make JSXText Immutable (#3510) 2016-05-25 23:30:29 -04:00
Aleksey Smolenchuk
4bf6f8ab18 cli: --skip-initial-build option to compile only on watched changes 2016-05-20 09:47:41 -07:00
Lukas Eipert
13c961d29d Adds repository field to babel-regenerator-runtime (#3506)
Similiar to #3370.

One of our licensing checking scripts throws warnings, as we expect npm dependencies to contain the repository field.
2016-05-20 11:41:48 -04:00
Jesse McCarthy
ff044bbb0f Use more ideal mocha hooks (#3446)
* setup() instead of manual before().
* suiteTeardown() instead of afterEach().
2016-05-19 08:26:59 -04:00
Henry Zhu
7594204777 typo [ci skip] 2016-05-17 14:54:12 -04:00
Henry Zhu
cf6304a34b v6.9.0 2016-05-17 14:49:17 -04:00
Henry Zhu
f7c6afe594 Docs: 6.9.0 changelog [skip ci] (#3505) 2016-05-17 11:38:48 -04:00
Sebastian McKenzie
1c48c4c9db Merge pull request #25 from gabelevi/default
Support defaults in Flow's type parameter declarations
2016-05-17 01:00:49 +01:00
Shuhei Kagawa
be9be86919 Add decorators to argument types (#3470) 2016-05-16 16:48:20 -04:00
Denis Pushkarev
16ad574e48 Update core-js to 2.4 (#3480) 2016-05-16 16:46:22 -04:00
Guy Bedford
40c4e7c2ea Modules systemjs system global name, use strict wrapping (#3482)
* modules systemjs system global name, use strict wrapping

* document systemGlobal option in readme
2016-05-16 16:46:06 -04:00
Alexander Kotliarskyi
8fa1174b32 Skip adding __source if it already exists (#3504) 2016-05-16 16:45:33 -04:00
dlwalsh
cdb465a834 remove repeating dependency from babel-traverse (#3501) 2016-05-16 09:54:37 -04:00
dlwalsh
9f8cd91605 Replace trim-right with _.trimEnd (#3502) 2016-05-16 09:53:48 -04:00
dlwalsh
829d4497c9 remove micro modules in favour of lodash functions (#3500) 2016-05-15 22:00:50 -04:00
Henry Zhu
52f56cbdc5 Add slack badge [skip ci] 2016-05-15 01:08:01 -04:00
Jhen-Jie Hong
2d7fb9af41 Class properties: Add path.ensureBlock for ArrowFunctionExpression (#3486)
* Class properties: Add path.ensureBlock for ArrowFunctionExpression

* Class properties: Add test case for non-block arrow function
2016-05-13 17:45:15 -04:00
Amjad Masad
109d99bb5e don't double count binding references (#3465)
When, for example, a function is moved between from one place to another we recrawl and end up double counting any references it holds to the upper scope. This protects against that. (The same thing is done for constant violations in the `reassign` method)
2016-05-13 17:20:32 -04:00
Jay Phelps
330071e59d also visit ClassProperty's for rest param deopt check, fixes #T7311 (#3481) 2016-05-13 17:18:14 -04:00
Jordan Klassen
dc1f40540d Upgrade to lodash 4 (#3315)
* Upgrade to lodash 4

* Fix incorrect require in babel-runtime/scripts

* Replace cloneDeep with cloneDeepWith where applicable
2016-05-13 17:15:14 -04:00
Yiyuan Bai
de56e12c68 Allow use react elements after yield statement 2016-05-12 18:41:41 +08:00
Henry Zhu
21c4b4d779 6.8.0 changelog (#27) 2016-05-04 10:05:58 -04:00
Henry Zhu
6ef4a731b7 6.8.0 2016-05-04 10:04:32 -04:00
Thomas Grainger
2607f35b9f Fix grammar in 6.8.0 CHANGELOG (#3498) 2016-05-04 08:00:57 -04:00
Henry Zhu
d4cd0bf7b7 Actually remove it.. 2016-05-02 22:44:50 -04:00
Henry Zhu
c81db57b03 Remove unused file
Ref f81c281fc4 (commitcomment-17331315)
2016-05-02 22:43:47 -04:00
Logan Smyth
9843c87573 Fix block statement code style. (#3493) 2016-05-02 21:15:37 -04:00
Henry Zhu
bf5de6bcb7 v6.8.1 2016-05-02 20:42:03 -04:00
Henry Zhu
8463dff9d9 Lazy-initialize babel-traverse to avoid circular dep. (#3497) 2016-05-02 20:40:05 -04:00
Henry Zhu
05bf216339 v6.8.0 2016-05-02 19:43:49 -04:00
Henry Zhu
2af299f5ce Docs: 6.8.0 changelog (#3496) 2016-05-02 19:25:16 -04:00
Henry Zhu
cafd15cdcf Merge pull request #3438 from hzoo/self-host-on-babel6
Self host on babel6
2016-05-01 20:03:04 -04:00
Henry Zhu
1b62be4c57 Travis: add node 6, remove iojs (#3484)
* Travis: add node 6

* remove iojs from travis [skip ci]
2016-05-01 15:22:33 -04:00
Logan Smyth
881ea85dd8 Merge pull request #3491 from rektide/babel-template-quasiquotes
docs: babel-template is an implementation of quasiquotes.
2016-04-30 14:20:13 -07:00
rektide
cfb911de91 babel-template is an implementation of quasiquotes.
LISP, Haskell, Scala, Scheme, Boo respect this term for a string literal of code being interpretted into AST. Babel should clearly identify that it too has quasi-quotes capabilities.
2016-04-30 17:08:08 -04:00
Jay Phelps
4166e5148e create new lexical env inside switch statement blocks, fixes #T7324 2016-04-29 23:54:41 -07:00
Gabe Levi
fe5193a40a Support defaults in Flow's type parameter declarations
The primary goal of this commit is to add the ability to parse type parameter
declarations with defaults, like `type Foo<T = string> = T`. While I was in the
code, I fixed a few small things, like

* Type parameter declarations need 1 or more type parameters.
* The existential type `*` is not a valid type parameter.
* The existential type `*` is a primary type
* The param list for type parameter declarations now consists of
  `TypeParameter` nodes
2016-04-27 16:12:10 -04:00
Henry Zhu
83efecdc8d check if we can revert gcc additions (#3483) 2016-04-26 17:55:35 -04:00
Henry Zhu
d657649031 Use local add-module-exports 2016-04-25 21:53:28 -04:00
Henry Zhu
ecd294b55e fix babel-traverse issues 2016-04-25 21:52:51 -04:00
Henry Zhu
373006f61b test loose mode 2016-04-25 21:52:51 -04:00
Henry Zhu
6f5e47eff0 Check if t.is is already defined (specifically accounting for the isImmutable method in validators 2016-04-24 20:06:23 -04:00
Henry Zhu
c9e5da6ad0 use named exports instead of export * as a temp workaround 2016-04-24 20:06:23 -04:00
Henry Zhu
4c23b01798 change plugins to use babel-runtime 6 2016-04-24 20:06:23 -04:00
Henry Zhu
10957a1093 Update dependencies on the top level to use babel 6 2016-04-24 20:05:34 -04:00
Logan Smyth
27bd5c6719 Merge pull request #3477 from mattkrick/patch-1
turn transform into a simple `for` loop
2016-04-24 16:47:31 -07:00
Olivier Tassinari
e2a2dd882f Docs: Update README.md (#3479)
`traverse` is imported but not used.
2016-04-24 18:38:13 -04:00
Daniel Tschinder
4bfececdad Fix leading comments added from previous node
This fixes an issue that comments were added as leading comments
to expressions, which are not immediately folowing the comment.
This was also reported and fixed in espree, and is basically a port to
babylon. eslint/espree#256

this also fixes an issue in babel-eslint with certain rules babel/babel-eslint#289
2016-04-23 12:24:20 +02:00
Matt Krick
caab035115 turn transform into a simple for loop 2016-04-22 16:53:10 -05:00
Logan Smyth
696c74933a v6.7.7 2016-04-20 20:09:20 -07:00
Logan Smyth
7372003fc2 Update CHANGELOG for v6.7.7. 2016-04-20 19:44:38 -07:00
Logan Smyth
f6be6e0bd4 Merge pull request #3463 from loganfsmyth/sourcemap-rework
Support more fine-grained source location tracking and use it for functions
2016-04-20 18:57:18 -07:00
Logan Smyth
09d6215835 Merge pull request #3475 from loganfsmyth/quick-perf-fixes
Code generator performance improvements
2016-04-20 18:56:57 -07:00
Logan Smyth
ca8556e36f Let function optimize better by using a boolean. 2016-04-19 19:36:11 -07:00
Logan Smyth
eb455dff85 Pre-expand type aliases for fast lookup. 2016-04-19 19:36:10 -07:00
Logan Smyth
dc92a16e7f Fast path for newline processing. 2016-04-19 18:59:32 -07:00
Logan Smyth
e7796b45c9 Add a fast path for checking for exact node types.
In my unscientific tests locally, this look the time for generating
200 files down from 11.8 to 8.3 seconds.
2016-04-19 18:59:15 -07:00
Logan Smyth
e7d37f342c Merge pull request #3457 from babel/T7272
Add test for T7272
2016-04-18 23:35:49 -07:00
Daniel Tschinder
91b818d486 Add Makefile that makes it able to test babel with current babylon 2016-04-17 22:16:15 +02:00
Logan Smyth
b311517fd3 Merge pull request #3422 from loganfsmyth/this-shadow-constructor
Initialize shadowed 'this' bindings in constructors after super - fixes T7191
2016-04-16 14:29:38 -07:00
Henry Zhu
ceaf4af714 Docs: add heading for writing tests [skip ci] 2016-04-16 14:48:11 -04:00
Henry Zhu
eb184d618b Clarify phabricator explaination [ci skip] 2016-04-16 14:03:57 -04:00
Henry Zhu
178fc539da Add a note about old github issue links 2016-04-14 08:03:46 -04:00
Henry Zhu
98685d21d7 Merge pull request #3464 from lydell/code-frame-tabs
babel-code-frame: Handle code with tabs
2016-04-11 13:42:37 -04:00
Simon Lydell
f80463120b babel-code-frame: Handle code with tabs
Previously, the `^` marker was misaligned if the line above contained tabs.

Fixes T7282.

Note: This commit handles a very subtle edge-case differently: When the passed
in column number is larger than the length of the line. Previously, the `^`
marker would be faithfully placed at that exact column number. Now, it is placed
at the end of the line instead (after the last character of the line to be
precise). Ideally, we should define what should happen in edge cases, but that's
out of scope for this PR.
2016-04-11 15:46:32 +02:00
Simon Lydell
580b09abb1 babel-code-frame: Add test for code with tabs 2016-04-11 15:44:31 +02:00
Logan Smyth
81e6d4147d Map the end of block statement nodes to the end of their original location - fixes T7258 2016-04-11 01:54:41 -07:00
Logan Smyth
76bb1dffaa Track sourcemap location on a stack - fixes T7255 2016-04-11 01:54:40 -07:00
Logan Smyth
7d6d4c204b Create a duplicate class identiier to avoid sharing 'loc'. 2016-04-10 21:18:33 -07:00
Daniel Tschinder
e6c11a0673 Fix support for flow optional parameters in arrow functions T7096
This overwrites the conditional handling in babylon for flow to support
optional parameters in arrow functions.
2016-04-10 13:06:48 +02:00
Logan Smyth
3cb9c90c31 Merge pull request #3459 from loganfsmyth/changelog-6.7.6
Update changelog for v6.7.6.
2016-04-08 09:31:35 -07:00
Logan Smyth
83301afb6e Update changelog for v6.7.6. 2016-04-08 09:30:44 -07:00
Logan Smyth
0130c6c186 v6.7.6 2016-04-08 09:27:12 -07:00
Logan Smyth
003e39c2a8 Merge pull request #3458 from loganfsmyth/revert-3433
Revert "Merge pull request #3433 from loganfsmyth/bail-out-rename"
2016-04-08 09:23:58 -07:00
Logan Smyth
c3ccddaaaf Revert "Merge pull request #3433 from loganfsmyth/bail-out-rename"
This reverts commit 2d0a007d14, reversing
changes made to e4d6d42041.
2016-04-08 09:09:48 -07:00
Henry Zhu
c24b0b043a Add test for T7272 2016-04-08 09:02:02 -04:00
Logan Smyth
b0d27142e8 Merge pull request #3455 from loganfsmyth/changelog-6.7.5
Update CHANGELOG for v6.7.5
2016-04-07 20:29:07 -07:00
Logan Smyth
89ecbda25c v6.7.5 2016-04-07 20:24:49 -07:00
Logan Smyth
bd06ce3678 Update CHANGELOG for v6.7.5 2016-04-07 20:09:57 -07:00
Logan Smyth
9cfb8cb172 Merge pull request #3451 from loganfsmyth/sourcemap-no-source
Handle input source mappings with no original location.
2016-04-07 20:06:11 -07:00
Logan Smyth
3af8ec16e9 Handle input source mappings with no source location - fixes T7151 2016-04-07 09:34:45 -07:00
Logan Smyth
d221e21102 Handle mappings with no source when using CLI file. 2016-04-07 09:34:43 -07:00
Logan Smyth
6ec9bbead4 Merge pull request #3421 from loganfsmyth/generate-default-exports
Wrap parens around default exports starting with function/class - fixes T7136
2016-04-06 22:02:52 -07:00
Logan Smyth
11e2e1b9b0 Merge pull request #3258 from trodrigues/patch-1
Documentation for babel-plugin-transform-runtime
2016-04-06 20:54:42 -07:00
Logan Smyth
2d0a007d14 Merge pull request #3433 from loganfsmyth/bail-out-rename
Only attempt to rename export declarations, not expressions - fixes T7215
2016-04-06 19:04:21 -07:00
Logan Smyth
e4d6d42041 Merge pull request #3447 from nkzawa/patch-0
Stop traversing when target type is found
2016-04-06 18:31:51 -07:00
Logan Smyth
4b4ffe587a Merge pull request #3448 from addaleax/pass-strings-to-path-xyzname
Make sure input to path.{dir,base}name is a string
2016-04-06 17:21:34 -07:00
Sebastian McKenzie
b926e401c6 Merge pull request #17 from zenparsing/master
Parse for-await statements when asyncGenerators plugin is active
2016-04-05 18:42:44 +01:00
Kevin Smith
f81c281fc4 Parse for-await statements when asyncGenerators plugin is active 2016-04-05 13:33:49 -04:00
Daniel Tschinder
bb6586d1e6 Enable deactivated tests, as it seems they work now 2016-04-04 18:22:10 +02:00
Daniel Tschinder
d15a2310cd Fix flow plugin when flow+arrow+spread used together
The fix includes creating a new method on the parser called `parseArrow`.
This new function by default only checks if current position matches an
arrow. If it does returns the `node` otherwise `undefined`.
The flow plugin can then extend this function and correctly parse the typeAnnotation
and add it to the node.

With this change, in the flow plugin there is no need anymore to extend
`parseParenAndDistinguishExpression` and the arrow handling in `parseParenItem`
could also be removed, because it is all handled now in `parseArrow`.

Some existing tests were failing, because `extra->parentesized` is now missing,
but this is correct as it is now inline with parsing without flow annotation. No extra
is added for arrow function without type annotations.

In the expression-parser `this.next()` was replaced by a more specific
`this.expect(tt.parenL)`.
2016-04-04 18:10:58 +02:00
Sebastian McKenzie
8b150813f5 Merge pull request #12 from shuhei/parameter-decorators
Parse parameter decorators
2016-03-28 22:14:15 +01:00
Anna Henningsen
bd99179abc Make sure input to path.{dir,base}name is a string
Since nodejs/node@08085c49b6, which will be part of Node.js v6.0,
functions from the `path` core module (like `dirname`) will require
their input to be a string.

Currently, at some points in the code they might be called
with `undefined`; This patch adds `… || ""` so that the input
is always a string.

For `path.dirname` in the babel-core file, this does not change
behaviour, since
`path.dirname(undefined) === path.dirname("") === "."` (where the
first expression is only defined for Node.js ≤ v5.x).

For `path.basename`, this changes the return value, since
`path.basename(undefined) === "undefined"` (on Node.js ≤ v5.x), but
`path.basename("") === ""`. However, it seems reasonable to assume
that, due to the trailing expression in
`path.basename(…) || "stdout"`, the current behaviour is not actually
the intended one.

There are possibly more places in the code base where similar changes
may be neccessary; However, these suffice to make the tests pass
and un-break the build of at least one external project when using
the current Node.js master branch.
2016-03-28 15:31:38 +02:00
nkzawa
85ecb6c97b stop traversing when target type is found 2016-03-28 03:01:06 +09:00
Henry Zhu
8fb6f878a3 Merge pull request #3441 from lydell/improve-babel-code-frame
Improve babel-code-frame. Kill the line-numbers dependency.
2016-03-25 13:06:00 -04:00
Henry Zhu
fd06f72c95 Merge pull request #3442 from loganfsmyth/remove-stale-check
Remove the NodePath validation check
2016-03-25 13:05:19 -04:00
Henry Zhu
e4be235e67 Merge pull request #3444 from drd/dont-mangle-jsxexpressioncontainer-stringliterals
Preserve whitespace in JSXExpressionContainer StringLiteral children
2016-03-25 13:04:10 -04:00
Shuhei Kagawa
29a6578658 parse parameter decorators 2016-03-25 14:04:33 +09:00
Eric O'Connell
aef82d190b Preserve whitespace in JSXExpressionContainer StringLiteral children - fixes T7243 2016-03-24 21:17:09 -07:00
Logan Smyth
bad2c768f2 Remove this check which will never pass with the new cache. 2016-03-23 20:57:18 -07:00
Simon Lydell
b733c6766a babel-code-frame: Add missing documentation.
I used the README for babel-generator as inspiration.
2016-03-23 19:06:45 +01:00
Simon Lydell
dceb988bbb babel-code-frame: Fix indentation 2016-03-23 19:00:53 +01:00
Simon Lydell
aaaffd32e7 babel-code-frame: Get rid of the line-numbers dependency. 2016-03-23 18:59:39 +01:00
Simon Lydell
d6b8e4c608 babel-code-frame: Add tests 2016-03-23 18:38:07 +01:00
Simon Lydell
6af4ba1937 babel-code-frame: Update type annotation
The code allows omitting the column number, but the type annotation for that
parameter didn't.
2016-03-23 17:13:07 +01:00
Henry Zhu
4c371132ae Merge pull request #3439 from loganfsmyth/changelog-6.7.4
Update CHANGELOG for 6.7.4
2016-03-22 23:48:42 -04:00
Logan Smyth
66a77fe9c1 Update CHANGELOG for 6.7.4 2016-03-22 20:44:05 -07:00
Logan Smyth
6470426f7a v6.7.4 2016-03-22 20:37:46 -07:00
Amjad Masad
a42d57ea81 Merge pull request #3430 from babel/dont-reuse-react
Don't reuse same node for React.createElement
2016-03-22 17:14:53 -07:00
Sebastian McKenzie
67de615bfc update babel-code-frame version 2016-03-22 22:14:36 +00:00
Sebastian McKenzie
09287643c7 remove line-numbers from babel-code-frame 2016-03-22 22:08:25 +00:00
Henry Zhu
971ab0e88e Merge pull request #3437 from babel/rm-flow-comments
Remove unused flow-comments plugin [skip ci]
2016-03-22 10:37:30 -04:00
Henry Zhu
12c78a890b Remove unused flow-comments plugin [skip ci]
- forgot to do this earlier
2016-03-22 10:37:05 -04:00
Henry Zhu
bbd37783be Merge pull request #3436 from babel/update-kcheck
update kcheck
2016-03-21 20:02:15 -04:00
Henry Zhu
77bc219548 update kcheck 2016-03-21 19:03:02 -04:00
Denis Pushkarev
8308f77cfe Merge pull request #3424 from babel/fix-t7206
Fix for T7206
2016-03-21 01:50:05 +06:00
Logan Smyth
078f6c0ed3 Only attempt to rename export declarations, not expressions - fixes T7215 2016-03-16 23:26:52 -07:00
Henry Zhu
3232c30f61 Merge pull request #3432 from simeonwillbanks/patch-1
Fix Misspelling
2016-03-17 01:24:07 -04:00
Logan Smyth
374b5d273a Merge pull request #3431 from loganfsmyth/build-debounce
Add a debounce delay so switching branches rebuilds.
2016-03-16 22:19:02 -07:00
Simeon Willbanks
93d438cf01 Fix misspelling 2016-03-16 22:17:09 -07:00
Logan Smyth
eb096b8290 Add a debounce delay so switching branches rebuilds. 2016-03-16 22:07:02 -07:00
Henry Zhu
459b1ffa1c Merge pull request #3420 from loganfsmyth/scope-cache-invalidation
Invalidate the scope cache if a node is moved to a different path - fixes T7194
2016-03-16 23:18:48 -04:00
Amjad Masad
7a2bae2de5 Merge pull request #3429 from babel/localize-test
Localize side-effectful test
2016-03-16 20:13:28 -07:00
Amjad Masad
bf600b0526 fix lint issue 2016-03-16 20:06:09 -07:00
Amjad Masad
3f4b88e638 Don't reuse same node for React.createElement
Is causing problems with path cache. See https://github.com/babel/babel/pull/3428
2016-03-16 18:14:16 -07:00
Amjad Masad
f6ff14624f localize side-effectful test 2016-03-16 18:13:40 -07:00
Henry Zhu
514d68770f Merge pull request #3419 from loganfsmyth/helper-requeue-T7199
Ensure that we push and pop evenly so things don't fail to queue - fixes T7199
2016-03-16 16:15:35 -04:00
Denis Pushkarev
ca46147734 dirty fix for T7206 for preventing runtime transform Object.defineProperty in the babel-polyfill entry point 2016-03-15 02:55:46 +06:00
Logan Smyth
661b2d9150 Merge pull request #3400 from callumlocke/patch-1
Add breakConfig option to babel's own babel config
2016-03-13 14:47:02 -07:00
Logan Smyth
e3af434250 Inserting shadowed 'this' bindings in constructors after super - fixes T7191 2016-03-12 16:18:56 -08:00
Logan Smyth
256c0100cb Wrap parens around default exports starting with function/class - fixes T7136 2016-03-12 15:31:16 -08:00
Logan Smyth
80aa424b75 Invalidate the scope cache if a node is moved to a different path - fixes T7194 2016-03-12 14:21:21 -08:00
Logan Smyth
b1c50b01f2 Ensure that we push and pop evenly so things don't fail to queue - fixes T7199 2016-03-12 12:30:33 -08:00
Amjad Masad
5373733b8d v6.7.3 2016-03-10 17:35:55 -08:00
Amjad Masad
5a9dd78b11 Merge pull request #3415 from babel/rework-warn
Rework logic that controls flowBinding warning
2016-03-10 17:11:46 -08:00
Amjad Masad
4abc03eef1 Rework logic that controls flowBinding warning
The flag to control whether we should warn didn't take into account
nested calls or scope chains. An easier approach is to have a
counter. That way we know for sure if we're somewhere deep inside a
crawl call or not.
2016-03-10 16:39:12 -08:00
Amjad Masad
3252761cce Update changelog with v6.7.2 2016-03-10 14:51:20 -08:00
Amjad Masad
de92d632f3 v6.7.2 2016-03-10 14:41:27 -08:00
Amjad Masad
9b229f1f08 Merge pull request #3414 from babel/flow-binding
Warn on Flow-based bindings and don't count as a const violation
2016-03-10 13:41:58 -08:00
Amjad Masad
5a081a8572 Update comment, reformat message 2016-03-10 13:00:45 -08:00
Amjad Masad
9f0dbf0234 Better warnings 2016-03-10 12:54:02 -08:00
Amjad Masad
7f4b57a7a4 Add warning instead of removing support 2016-03-10 12:35:15 -08:00
Amjad Masad
fd7b1c3386 don't rely on scope to get the type alias 2016-03-10 12:13:05 -08:00
Amjad Masad
342f9d5eb5 Don't consider flow types as bindings 2016-03-10 11:48:14 -08:00
Sebastian McKenzie
6b14e4cb91 Merge pull request #2 from babel/travis-badge
Add travis badge
2016-03-10 14:57:01 +00:00
Sebastian McKenzie
695109d505 t push
Merge branch 'master' of github.com:babel/babylon
2016-03-10 14:48:51 +00:00
Sebastian McKenzie
2115a28b40 add lodash to dev deps 2016-03-10 14:48:46 +00:00
Henry Zhu
e31dd18750 Add travis badge 2016-03-10 09:45:41 -05:00
Sebastian McKenzie
b75f175863 Merge pull request #1 from babel/hzoo-patch-1
don't ignore compiled files
2016-03-10 13:31:47 +00:00
Henry Zhu
a47286ba2b don't ignore compiled files 2016-03-10 08:28:33 -05:00
Sebastian McKenzie
986ac9950a Merge pull request #3413 from babel/remove-babylon
Remove babylon
2016-03-09 22:36:28 -08:00
Sebastian McKenzie
0a490ef294 Remove babylon 2016-03-10 06:25:26 +00:00
Sebastian McKenzie
64ff4c3561 first commit 2016-03-10 06:24:44 +00:00
Amjad Masad
7fb4133994 Merge pull request #3410 from babel/test-npmignore
add test to npmignores [ci skip]
2016-03-09 14:15:32 -08:00
Amjad Masad
a141bd9c1f Update changelog with v6.7 and v6.7.1 2016-03-09 14:12:38 -08:00
Amjad Masad
fedd8bd50e v6.7.1 2016-03-09 14:03:50 -08:00
Amjad Masad
facf6bc82f Merge pull request #3411 from babel/hotfix-7197
[hotfix T7197] Use scope.moveBindingTo
2016-03-09 14:00:01 -08:00
Amjad Masad
07d2c15e99 quotes 2016-03-09 13:34:06 -08:00
Amjad Masad
3dd80a6b14 Update updateScopeInfo method to use moveBindingTo 2016-03-09 13:28:45 -08:00
Amjad Masad
8b4b02a5fb [hotfix T7197] Use scope.moveBindingTo
I had deleted the binding and created a new one. I naively thought that
the analysis will automatically run again. But now discovered the method
I actually want to use: `scope.moveBindingTo` which moves the binding
and all the correct analysis. The only thing that was left to do is to
update `binding.kind` which I did manually.
2016-03-09 13:24:20 -08:00
Henry Zhu
0cc53dafc0 add test to npmignores [ci skip] 2016-03-08 22:33:23 -05:00
Amjad Masad
f8e33840b0 v6.7.0 2016-03-08 16:52:45 -08:00
Amjad Masad
3d5969ecff v6.7.0 2016-03-08 16:52:45 -08:00
Amjad Masad
bbdc308e92 Merge pull request #3409 from babel/sourcempa
Fix sourcemap generation for ES2015 modules
2016-03-08 16:42:36 -08:00
Amjad Masad
ad3d5bea44 Add more test cases 2016-03-08 15:28:29 -08:00
Amjad Masad
13dc2423f0 Fix auxiliary comment test 2016-03-08 13:59:34 -08:00
Amjad Masad
46ebd90acb Test and fix export statement sourcemap 2016-03-08 13:47:02 -08:00
Amjad Masad
108838c66c Copy source location to require statement for sourcemap generation 2016-03-08 13:38:24 -08:00
Logan Smyth
1da5cda3ab Merge pull request #3408 from loganfsmyth/expand-regression-tests
Expand the regression tests for T2765.
2016-03-08 08:34:04 -08:00
Logan Smyth
af4575c43e Expand the regression tests for T2765. 2016-03-08 08:15:42 -08:00
Amjad Masad
2f654650bb Merge pull request #3407 from babel/async-tests
Async context tests
2016-03-08 02:00:40 -08:00
Amjad Masad
b35013abe5 Merge pull request #3406 from babel/fix-scope-info
Update scope info after block-scoping transform
2016-03-08 00:57:18 -08:00
Amjad Masad
69773a45f4 Add more async context tests 2016-03-08 00:55:42 -08:00
Amjad Masad
57c6c4ea81 Add test for T2765 2016-03-08 00:47:18 -08:00
Amjad Masad
0200542e82 don't use Array.includes 2016-03-08 00:33:37 -08:00
Logan Smyth
bbc3401c71 Merge pull request #3405 from loganfsmyth/shadowing-fixes
Fix shadow function processing for async functions
2016-03-07 21:22:54 -08:00
Logan Smyth
de21f2ef77 Resolve 'arguments' for rest args relative to direct parent. 2016-03-07 20:45:21 -08:00
Logan Smyth
42d3844f24 Revert special arrow wrapper and avoid shadowing arguments. 2016-03-07 20:45:20 -08:00
Logan Smyth
51ddeade8a Avoid renaming this bindings in simple arrow function cases. 2016-03-07 20:45:20 -08:00
Logan Smyth
db3a43869c Remap across arrow function boundaries - fixes T7108 2016-03-07 20:45:19 -08:00
Logan Smyth
2e210927d8 Move the necessary exec transforms to the exec test. 2016-03-07 20:45:19 -08:00
Logan Smyth
836f398619 Re-use central inShadow logic. 2016-03-07 20:45:19 -08:00
Logan Smyth
8b8e3ddbec Flatten inShadow logic for readability. 2016-03-07 20:45:18 -08:00
Amjad Masad
891becffc1 Merge pull request #3363 from danez/patch-1
fix(babel-template): Fix Error in IE <= 9
2016-03-07 18:35:27 -08:00
Amjad Masad
3bebc3a7ca lint 2016-03-07 18:26:51 -08:00
Amjad Masad
77c7cc5363 Rework scope info updating in block-scoping transform
I previously tried an approach to scope bindings from var to scope but
it didn't catch all cases. This is evident in this bug:

https://phabricator.babeljs.io/T2892

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

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

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

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

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

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

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

Right now this is hacked in jankily, but in the next major release we
should stop using Identifier nodes for type parameters.
2016-03-06 14:44:09 -08:00
Sam Goldman
a38a58bad8 Add support for Flow def-site variance syntax
This syntax allows you to specify whether a type variable can appear in
a covariant or contravariant position, and is super useful for, say,
Promise.

Right now this is hacked in jankily, but in the next major release we
should stop using Identifier nodes for type parameters.
2016-03-06 14:44:09 -08:00
Henry Zhu
5eb13059e2 Merge pull request #3383 from babel/T7160
Regression with exporting an arrow function with a default param
2016-03-06 15:40:27 -05:00
Henry Zhu
6adbe96bf1 v6.6.5 2016-03-04 18:16:17 -05:00
Henry Zhu
57ef6a2b6a v6.6.5 2016-03-04 18:16:17 -05:00
Henry Zhu
d915508877 remove misc alias files 2016-03-04 17:58:49 -05:00
Henry Zhu
5cc2037b1b Merge pull request #3401 from babel/changelog-6.6.5
6.6.5 changelog [ci skip]
2016-03-04 17:55:55 -05:00
Henry Zhu
54cbefaa27 6.6.5 changelog [ci skip] 2016-03-04 17:47:26 -05:00
Henry Zhu
3689cae8e5 Merge pull request #3399 from babel/flow-comments
use flow instead of flow-comments
2016-03-04 16:24:28 -05:00
Henry Zhu
937b8a6767 use flow instead of flow-comments 2016-03-04 15:50:05 -05:00
Callum Locke
2870eaf669 Add breakConfig option to babel's own babel config 2016-03-04 12:56:57 +00:00
Amjad Masad
92ed05640c Merge pull request #3398 from babel/revert-rm-flow
Revert "Remove flow"
2016-03-03 16:07:24 -08:00
Amjad Masad
2d05996810 Merge pull request #3397 from babel/hzoo-patch-1
Make sure lib is clean before publishing
2016-03-03 15:22:54 -08:00
Amjad Masad
2f5a17fd90 fix eslint 2016-03-03 15:22:16 -08:00
Amjad Masad
aca8010438 Remove remaining @flow annotations 2016-03-03 15:10:59 -08:00
Amjad Masad
2fbe28cc88 Remove remaining @flow annotations 2016-03-03 15:10:59 -08:00
Amjad Masad
b5315d4b27 Revert "Remove Flow annotations and pragmas"
This reverts commit 4252244d06.
2016-03-03 15:03:55 -08:00
Amjad Masad
12ee11a0a4 Revert "Remove Flow annotations and pragmas"
This reverts commit 4252244d06.
2016-03-03 15:03:55 -08:00
Henry Zhu
b8b6bc0602 Make sure lib is clean before publishing 2016-03-03 17:50:51 -05:00
Amjad Masad
3667527d04 Revert "Remove flow"
This reverts commit 2827ff6b01.
2016-03-03 14:49:20 -08:00
Amjad Masad
9a180797c0 Revert "Remove flow"
This reverts commit 2827ff6b01.
2016-03-03 14:49:20 -08:00
Amjad Masad
b88182cacf Merge pull request #3396 from AgentME/afterCompute
Fix T7183: Object accessors after computed property were broken
2016-03-03 14:45:53 -08:00
Chris Cowan
cbae3c0e1d Fix T7183. 2016-03-03 12:15:11 -08:00
Chris Cowan
d864cde3c8 Add failing tests for T7183. 2016-03-03 12:12:14 -08:00
Logan Smyth
6ccd74a94e Merge pull request #3395 from loganfsmyth/object-rest-binding
Recognize object rest properties as binding identifiers - fixes T7178
2016-03-03 09:44:51 -08:00
Logan Smyth
305252d335 Recognize object rest properties as binding identifiers - fixes T7178 2016-03-03 08:58:22 -08:00
Amjad Masad
47782a6170 Merge pull request #3389 from babel/block-binding-actual
Update scope binding info after transforming block-scoped bindings
2016-03-02 18:51:26 -08:00
Amjad Masad
3744aefb4f Merge pull request #3391 from benjamn/fix-buildExportAll
Make buildExportAll generate pure ES5 code.
2016-03-02 18:50:47 -08:00
Henry Zhu
02a659a754 Merge pull request #3394 from babel/6.6.4-changelog
6.6.4 changelog [ci skip]
2016-03-02 16:49:19 -05:00
Henry Zhu
2aabefe812 6.6.4 changelog [ci skip] 2016-03-02 16:47:59 -05:00
Henry Zhu
5b7fa17cbe v6.6.4 2016-03-02 16:29:17 -05:00
Henry Zhu
39a8f5b796 v6.6.4 2016-03-02 16:29:17 -05:00
Henry Zhu
bca622abbc Merge pull request #3388 from AgentME/dupgetters
Partial T7173 Fix: Prevent accessors being seen as duplicates of each other
2016-03-02 16:22:57 -05:00
Henry Zhu
414efef7e3 Regression with exporting an arrow function with a default param 2016-03-02 09:49:43 -05:00
Henry Zhu
4d7b2b8066 Docs: fix mistakes in changelog [ci skip] 2016-03-02 09:44:32 -05:00
Henry Zhu
c70786b150 Merge pull request #3392 from samwgoldman/remove-more-flow
Remove flow
2016-03-02 08:54:25 -05:00
Sam Goldman
d6ee428857 Remove flow 2016-03-01 22:33:30 -08:00
Sam Goldman
2827ff6b01 Remove flow 2016-03-01 22:33:30 -08:00
Ben Newman
9acd33b93a Make buildExportAll generate pure ES5 code.
The untransformed `let` keyword causes problems for older parsers. I
understand using `let` instead of `var` ensures each getter function has
its own binding for the KEY variable, but the same can be accomplished
(with less code) using a `.forEach` callback function, and this way
there's no need to worry about generating a unique name for the `key`
variable.
2016-03-02 00:08:55 -05:00
Amjad Masad
f4197cc77b Merge pull request #3350 from skevy/fix-babelrc-plugin-resolution
Make Babel actually resolve plugins relative to where they were specified (via .babelrc).
2016-03-01 17:19:40 -08:00
Chris Cowan
63af3d1366 Fix issue where we didn't record seeing a property sometimes. 2016-03-01 17:13:20 -08:00
Amjad Masad
30bb38c4bb Update scope binding info after transforming block-scoped bindings
When convert a const, let or any other block-bound binding to a var we
forget to update the scope info. This confuses other transforms that may
come after this as to which scope does the binding belongs to.

This also uncovered an issue where duplicate block-scoped bindings were allowed
to co-exist.
2016-03-01 17:03:06 -08:00
Chris Cowan
3227279d95 Fix accessors being seen as duplicates of each other
If an object has a getter and setter of the same name, then they
shouldn't be treated as duplicate properties.
2016-03-01 16:30:48 -08:00
Henry Zhu
cc9430fd29 Add changelog for 6.6.1-6.6.3 [ci skip] 2016-03-01 17:50:26 -05:00
Henry Zhu
86284963f3 v6.6.3 2016-03-01 11:40:48 -05:00
Logan Smyth
58c6c1d2ab Merge pull request #3387 from loganfsmyth/context-queue-fix
Ensure that the found context is active before pushing it.
2016-03-01 08:28:49 -08:00
Logan Smyth
f2fea017c6 Ensure that the found context is active before pushing it. 2016-03-01 08:14:14 -08:00
Henry Zhu
b1477a3e8c v6.6.2 2016-03-01 09:08:35 -05:00
Henry Zhu
01f5b93978 Merge pull request #3386 from loganfsmyth/revert-requeue-change
Revert .requeue changes made in earlier ES3 fixes.
2016-03-01 08:54:19 -05:00
Logan Smyth
4561732bce Revert .requeue changes made in earlier ES3 fixes. 2016-02-29 23:55:47 -08:00
Henry Zhu
ddc82a848c Merge pull request #3384 from babel/build-dist
Run build-dist on publish so we do not forget
2016-02-29 23:06:00 -05:00
Henry Zhu
68c0a4b141 Run build-dist (will also run build) 2016-02-29 19:42:21 -05:00
Henry Zhu
68cdb2133d v6.6.1 2016-02-29 19:27:09 -05:00
Henry Zhu
188dbcb61c Update polyfill/runtime README 2016-02-29 19:24:07 -05:00
Henry Zhu
acfcd88fd9 Run build-dist on publish so we do not forget 2016-02-29 19:18:45 -05:00
Henry Zhu
b1058db7fb changelog: add missing entries [ci skip] 2016-02-29 16:51:57 -05:00
Henry Zhu
48e8db2247 v6.6.0 2016-02-29 16:12:12 -05:00
Henry Zhu
f34e6518ff v6.6.0 2016-02-29 16:12:12 -05:00
Henry Zhu
4b1d20004f Merge pull request #3382 from babel/6.6.0-changelog
Add 6.6.0 changelog
2016-02-29 16:06:24 -05:00
Henry Zhu
6b6447da2e we need a gif of course 2016-02-29 16:05:09 -05:00
Henry Zhu
c10291cb28 Add 6.6.0 changelog [ci skip] 2016-02-29 15:58:15 -05:00
Henry Zhu
7dad6ab4ed Merge pull request #3377 from babel/babel-5-opts-error
Give specific error messages for babel 5 options that were removed in…
2016-02-29 15:17:43 -05:00
Henry Zhu
0916e2d189 Give specific error messages for babel 5 options that were removed in babel 6 2016-02-29 14:34:46 -05:00
keijokapp
105299f26d Fix named FunctionExpression scoping issue. 2016-02-29 19:21:48 +02:00
Henry Zhu
1271d2cd52 Merge pull request #3380 from babel/unary-arrow
Fix: Add parens for unary arrow function
2016-02-29 12:18:12 -05:00
Henry Zhu
66ea5342de Merge pull request #3379 from babel/memexp-numliteral
Fix: invalid codegen for non decimal numeric literals in MemberExpression
2016-02-29 11:40:30 -05:00
Henry Zhu
3e4668dc14 Merge pull request #3366 from clayreimann/umd-plugin-add-global-name-override
[UMD] Fixed T6832
2016-02-29 09:45:10 -05:00
Clay Reimann
92946ccac3 [UMD] Fixed T6832 2016-02-29 08:23:35 -06:00
Henry Zhu
ec3c183668 Fix: Add parens for unary arrow function
Fixes T7157
2016-02-28 21:56:22 -05:00
Henry Zhu
35ed18f628 Fix invalid codegen for non decimal numeric literals in MemberExpression
Fixes T7156
2016-02-28 20:34:45 -05:00
Henry Zhu
6cb0fd8cc7 Merge pull request #3378 from samwgoldman/remove-flow
Remove Flow annotations and pragmas
2016-02-28 19:08:51 -05:00
Sam Goldman
5167d001c5 Remove @noflow as well 2016-02-28 13:25:36 -10:00
Sam Goldman
08249b29e4 Remove weird codemod artifact 2016-02-28 13:23:28 -10:00
Sam Goldman
cd1af74ecc Remove weird codemod artifact 2016-02-28 13:23:28 -10:00
Sam Goldman
085361ad1a Remove Flow annotations and pragmas 2016-02-28 13:18:57 -10:00
Sam Goldman
4252244d06 Remove Flow annotations and pragmas 2016-02-28 13:18:57 -10:00
Henry Zhu
6aff776124 Merge pull request #3280 from AgentME/dupkeys
Fix T2462, compile duplicate keys in objects to valid strict ES5
2016-02-27 23:16:20 -05:00
Chris Cowan
b2aecd4320 Fix arrow style issue 2016-02-26 08:57:34 -08:00
Chris Cowan
f01eaa8e47 Put transform-es2015-duplicate-keys plugin in es2015 preset. 2016-02-25 21:03:03 -08:00
Chris Cowan
4730526bf2 Add transform-es2015-duplicate-keys plugin. 2016-02-25 21:03:03 -08:00
Henry Zhu
b8cdd6e28c Merge pull request #3365 from jridgewell/replace-implicit-arrow-with-block
Replace arrow expression body with block statement
2016-02-25 22:02:31 -05:00
Henry Zhu
bf05b1b3bc Merge pull request #3368 from loganfsmyth/es3-transform-fixes
Fix the module plugin to properly requeue so the ES3 transforms can work
2016-02-25 21:57:23 -05:00
Jesse McCarthy
49e30f49bc Fix rest optimization errors. 2016-02-25 18:42:52 -05:00
Jesse McCarthy
8419be1afc Add postfix update expression fixtures.
(Failing.)
2016-02-25 17:11:19 -05:00
Jesse McCarthy
5f98d22b6d Add for-of fixture.
(Failing.)
2016-02-25 17:11:19 -05:00
Jesse McCarthy
1c304965e7 Add rest loop position optimization fixture.
(Failing.)

With destructuring assignment to an element.

This makes the function ineligible for `arguments` optimization, while
remaining eligible for loop position optimization.
2016-02-25 17:11:19 -05:00
Victor Felder
183fbab967 Fix some rest optimization errors.
Commit message edited by @jmm.
2016-02-25 17:11:19 -05:00
Jesse McCarthy
6ca07974c9 Add array destruct w/o [rest[0]] on RHS fixture.
(Failing.)
2016-02-25 17:11:19 -05:00
Jesse McCarthy
0be3a58dd2 Add expected fixtures for new actuals.
(Failing.)
2016-02-25 17:11:18 -05:00
Ben Newman
a82bf11e2a Add rest deoptimization fixtures.
(Failing.)

Commit message edited by @jmm.
2016-02-25 17:11:18 -05:00
Logan Smyth
a5ed818a55 Merge pull request #3370 from siroky/patch-1
Adds repository field to babel-plugin-transform-regenerator
2016-02-23 22:21:59 -08:00
Honza Široký
33d70df5b9 Adds repository field to babel-plugin-transform-regenerator 2016-02-24 01:07:33 +01:00
Henry Zhu
c43a154275 Merge pull request #3369 from tiemevanveen/patch-1
Docs: fix babel-plugin-transform-proto-to-assign readme url
2016-02-23 11:32:21 -05:00
Tieme van Veen
84a5d863b0 fix babel-plugin-transform-proto-to-assign readme url 2016-02-23 17:23:05 +01:00
Logan Smyth
0a0407be41 Re-queue remapped imports so they are re-traversed - fixes T6863 2016-02-22 22:54:28 -08:00
Logan Smyth
01003b954a Re-queue nodes inserted with .replaceWith and centralize logic - fixes T2817 2016-02-22 22:44:03 -08:00
Henry Zhu
54a064b970 Merge pull request #3362 from hzoo/err-babel-5-plugin
Show a better error when trying to use a babel 5 plugin
2016-02-22 19:40:52 -05:00
Logan Smyth
5f94206382 Merge pull request #3355 from loganfsmyth/babylon-browserifiable
Clean up babylon bundle to allow it to be re-bundled - fixes T6930
2016-02-22 08:50:06 -08:00
Logan Smyth
98c0c08808 Merge pull request #3355 from loganfsmyth/babylon-browserifiable
Clean up babylon bundle to allow it to be re-bundled - fixes T6930
2016-02-22 08:50:06 -08:00
Henry Zhu
ab7533ed6c Merge pull request #3358 from gzzhanghao/master
Fix generator with empty token list and force a newline for line comments in concise mode
2016-02-20 22:33:20 -05:00
Justin Ridgewell
de1431e8c6 Replace arrow expression body with block statement
Original PR: https://github.com/babel/babel/pull/2469. Seems this got
lost in the v6 changes.

- - -

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

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

// New
ArrowFunctionExpression: function() {
  this.get("body").replaceWith(t.blockStatement(...));
}
```
2016-02-20 04:36:40 -05:00
Jesse McCarthy
3b8c5b7620 Merge pull request #3249 from jmm/rest-assign-el
Fix assignment to rest param element AST error.

Fix T6932.
2016-02-19 08:47:17 -05:00
Daniel Tschinder
ec5d83f95d fix(babel-template): Fix Error in IE <= 9
In IE <= 9 Error.prototype.stack does not exist.
2016-02-18 14:03:14 +01:00
Henry Zhu
6425c47537 Show a better error when trying to use a babel 5 plugin 2016-02-17 20:31:49 -05:00
Henry Zhu
26a3fdc3df Merge pull request #3336 from erikdesjardins/async-arrow-rest
Fix T3077 (incorrect _arguments for async arrow functions with rest params)
2016-02-17 15:26:58 -05:00
Sebastian McKenzie
523dfb1387 update kcheck 2016-02-17 05:34:41 +00:00
Sebastian McKenzie
13d1eabcab bump kcheck version 2016-02-17 05:29:14 +00:00
Sebastian McKenzie
e9f19e1097 remove npm3 kcheck hack 2016-02-17 05:22:53 +00:00
Sebastian McKenzie
6b4f2dfc19 clear node_modules, fix travis ci 2016-02-17 05:08:43 +00:00
Jason
28ca3f7f3a [generator] bug fix
- Fix Whitespace with empty token list
- Force a newline for line comments in concise mode
2016-02-17 13:01:54 +08:00
Sebastian McKenzie
4c6c80a3ab install npm 3 on all travis builds 2016-02-17 04:59:02 +00:00
Logan Smyth
39c9066e40 Merge pull request #3359 from loganfsmyth/context-queueing-order
Queue regeneratorRuntime so it is transformed before Program#exit
2016-02-15 21:23:45 -08:00
Denis Pushkarev
e6e0171db3 [core-js] temporary disable features, which can break "old runtime and new transform-runtime" case 2016-02-16 00:30:54 +06:00
Sebastian McKenzie
9bd15508a2 suppress final lint error? 2016-02-15 00:20:19 +00:00
Sebastian McKenzie
c55794596e remove flowconfig 2016-02-15 00:10:58 +00:00
Sebastian McKenzie
d1e02e773f remove flow-bin 2016-02-15 00:06:40 +00:00
Sebastian McKenzie
224bbd0fb9 remove version in flowconfig 2016-02-15 00:06:18 +00:00
Sebastian McKenzie
d1f7eab060 noflow one more file 2016-02-15 00:00:44 +00:00
Sebastian McKenzie
b5bcd64120 noflow some files 2016-02-14 23:58:37 +00:00
Sebastian McKenzie
7116816624 klint -> kcheck 2016-02-14 23:53:10 +00:00
Sebastian McKenzie
54e24b6a6c Update Makefile to use klint 2016-02-14 23:28:28 +00:00
Sebastian McKenzie
31f3eba4c1 Merge pull request #3361 from babel/klint
Switch to klint, fix some lint rules
2016-02-14 23:26:30 +00:00
Sebastian McKenzie
93e5c0e64b Merge pull request #3361 from babel/klint
Switch to klint, fix some lint rules
2016-02-14 23:26:30 +00:00
Sebastian McKenzie
c9f9435445 Switch to klint, fix some lint rules 2016-02-14 23:25:14 +00:00
Sebastian McKenzie
5b89849f43 Switch to klint, fix some lint rules 2016-02-14 23:25:14 +00:00
Sebastian McKenzie
a1b8a765f7 Merge pull request #3340 from zloirock/update-core-js
update core-js
2016-02-14 23:13:48 +00:00
Henry Zhu
ef6b54c1d9 Merge pull request #3356 from loganfsmyth/operator-parse-error
Properly fail to parse >== and <== - fixes T2921
2016-02-14 16:15:31 -05:00
Logan Smyth
96a6d9f92e Queue regeneratorRuntime so it is transformed before Program#exit - fixes T7041 2016-02-13 22:56:03 -08:00
Henry Zhu
456d24630a Merge pull request #3357 from forivall/typo-1
Fix typo: sorucemap -> sourcemap
2016-02-13 16:08:30 -05:00
Jordan Klassen
89b20c6562 Fix typo: sorucemap -> sourcemap 2016-02-13 12:35:45 -08:00
Logan Smyth
40e5f505f4 Properly fail to parse >== and <== - fixes T2921 2016-02-13 10:08:05 -08:00
Logan Smyth
ce1423d560 Properly fail to parse >== and <== - fixes T2921 2016-02-13 10:08:05 -08:00
Logan Smyth
19de6dea3d Clean up babylon bundle to allow it to be re-bundled - fixes T6930 2016-02-12 22:48:00 -08:00
Logan Smyth
9e383b09b9 Clean up babylon bundle to allow it to be re-bundled - fixes T6930 2016-02-12 22:48:00 -08:00
Amjad Masad
e0a7271ace Merge pull request #3346 from schmod/T7091
rename scope bindings during block scope transform
2016-02-12 12:12:39 -08:00
Henry Zhu
2d96a52ad2 Merge pull request #3353 from babel/changelog
6.5.2 changelog
2016-02-12 11:52:34 -05:00
Henry Zhu
97a4434663 6.5.2 changelog 2016-02-12 11:51:53 -05:00
Henry Zhu
13cb34a966 v6.5.2 2016-02-12 11:29:58 -05:00
Henry Zhu
b1bb39e733 v6.5.2 2016-02-12 11:29:58 -05:00
Erik Desjardins
a3bca783dd Transformed generators for async function expressions should not be shadow functions 2016-02-12 11:25:11 -05:00
Henry Zhu
5d98f3a401 Merge pull request #3342 from rstacruz/patch-1
babel-register: update README.md
2016-02-12 10:59:22 -05:00
Henry Zhu
971545000a Merge pull request #3345 from babel/readme-with-options
Docs: update plugin readmes with options
2016-02-12 10:58:04 -05:00
Logan Smyth
e9423e82bc Merge pull request #3348 from loganfsmyth/fix-option-loading
Merge config options into list after babelrc options - fixes T7079
2016-02-12 08:44:59 -07:00
Henry Zhu
7ad94765f0 Merge pull request #3352 from pra85/patch-2
Docs: Fix a typo
2016-02-12 08:54:25 -05:00
Prayag Verma
b3d270ed9b Fix a typo
`setttings` → `settings`
2016-02-12 17:24:25 +05:30
Sebastian McKenzie
637fdc6fd3 Merge pull request #3344 from babel/remove-0.10ci
Travis: Remove 0.10, since it's covered by Circle
2016-02-12 07:01:28 +00:00
Henry Zhu
a1c11e6046 Merge pull request #3351 from hzoo/asi-generator
Add class properties test with a generator method that results in a p…
2016-02-11 13:17:43 -05:00
Henry Zhu
2e73358fcc Add class properties test with a generator method that results in a parse error 2016-02-11 13:03:36 -05:00
Henry Zhu
8568198238 Add class properties test with a generator method that results in a parse error 2016-02-11 13:03:36 -05:00
Adam Miskiewicz
c1960dbe02 Make Babel resolve plugins relative to where they were specified.
Given the following `.babelrc`:

```
{
  "plugins": ["./myPluginDir/somePlugin.js"]
}
```

Babel should resolve that plugin relative to the directory that contains the `.babelrc` file.

Currently, Babel is resolving the plugin relative to the current `process.cwd()`, as you can see in this test case: https://github.com/skevy/babel-plugin-resolution-test-case

This is occurring because the "fake" `Module` that we're creating in the `resolve` helper doesn't have an `id` and `filename`. Therefore, Node builds an array of paths that contains a number of node_module paths as well as `.`, and doesn't contain the path in which we'd actually like to look up the plugin. `.` of course resolves to the current `process.cwd()`, and thus makes the Babel plugin resolution mechanism quite fragile. The relevant code in Node.JS can be found here (tagged at the v5.4.1 release): ff99203724/lib/module.js (L236-L242).

This PR adds `id` and `filename` to that fake `Module` in order to resolve this issue.
2016-02-11 11:13:57 -05:00
Logan Smyth
ff2bf2642b Merge pull request #3326 from eetulatja/master
Fix spread to work with super method calls
2016-02-10 22:49:02 -07:00
Logan Smyth
b53864c569 Merge pull request #3334 from loganfsmyth/bind-callee-ref
Check BindExpression callee for reference - fixes T6984
2016-02-10 22:42:50 -07:00
Logan Smyth
88a67773e6 Merge pull request #3332 from loganfsmyth/revert-prop-semi
Revert to standard ASI behavior for class properties
2016-02-10 22:40:44 -07:00
Logan Smyth
18fd06cf4a Merge pull request #3332 from loganfsmyth/revert-prop-semi
Revert to standard ASI behavior for class properties
2016-02-10 22:40:44 -07:00
Logan Smyth
8c910d6a4c Merge config options into list after babelrc options - fixes T7079 2016-02-10 21:18:27 -08:00
Henry Zhu
5a271b091a Docs: update plugin readmes with options [ci skip] 2016-02-10 18:12:58 -05:00
Andrew Schmadel
307d5c5a0d rename scope bindings during block scope transform 2016-02-10 11:44:16 -05:00
Henry Zhu
d3310fb5ea Travis: Remove 0.10, since it's covered by Circle 2016-02-09 23:27:00 -05:00
Henry Zhu
77a36633be Merge pull request #3343 from ntwb/patch-1
Travis CI: Switch from deprecated `stable` NodeJS to latest 4.x.x & 5.x.x
2016-02-09 23:20:59 -05:00
Stephen Edgar
606c8d05fd Travis CI: Switch from deprecated stable NodeJS to latest 4.x.x & 5.x.x
• `stable` is deprecated, see https://github.com/creationix/nvm#usage
• Switch from `4.0` to `4` to use the latest v4.x.x LTS branch
• Switch from `stable` to `5` to use the latest v5.x.x "stable" branch
2016-02-10 14:13:21 +11:00
Erik
27a132a9cb Add test for T3077 (Incorrect rest operator behavior for async arrow functions) 2016-02-09 13:13:28 -05:00
Rico Sta. Cruz
5a312e69be babel-register: update README.md 2016-02-09 18:48:25 +08:00
Denis Pushkarev
e50be68400 add special case for legacy modules to the runtime build script 2016-02-09 15:28:17 +06:00
Henry Zhu
afce6253bc Merge pull request #3341 from chicoxyzzy/unnecessary-dep
bin-version-check is unnecessary now
2016-02-08 20:41:12 -05:00
chico
fae5b7a728 bin-version-check is unnecessary now 2016-02-09 04:32:53 +03:00
Denis Pushkarev
79214b3b05 update core-js 2016-02-09 07:31:02 +06:00
Henry Zhu
612e11e615 Merge pull request #3339 from babel/shell-scripts
Know how to write good shell scripts
2016-02-08 20:27:31 -05:00
Henry Zhu
7bcfa02edd Know how to write good shell scripts 2016-02-08 19:59:34 -05:00
Henry Zhu
c7f8e0c5b8 Merge pull request #3337 from loganfsmyth/no-prefer-global
Don't preferGlobal on the `babel` package.
2016-02-08 11:45:32 -05:00
Logan Smyth
2f0c646364 Don't preferGlobal on the babel package. 2016-02-08 08:33:23 -08:00
Henry Zhu
851ed6e6a5 clarify that passPerPreset is experimental 2016-02-08 10:39:30 -05:00
Sebastian McKenzie
7507f5ffb5 Update CHANGELOG.md 2016-02-08 02:40:41 +00:00
Sebastian McKenzie
a0fdb77413 v6.5.1 2016-02-08 02:18:10 +00:00
Sebastian McKenzie
bc2f84f371 Fix API change that e7187faea6 introduced that wasn't changed in babel-register. Also use an object rather than a long ass list of arguments. 2016-02-08 02:17:09 +00:00
Amjad Masad
ba40f6979b Merge pull request #3333 from loganfsmyth/improve-cli-error
Improve the error messaging for using the wrong CLI script.
2016-02-07 14:37:15 -08:00
Henry Zhu
04137d363f Merge pull request #3328 from babel/tests-docs
Docs: update CONTRIBUTING to include some information on how tests wo…
2016-02-07 17:27:58 -05:00
Henry Zhu
8191681dfa Merge pull request #3325 from babel/npm3
Add note about developing with npm 3.
2016-02-07 09:27:49 -05:00
Henry Zhu
24c759a229 Merge pull request #3329 from loganfsmyth/export-specifier-validator
Fix export specifier validator.
2016-02-07 09:27:09 -05:00
Logan Smyth
abd39d688e Add tests for class property ASI. 2016-02-06 23:01:38 -08:00
Logan Smyth
c67905ac93 Add tests for class property ASI. 2016-02-06 23:01:38 -08:00
Logan Smyth
b13be640fa Check BindExpression callee for reference - fixes T6984 2016-02-06 22:17:46 -08:00
Henry Zhu
f3fca16838 Merge pull request #3330 from loganfsmyth/recommend-nonglobal
Remove global install recommendation.
2016-02-06 22:19:41 -05:00
Logan Smyth
256cb18656 Improve the error messaging for using the wrong CLI script. 2016-02-06 19:09:14 -08:00
Logan Smyth
0c35bbfc07 Revert "babylon: throw parse error if class properties do not have a semicolon (fixes T6873)"
This reverts commit 976edfc067.
2016-02-06 18:36:31 -08:00
Logan Smyth
63b328ce87 Revert "babylon: throw parse error if class properties do not have a semicolon (fixes T6873)"
This reverts commit 976edfc067.
2016-02-06 18:36:31 -08:00
Logan Smyth
d9ade8a63a Revert "babylon: fix error location for class properties with a missing semicolon"
This reverts commit f31099f383.
2016-02-06 18:36:22 -08:00
Logan Smyth
89ae1dc258 Revert "babylon: fix error location for class properties with a missing semicolon"
This reverts commit f31099f383.
2016-02-06 18:36:22 -08:00
Henry Zhu
8d241c9c40 v6.5.0 2016-02-06 19:06:41 -05:00
Henry Zhu
f9f8ad6eff v6.5.0 2016-02-06 19:06:41 -05:00
Logan Smyth
50e9016002 Remove global install recommendation. 2016-02-06 13:53:42 -08:00
Logan Smyth
ccf3875a67 Fix export specifier validator. 2016-02-06 13:49:34 -08:00
Henry Zhu
eb7d697957 remove unnecessary stuff, add more links 2016-02-06 16:04:02 -05:00
Henry Zhu
773dcbc5d5 Docs: update CONTRIBUTING to include some information on how tests work in plugins 2016-02-06 16:01:22 -05:00
Eetu Latja
9d5184ffb2 Fix spread to work with super method calls 2016-02-06 19:31:42 +02:00
Henry Zhu
cee7619f73 Add note about developing with npm 3. 2016-02-06 10:06:56 -05:00
Henry Zhu
31404b9bdc Merge pull request #3302 from babel/6.5.0-changelog
add 6.5.0 changelog
2016-02-05 17:21:20 -05:00
Henry Zhu
6b751a53da Add 6.5.0 changelog [ci skip] 2016-02-05 17:18:30 -05:00
Amjad Masad
024cba6433 Merge pull request #3305 from jviereck/T7052
Fix: Arrow functions with trailing comma + return type are throwing an error when parsing
2016-02-05 13:50:57 -08:00
Amjad Masad
e24be1a051 Merge pull request #3305 from jviereck/T7052
Fix: Arrow functions with trailing comma + return type are throwing an error when parsing
2016-02-05 13:50:57 -08:00
Henry Zhu
4e619db873 Merge pull request #3324 from zjmiller/master
Parenthize "in" in for-loop init, even when init has nested for-loop
2016-02-05 15:50:11 -05:00
Henry Zhu
a757e26005 Merge pull request #3312 from erikdesjardins/hoist-async
Fix T6882 (async functions are not hoisted)
2016-02-05 15:32:26 -05:00
Zachary Miller
33b4ef5d52 Parenthize "in" in for-loop init, even when init has nested for-loop 2016-02-05 14:28:01 -06:00
Henry Zhu
1eb8b9dff2 Merge pull request #3319 from jeffmo/flow_leading_pipes
Add support for leading pipes in Flow type alias RHS syntax
2016-02-05 13:53:07 -05:00
Jeff Morrison
acc946c09e Add support for leading pipes in Flow type alias RHS syntax 2016-02-05 13:23:55 -05:00
Jeff Morrison
e6951e99f0 Add support for leading pipes in Flow type alias RHS syntax 2016-02-05 13:23:55 -05:00
Henry Zhu
98fa405b91 Merge pull request #3322 from babel/update-gcc
Update gcc for compiling modules in node 4/5
2016-02-04 20:41:23 -05:00
Henry Zhu
a24a61c6c7 Update gcc for compiling modules in node 4/5 2016-02-04 18:52:23 -05:00
Henry Zhu
fff27b458f Internal: actually fail/exit when flow fails 2016-02-04 18:47:00 -05:00
Henry Zhu
526151c580 Merge pull request #3321 from babel/babylon-test
Docs: add information on writing tests in babylon
2016-02-04 17:57:18 -05:00
Henry Zhu
12f286143e Docs: add information on writing tests in babylon 2016-02-04 17:42:25 -05:00
Amjad Masad
bcc32da0d9 Merge pull request #3316 from forivall/babel-generator-simplify-node
Simplify babel-generator/node/index.js
2016-02-04 14:10:16 -08:00
Henry Zhu
f8036c7230 Merge pull request #3311 from babel/object-body
[T7047] Consider arrow functions when parenthesizing object expressions
2016-02-04 14:44:22 -05:00
Henry Zhu
807e190728 Merge pull request #3186 from hzoo/add-some-flow
add some more flow types
2016-02-04 11:10:02 -05:00
Henry Zhu
f59faeeeaa only run flow check in CI if npm 3 2016-02-04 11:07:05 -05:00
Henry Zhu
3522148255 update babel-eslint and eslint 2016-02-04 11:07:04 -05:00
Henry Zhu
e998e53466 run generate-iterfaces 2016-02-04 11:07:04 -05:00
Henry Zhu
5f0ece0bdb add some more flow types 2016-02-04 11:07:03 -05:00
Henry Zhu
c2d7e95e1a add some more flow types 2016-02-04 11:07:03 -05:00
Henry Zhu
7d2ec4aa7f Merge pull request #3318 from babel/test-3303
make a test for #3303
2016-02-04 10:56:44 -05:00
Henry Zhu
9182fcd71b make a test for #3303 2016-02-04 10:54:14 -05:00
Henry Zhu
26cd517932 Merge pull request #3303 from BlackGlory/patch-1
Throw a TypeError when falsy value found in plugins
2016-02-04 10:50:38 -05:00
Sebastian McKenzie
effaf820c3 Merge pull request #3317 from babel/add-make-build
make publish: add make build in case it wasn't run
2016-02-04 15:17:00 +00:00
Henry Zhu
9f5314ad42 make publish: add make build in case it wasn't run 2016-02-04 09:58:57 -05:00
Jordan Klassen
8fd329a2f4 Remove "Node" class from generator, just use module
The Node class was unused as a class
2016-02-03 16:51:10 -08:00
Amjad Masad
6bb7eb0c78 Merge pull request #3300 from gzzhanghao/gen-fix
Fix generators with default args
2016-02-03 15:46:39 -08:00
Sebastian McKenzie
f08ce440ab Merge pull request #3314 from guybedford/template-source-maps
PR for T6903 - fixing System source maps
2016-02-03 23:45:41 +00:00
guybedford
5a0d5dc500 babel-template clearNode fix to not remove existing sourceMaps (T6903) 2016-02-04 01:31:18 +02:00
Sebastian McKenzie
19591b709f Merge pull request #3313 from babel/analyse-api
Add babel.analyze
2016-02-03 22:01:39 +00:00
Sebastian McKenzie
35e8250b57 add a top level analyze method for path marking sugar 2016-02-03 21:29:47 +00:00
Henry Zhu
6b76402791 Merge pull request #3301 from jmm/ast-updates
Update AST spec
2016-02-03 15:53:13 -05:00
Henry Zhu
e1867f75e2 Merge pull request #3304 from jamestalmage/fix-T7046
[babel-template][T7046]: Add optional babylon options argument.
2016-02-03 14:26:56 -05:00
Erik Desjardins
84af53d356 Async function will be hoisted above some imports
...but it's still below `exports.foo = undefined;`, so the test is intact
2016-02-03 12:11:14 -05:00
Erik Desjardins
4142003bbd Hoist initial exports.foo = undefined and __esModule declarations above hoisted async functions 2016-02-03 12:11:11 -05:00
Erik
e759b5f835 Add exec test for T6882 (async function hoisting) 2016-02-03 12:11:08 -05:00
Jason
523a9d1d00 [traverse] nit 2016-02-03 17:46:34 +08:00
Tiago Rodrigues
61bf94afdb Fix bad link due to copypaste failure 2016-02-03 10:07:55 +01:00
Erik
ec61bd9386 Revert "Don't mark async functions as hoist"
This reverts commit d34cb69912.
2016-02-02 22:13:26 -05:00
Amjad Masad
7428654c19 Merge pull request #3290 from AgentME/exportAsyncTest
Add test for T3026
2016-02-02 16:55:58 -08:00
Amjad Masad
430607fc1d Merge pull request #3298 from babel/hzoo-T7010
Set NOT_LOCAL_BINDING on all inferred function names
2016-02-02 16:46:35 -08:00
Amjad Masad
9aac73e70b Merge pull request #3299 from robcolburn/multibyte-test
Ensure that we do not break mutli-byte handling
2016-02-02 16:45:50 -08:00
Amjad Masad
aa9dafe05f Merge pull request #3307 from josh/cli-optional-chokidar-dev
babel-cli: Make chokidar dependency optional
2016-02-02 16:45:02 -08:00
Amjad Masad
3d3b30eb45 [T7047]Consider arrow functions when parenthesizing object expressions 2016-02-02 16:26:31 -08:00
Tiago Rodrigues
597d895cf3 Documentation for babel-plugin-transform-runtime
Based on 862b43db93/docs/usage/runtime.md

Related to https://github.com/babel/babel.github.io/issues/674 and https://github.com/babel/babel.github.io/issues/491
2016-02-02 16:36:30 +01:00
Joshua Peek
005c4cb7a8 Show specific error message when chokidar can't be loaded 2016-02-01 19:24:08 -08:00
Henry Zhu
82bab2847b Merge pull request #3308 from sappharx/patch-1
Update compiler-environment-support.md
2016-02-01 21:01:31 -05:00
Vincent Sisk
b8129d8ddf Update compiler-environment-support.md 2016-02-01 18:50:58 -07:00
Joshua Peek
f81d9e1274 Mark chokidar as optional dependency 2016-02-01 17:03:37 -08:00
Joshua Peek
0878685a5a Defer requiring chokidar dependency until --watch flag is passed 2016-02-01 17:03:13 -08:00
Julian Viereck
a121d1b7b5 Fix and tests 2016-01-31 01:22:31 +01:00
Julian Viereck
624a811885 Fix and tests 2016-01-31 01:22:31 +01:00
James Kyle
13129568ca Merge pull request #3168 from CrocoDillon/babelrc-option
Use the babelrc option in babel-register
2016-01-30 12:51:06 -08:00
CrocoDillon
1ba81153a7 Use this.options.babelrc instead of opts.babelrc 2016-01-30 12:11:33 -05:00
CrocoDillon
f4093a552f Use the babelrc option in babel-register
Which can be used to ignore `.babelrc` files by setting this to false, currently ignored in babel-register.
2016-01-30 12:09:49 -05:00
Henry Zhu
190105627f Add link to lerna in monorepo.md 2016-01-30 10:11:28 -05:00
James Talmage
79f783cdf5 [babel-template][T7046]: Add optional babylon options argument. 2016-01-28 21:35:20 -05:00
BlackGlory
6ca20c5540 Throw a TypeError when falsy value found in plugins 2016-01-24 14:38:46 +08:00
Jesse McCarthy
07f0bd4ea9 Update AST spec.
* Remove redundant `Node` reference from `Identifier` interface.
  `Expression` already inherits from `Node`.

* Add missing interfaces: `Literal`, `Pattern`.
2016-01-23 10:57:42 -05:00
Jason
35463a46b6 Use exec style test in transform-regenerator 2016-01-23 23:30:52 +08:00
Jason
bbdd4aaf21 Ignore isolated paths when traversing 2016-01-23 18:39:14 +08:00
Amjad Masad
12b7a44796 Merge pull request #3281 from DmitrySoshnikov/pass_per_preset
[RFC] Pass per preset
2016-01-22 14:29:07 -08:00
Amjad Masad
5699403835 Add comment clarifying the optimization 2016-01-22 14:24:45 -08:00
Amjad Masad
7d719d9ce9 Merge pull request #3283 from gzzhanghao/gen-perf
Improve generator performance
2016-01-22 14:22:48 -08:00
Amjad Masad
35bb62c2e5 Merge pull request #3285 from frantic/hoist-file-name
Hoist current file name for transform-react-jsx-source
2016-01-22 14:21:20 -08:00
Amjad Masad
4f82506711 Merge pull request #3294 from babel/with-body
WithStatements can have statements as bodies
2016-01-22 14:18:10 -08:00
Amjad Masad
c1a7fc93d0 Move setting NOT_LOCAL_BINDING to the function name helper 2016-01-22 14:07:57 -08:00
Sebastian McKenzie
6c66694a73 Merge pull request #3293 from babel/hzoo-patch-1
update spec decorator property
2016-01-22 20:55:58 +00:00
Rob Colburn
7b1b876dc2 Ensure that we do not break mutli-byte handling 2016-01-22 12:13:18 -08:00
Henry Zhu
da106e2bf4 check for nested id 2016-01-22 14:42:07 -05:00
Henry Zhu
ad81f5b149 check if valid.id is defined 2016-01-22 14:20:54 -05:00
Sebastian McKenzie
16f8fd5c83 Merge pull request #3295 from babel/hzoo-patch-2
ast/spec: add BindExpression
2016-01-22 10:31:18 +00:00
Sebastian McKenzie
12ddcc7def Merge pull request #3297 from horpto/hotfix/T2765_72428
[hotfix][T2765#72428] Wrong  'this'  for nested arrow in arrow function
2016-01-22 10:31:04 +00:00
Alex Kotliarskyi
ca1c4bba86 Fix naming (s/node/path/g) 2016-01-21 22:45:10 -08:00
horpto
d0a932d0e8 [hotfix][T2765#72428] Wrong 'this' for nested arrow in arrow function 2016-01-22 10:29:04 +05:00
Dmitry Soshnikov
845a4fa557 Pass per preset: Use full function systax in test for old Node versions 2016-01-21 15:14:42 -08:00
Dmitry Soshnikov
e2486b5f71 Pass per preset: added unit test 2016-01-21 14:54:40 -08:00
Henry Zhu
e1da431453 ast/spec: add BindExpression 2016-01-20 23:56:19 -05:00
Amjad Masad
b326a3fd1e Merge pull request #3292 from babel/unary-expressions
UnaryExpressions are never not prefix
2016-01-20 20:55:36 -08:00
Amjad Masad
2110f530ea WithStatements can have statements as bodies
For example try: `with({x: 1}) console.log(x);`
2016-01-20 20:48:31 -08:00
Henry Zhu
370095e866 update spec decorator property 2016-01-20 23:17:45 -05:00
Amjad Masad
6b47447e7a UnaryExpressions are never not prefix
If you look at the spec https://github.com/babel/babel/blob/master/doc/ast/spec.md#unaryexpression
All unary expressions are prefix. We should deprecate this field. But for now let's just default it true.
2016-01-20 19:02:04 -08:00
Alex Kotliarskyi
1f543e1bca Add jsx source annotations only to the files that contain JSX 2016-01-20 14:23:27 -08:00
Alex Kotliarskyi
eaef8302cc Generate unique filename variable 2016-01-20 13:52:55 -08:00
Dmitry Soshnikov
e7187faea6 Pass per preset: merge nested preset sub-options into preset 2016-01-20 13:36:27 -08:00
Alex Kotliarskyi
34116faaf8 Fix tests for react-jsx-source 2016-01-20 13:25:53 -08:00
Chris Cowan
7621d38bbd Add test for T3026. 2016-01-20 12:11:57 -08:00
Amjad Masad
f98dd6c76d Merge pull request #3287 from nettofarah/patch-1
[doc] Correct use of possessive case
2016-01-20 01:17:32 -08:00
Amjad Masad
a43f208e6b changelog 2016-01-20 01:01:17 -08:00
Amjad Masad
e9a913a3f6 v6.4.6 2016-01-20 00:58:48 -08:00
Sebastian McKenzie
1358ac6519 Merge pull request #3288 from babel/fix-T7006
[hotfix][T7006] Arrow functions don't have arguments bound
2016-01-20 08:54:50 +00:00
Amjad Masad
9980b6b8b2 [hotfix][T7006] Arrow functions don't have arguments bound 2016-01-20 00:41:17 -08:00
Jason
e9fae4ca54 Update Whitespace._findToken 2016-01-20 16:37:46 +08:00
Netto Farah
955758f9bb Correct use of possessive case
Changing it's to its
2016-01-20 00:23:56 -08:00
Jason
d11a2e3d48 Add type annotations for Whitespace._findToken 2016-01-20 13:01:32 +08:00
Alex Kotliarskyi
1643592342 Guard against empty loc 2016-01-19 20:59:42 -08:00
Alex Kotliarskyi
9f76cf7c42 Hoist current file name for transform-react-jsx-source
For better tooling support it's important to include absolute file name for JSX
elements. However, having them inline will inflate resulting file size, so we
move the file name to a constant declared at the beginning of the file and
reference it from `__source` attribute.
2016-01-19 20:10:53 -08:00
Henry Zhu
ec8f0a224e Merge pull request #3279 from hzoo/6.4.5-log
add 6.4.5 changelog
2016-01-19 18:04:41 -05:00
Henry Zhu
97fd9d65e7 v6.4.5 2016-01-19 18:02:31 -05:00
Henry Zhu
e152e7044e v6.4.5 2016-01-19 18:02:31 -05:00
Henry Zhu
c89d9e110f add 6.4.5 changelog [ci skip] 2016-01-19 15:28:48 -05:00
Henry Zhu
b825e0c152 Merge pull request #3284 from bmeck/babylon-flow
fix flow for babylon
2016-01-19 14:23:29 -05:00
Henry Zhu
b29a09d976 Merge pull request #3282 from 59naga/master
Fix T6953,T2541 export-from statement renamed default issue
2016-01-19 14:23:12 -05:00
Bradley Farias
b6f5b6ab11 fix flow for babylon 2016-01-19 13:01:26 -06:00
Bradley Farias
b628fee856 fix flow for babylon 2016-01-19 13:01:26 -06:00
Jason
993c5a572b Improve performance for generator.buffer 2016-01-20 02:04:26 +08:00
59naga
c509847588 Fix T6953,T2541 export-from statement renamed default issue
- Use `interopRequireDefault` helper if local name is default.

Via 59naga/babel-plugin-add-module-exports#20
2016-01-20 02:54:54 +09:00
Jason
235d8397fd Make Whitespace._findToken private and add comments 2016-01-19 21:46:22 +08:00
Jason
ed227a6c8a Use binary search to improve getNewlinesBefore/After performance 2016-01-19 21:18:06 +08:00
Jason
76e3c5227b Improve generator performance by caching the last character in Buffer 2016-01-19 21:16:33 +08:00
Dmitry Soshnikov
3f1353d01f [RFC] Pass per preset
This introduces "pass per preset" feature, spawting a new traversal for each preset in case if the `passPerPreset` is `true` (default is `false`). This gives opportunity to define "before" and "after" presets, mimicking a similar feature from Babel 5. A rationally for this is to make plugins as short as possible, and handled only needed nodes, not afrading potential collisions in case if presets are merged.
2016-01-18 21:00:37 -08:00
Sebastian McKenzie
f1ef0ff5e9 Merge pull request #3118 from benjamn/import-hoisting
Add test of import hoisting that fails when the runtime transform is used.
2016-01-19 02:20:17 +00:00
Henry Zhu
e5383aa447 Merge pull request #3278 from jmm/makefile-npm-bins
Update node_modules/.bin references in Makefile
2016-01-18 18:30:18 -05:00
Amjad Masad
1264709226 Merge pull request #3274 from babel/fix-function-decl
Method names should not be bound to body
2016-01-18 10:57:19 -08:00
Jesse McCarthy
30cf018d33 Homogenize node_modules/.bin references.
Some had leading `./` some didn't.
2016-01-18 13:55:56 -05:00
Jesse McCarthy
9ea64e0973 Delete unneccessary node command. 2016-01-18 13:55:56 -05:00
Jesse McCarthy
6a9b52ee90 Revert "Add node_modules/.bin to PATH."
This reverts commit 25fb2b8410.

This didn't work as intended. Now it's cruft / misleading.
2016-01-18 13:55:34 -05:00
Sebastian McKenzie
de51bf5486 Merge branch 'kpdecker-source-map-reenter' 2016-01-18 18:37:06 +00:00
Sebastian McKenzie
65a4c8f4a4 Merge branch 'source-map-reenter' of https://github.com/kpdecker/babel into kpdecker-source-map-reenter
Conflicts:
	packages/babel-generator/src/printer.js
2016-01-18 18:36:57 +00:00
Sebastian McKenzie
f957ebde39 Merge pull request #3277 from charliesome/gulp-binstub
Use project-local gulp binstub rather than system gulp
2016-01-18 17:35:55 +00:00
Charlie Somerville
00f72f4735 use project-local gulp binstub rather than system gulp 2016-01-18 23:09:51 +11:00
Henry Zhu
d8c3ad0d63 Merge pull request #3272 from AgentME/dedupeParserOpts
Fix T3084, dedupe parser opts
2016-01-17 23:51:29 -05:00
Sebastian McKenzie
e604bf229b Merge pull request #3276 from babel/async-to-generator-helper-runaway-promises
Add missing returns to async to generator helper
2016-01-18 02:02:38 +00:00
Sebastian McKenzie
99a224efd9 add missing returns to async to generator helper 2016-01-18 02:02:08 +00:00
Amjad Masad
7125bf4917 Merge pull request #3275 from hzoo/temp-remove-types
Internal: temporarily remove flow types
2016-01-17 14:54:22 -08:00
Henry Zhu
7041901fc1 update flowconfig 2016-01-17 17:23:15 -05:00
Henry Zhu
51dfd2237e Internal: temporarily remove flow types
- Will need to investigate the issue regarding eslint/babel-eslint.
2016-01-17 17:14:57 -05:00
Amjad Masad
5c680181ba Merge pull request #3257 from horpto/bugfix/T2765
[2765] transform-async-to-generator doesn't work for `this` inside arrow
2016-01-17 14:14:56 -08:00
Amjad Masad
d11bcae496 Merge pull request #3263 from jmm/rest-new-passing-fixtures
Increase `parameters/rest` transform test coverage
2016-01-17 14:00:26 -08:00
Amjad Masad
578e9243eb Merge pull request #3269 from forivall/explode-doc
Add documentation comment for visitors.explode
2016-01-17 13:58:20 -08:00
Amjad Masad
cf62c53832 Merge pull request #3264 from jmm/parameters-rest-simplify
Simplify `parameters/rest` code
2016-01-17 13:50:55 -08:00
Amjad Masad
95c93dd22b Method names should not be bound to body
As an artificat of compiling methods to named function expressions the
function name is being considered a "local" binding in the function
body. This means that we will throw errors anytime someone would want to
create a new local binding with the same name.

This is solved by assigning a symbol to function Identifiers that
indicates that they should not be considered local bindings.
2016-01-17 13:19:37 -08:00
Chris Cowan
d425927ff1 Make babylon ignore duplicate plugins. 2016-01-15 19:29:21 -08:00
Chris Cowan
af363c8da5 Make babylon ignore duplicate plugins. 2016-01-15 19:29:21 -08:00
Chris Cowan
9c75f27240 Make Babylon correctly handle "flow" being present multiple times in plugins. 2016-01-15 19:00:38 -08:00
Chris Cowan
aa9b3ec2a8 Make Babylon correctly handle "flow" being present multiple times in plugins. 2016-01-15 19:00:38 -08:00
Henry Zhu
9d0a05ecde Merge pull request #3268 from hzoo/t2892-test
Add test for T2892
2016-01-14 18:40:30 -05:00
Henry Zhu
1e48287654 remove bug fix heading 2016-01-14 18:04:01 -05:00
Henry Zhu
10105bb077 Add test for 2892 2016-01-14 17:23:20 -05:00
Henry Zhu
ba2bf16282 6.4.4 changelog 2016-01-14 17:17:31 -05:00
Henry Zhu
8644e5f27c v6.4.4 2016-01-14 17:05:41 -05:00
Henry Zhu
4638f4db4d republish transform-regenerator 2016-01-14 17:03:39 -05:00
Jordan Klassen
0c1eddfd52 Add documentation comment for visitors.explode 2016-01-14 13:41:19 -08:00
Jesse McCarthy
19937573a6 Fix assignment to rest param element. 2016-01-14 13:21:47 -05:00
Jesse McCarthy
49728be8b6 Test for no-opt of assign to rest param element.
That is, do not attempt to optimize assignments as opposed to reads.

(Failing.)
2016-01-14 13:21:40 -05:00
Amjad Masad
3f2a445c9a v6.4.3 2016-01-13 21:56:22 -08:00
Amjad Masad
1e58139179 changelog 2016-01-13 21:53:43 -08:00
Amjad Masad
d3242e8513 Merge pull request #3261 from jmm/array-expr-builder-default
Add ArrayExpression.elements.default
2016-01-13 21:23:03 -08:00
Amjad Masad
ee1e16f76d Merge pull request #3162 from loganfsmyth/requeue-generators-6676
Requeue generators for re-traversal so we pick up regeneratorRuntime - fixes T6676
2016-01-13 21:22:03 -08:00
Jesse McCarthy
857675c99c Add fixtures to exercise shadow conditional. 2016-01-13 17:37:29 -05:00
Jesse McCarthy
41066f55ea Add fixtures for deopt due to arguments. 2016-01-13 17:37:23 -05:00
Jesse McCarthy
b17965ab8b Improve comments. 2016-01-13 17:24:06 -05:00
Jesse McCarthy
059d7123db Remove unnecessary else. 2016-01-13 17:24:06 -05:00
Jesse McCarthy
e4044062c3 Remove unnecessary length check & nesting. 2016-01-13 17:24:06 -05:00
Jesse McCarthy
4c69f1cda5 Replace func expr with arrow. 2016-01-13 17:24:06 -05:00
Jesse McCarthy
afd98ebd2a Remove unnecessary literal return value. 2016-01-13 17:24:06 -05:00
Jesse McCarthy
bcfa58a6a2 Remove unnecessary intermediate var. 2016-01-13 17:24:06 -05:00
horpto
5ac022ab9b 4 -> 2 spaces tab size 2016-01-13 15:37:20 +05:00
Amjad Masad
add96d626d Double quotes 2016-01-12 17:30:53 -08:00
Amjad Masad
0d9459dbb6 Fix minified labeledStatement printing
Unary expressions with alphabetic operators like 'void' were being
squished next to the statement.
2016-01-12 17:28:46 -08:00
Amjad Masad
b7aa49d9f5 Merge pull request #3250 from babel/symbol-rename
[T6933] Rename any shadowing Symbol binding
2016-01-12 17:02:16 -08:00
Ben Newman
e1ec9ef985 Make require declarations inherit ._blockHoist values from imports.
This commit fixes the failing test I introduced in pull request #3118.
2016-01-12 18:01:31 -05:00
Ben Newman
4ca25ac7a9 Add test of import hoisting that fails with the runtime transform. 2016-01-12 18:01:31 -05:00
Jesse McCarthy
0f85e79f67 Add ArrayExpression.elements.default. 2016-01-12 11:33:08 -05:00
Amjad Masad
6a3b3dc3e9 Merge pull request #3252 from caseywebdev/fix-amd-umd-use-strict
Fix T2929, T6796, stop leaking directives
2016-01-11 17:34:51 -08:00
Amjad Masad
bad98a1056 Merge pull request #3232 from jonathanong/babel-register-cache-mkdirp
babel register cache: make sure the cache file's directory exists
2016-01-11 17:34:08 -08:00
James Kyle
dfc4113a57 Merge pull request #3259 from mathiasbynens/use-regexpu-core
Use only `regexpu-core` instead of all of `regexpu`
2016-01-11 10:57:13 -08:00
Mathias Bynens
430e80fe0e Use only regexpu-core instead of all of regexpu
Ref. https://github.com/mathiasbynens/regexpu/issues/24.
2016-01-11 19:32:19 +01:00
horpto
fa9f8ea4be Fix for deeply nested async arrows 2016-01-11 04:37:16 +05:00
horpto
f2fdc74d1b [2765] transform-async-to-generator doesn't work for this inside arrow
function
2016-01-10 21:52:04 +05:00
Sebastian McKenzie
69b20a3054 label 4.2.0 breaking changes as accidental 2016-01-09 19:06:18 +01:00
Sebastian McKenzie
7a3d2865c1 package renames aren't breaking changes 2016-01-09 19:05:29 +01:00
Sebastian McKenzie
21f6f52161 Merge pull request #3255 from ForbesLindesay/patch-1
Move "throw parse error if class properties do not have a semicolon" to breaking changes
2016-01-09 19:04:37 +01:00
Forbes Lindesay
d9c2090d23 Move "throw parse error if class properties do not have a semicolon" to breaking changes
This broke my project, because I hadn't added semi-colons in all places.
2016-01-09 17:54:41 +00:00
Henry Zhu
0dd640d0dc Merge pull request #3254 from ForbesLindesay/patch-1
Changelog: Move "remove `StringLiteral`" in `babel-types` into Breaking Changes
2016-01-09 12:52:56 -05:00
Forbes Lindesay
a77bd91013 Move "remove StringLiteral" in babel-types into Breaking Changes 2016-01-09 15:34:50 +00:00
Casey Foster
c7c4d7f5fd Fix T2929, T6796, stop leaking directives 2016-01-08 15:29:42 -06:00
James Kyle
fb0977b4b3 Merge pull request #3251 from ForbesLindesay/document-babel-generator-opts
Document options for babel-generator
2016-01-08 09:33:13 -08:00
ForbesLindesay
bd7b202866 Document options for babel-generator 2016-01-08 14:38:37 +00:00
Amjad Masad
1d4d0c0175 [T6933] Rename any shadowing Symbol binding 2016-01-07 21:02:59 -08:00
Henry Zhu
917436ca24 add 6.4.2 changelog and some dates 2016-01-06 21:53:30 -05:00
Henry Zhu
98504720df v6.4.2 2016-01-06 21:26:43 -05:00
Henry Zhu
7af1bd4354 v6.4.2 2016-01-06 21:26:43 -05:00
Henry Zhu
a156dd2918 Merge pull request #3247 from babel/await-paren
Parenthesize await/yield expression in binary expr
2016-01-06 21:18:08 -05:00
Amjad Masad
17ea5cd916 Fix failing test 2016-01-06 17:50:17 -08:00
Amjad Masad
a41c486155 Merge pull request #3246 from babel/kpdecker-rest-length-fail
Support expressions in rest arg access
2016-01-06 19:40:49 -06:00
Amjad Masad
feedc527a1 Merge pull request #3244 from hzoo/cp-loc
`babylon`: fix error location for class properties with a missing sem…
2016-01-06 19:39:22 -06:00
Amjad Masad
139503e86f Parenthesize await/yield expression in binary expr 2016-01-06 17:35:39 -08:00
Amjad Masad
59ea034df2 Support expressions in rest arg access
The current implementation assumes a numeric literal although it just
checks the base type.
2016-01-06 17:07:05 -08:00
Henry Zhu
c9d7d75654 6.4.1 changelog 2016-01-06 20:01:45 -05:00
Amjad Masad
88d57b58a4 Merge branch 'rest-length-fail' of https://github.com/kpdecker/babel into kpdecker-rest-length-fail 2016-01-06 16:46:16 -08:00
Amjad Masad
ada2fdbe4b v6.4.1 2016-01-06 16:27:49 -08:00
Amjad Masad
c415c00179 Merge pull request #3245 from babel/assig-parenth
Revert #3217 and add tests
2016-01-06 18:24:38 -06:00
Amjad Masad
ec983b276e add assignment expression parentheses test 2016-01-06 16:03:45 -08:00
Amjad Masad
6abee425d3 Revert "babel-types: add Binary alias to AssignmentExpression definition (fixes T6887)"
This was causing problems with parenthesizing assignment expression
This reverts commit b5cf529d6b.
2016-01-06 15:59:39 -08:00
Henry Zhu
2f00b4c329 babylon: fix error location for class properties with a missing semicolon 2016-01-06 18:42:26 -05:00
Henry Zhu
f31099f383 babylon: fix error location for class properties with a missing semicolon 2016-01-06 18:42:26 -05:00
kpdecker
28280be3ed Add failing tests case for 6.4 rest.length issue 2016-01-06 17:34:43 -06:00
Henry Zhu
7918b9028b Merge pull request #3231 from babel/changelog-6.4.0
add 6.4.0 changelog
2016-01-06 15:53:58 -05:00
Henry Zhu
85b164306a update changelog 2016-01-06 15:47:51 -05:00
Henry Zhu
359b8533b6 v6.4.0 2016-01-06 15:34:12 -05:00
Henry Zhu
8cac20d845 v6.4.0 2016-01-06 15:34:12 -05:00
Amjad Masad
e79c625091 Merge pull request #3229 from hzoo/T6913
Add a check for parentheses for AwaitExpressions (fixes T6913)
2016-01-06 14:22:54 -06:00
Henry Zhu
cd227b3ffe add 6.4.0 changelog 2016-01-06 11:15:58 -05:00
Sebastian McKenzie
72c091b63a Ensure regenerator option for babel-plugin-transform-runtime doesn't cancel out core-js polyfill 2016-01-06 15:26:00 +00:00
Sebastian McKenzie
b28803c698 Merge pull request #3235 from guybedford/polyfillRuntime
Ensure opts.polyfill = false behaves correctly for runtime-transformer
2016-01-06 15:23:41 +00:00
Sebastian McKenzie
6c79639801 Merge pull request #3225 from hzoo/cp-semi
`babylon`: throw parse error if class properties do not have a semico…
2016-01-06 15:22:37 +00:00
Sebastian McKenzie
d2f5a409da Merge pull request #3225 from hzoo/cp-semi
`babylon`: throw parse error if class properties do not have a semico…
2016-01-06 15:22:37 +00:00
Sebastian McKenzie
e6e13cbe35 Merge pull request #3166 from guybedford/moduleName
Add __moduleName support to System.register
2016-01-06 15:11:34 +00:00
Sebastian McKenzie
d4bc297a7e Merge pull request #3233 from maclover7/patch-1
Update LICENSE end date to 2016
2016-01-06 15:02:07 +00:00
Henry Zhu
ddddd173f0 Merge pull request #3240 from athaeryn/fix-small-typo
Fix typo in babel-generator README
2016-01-06 09:02:56 -05:00
Mike Anderson
2471d80bd0 Fix small typo in babel-generator README 2016-01-05 23:33:50 -06:00
Henry Zhu
d9e453fb3c Merge pull request #3236 from samwgoldman/export-interface
Add `export interface` Flow syntax support to Babel 6.x
2016-01-05 22:04:36 -05:00
Sam Goldman
541b576c7a Guard export interface against isExportDefaultSpecifier 2016-01-05 17:28:21 -08:00
Sam Goldman
aeeffe5cff Guard export interface against isExportDefaultSpecifier 2016-01-05 17:28:21 -08:00
Sam Goldman
a04948f70f Add export interface Flow syntax support
An interface export is just like a type export. In fact, it's a syntax affordance which makes the following equivalent:

```javascript
interface I_ { ... }
export type I = I_;
```

```javascript
export interface I { ... }
```

See facebook/flow#1145
2016-01-05 15:57:45 -08:00
Sam Goldman
17d19a0056 Add export interface Flow syntax support
An interface export is just like a type export. In fact, it's a syntax affordance which makes the following equivalent:

```javascript
interface I_ { ... }
export type I = I_;
```

```javascript
export interface I { ... }
```

See facebook/flow#1145
2016-01-05 15:57:45 -08:00
Henry Zhu
cf41c321af Don't overparenthesize, add yield tests 2016-01-05 18:12:25 -05:00
guybedford
d5f71d4a32 ensure opts.polyfill = false behaves correctly for runtime-transformer 2016-01-06 00:26:45 +02:00
Amjad Masad
06545e6f70 Merge pull request #3217 from babel/hzoo-patch-1
`babel-types`: add `Binary` alias to `AssignmentExpression` definitio…
2016-01-05 16:26:02 -06:00
Amjad Masad
6cc17e4ed7 Merge pull request #3230 from samwgoldman/declare-type-declare-interface
Add `declare type` and `declare interface` Flow syntax support to 6.x
2016-01-05 16:18:18 -06:00
Jon Moss
7a303fdc70 Update LICENSE end date to 2016 2016-01-04 22:59:12 -05:00
jongleberry
37dbf7c5ed babel register cache: make sure the cache file's directory exists 2016-01-04 14:28:38 -08:00
Sam Goldman
bd5c1a5b1b Add support for "declare interface" Flow syntax
This has been a feature in Flow for a long time (couldn't easily find a
specific commit adding this). Interfaces are basically undocumented, though, so
it's easy to see how this was missed.
2016-01-04 11:50:12 -08:00
Sam Goldman
26c97c4069 Add support for "declare interface" Flow syntax
This has been a feature in Flow for a long time (couldn't easily find a
specific commit adding this). Interfaces are basically undocumented, though, so
it's easy to see how this was missed.
2016-01-04 11:50:12 -08:00
Sam Goldman
0980819346 Add support for "declare type" Flow syntax
See facebook/flow#1105
2016-01-04 11:42:43 -08:00
Sam Goldman
e764346d5f Add support for "declare type" Flow syntax
See facebook/flow#1105
2016-01-04 11:42:43 -08:00
Henry Zhu
ab2135bc9f Add a check for parentheses for AwaitExpressions (fixes T6913) 2016-01-04 08:31:07 -05:00
Sebastian McKenzie
2516b7570f Merge pull request #3228 from babel/revert-3208-remove-array-generics-from-runtime
Revert "remove array generics from runtime"
2016-01-03 03:42:15 +00:00
Sebastian McKenzie
3fa51097a6 Revert "remove array generics from runtime" 2016-01-03 03:42:10 +00:00
Sebastian McKenzie
e68754faf2 Merge pull request #3227 from babel/revert-3206-update-core-js
Revert "update core-js"
2016-01-03 03:41:46 +00:00
Sebastian McKenzie
4e20a99b89 Revert "update core-js" 2016-01-03 03:41:40 +00:00
Henry Zhu
b5cf529d6b babel-types: add Binary alias to AssignmentExpression definition (fixes T6887) 2016-01-01 14:44:28 -05:00
guybedford
be2d85d688 use a _context object instead of a __moduleName argument 2015-12-31 17:11:51 +02:00
Sebastian McKenzie
2ec842d425 Merge pull request #3220 from jmm/not-a-directive
Don't parse parenthesized string as directive
2015-12-31 01:54:47 +00:00
Sebastian McKenzie
181e9b5957 Merge pull request #3214 from fabiomcosta/fix_rest_args_length_multiple_params
[T6891][fix][babel-plugin-transform-es2015-parameters] arguments.length optimization bugfix
2015-12-31 01:44:10 +00:00
Henry Zhu
e849c62144 babylon: throw parse error if class properties do not have a semicolon (fixes T6873) 2015-12-30 14:01:46 -05:00
Henry Zhu
976edfc067 babylon: throw parse error if class properties do not have a semicolon (fixes T6873) 2015-12-30 14:01:46 -05:00
Jesse McCarthy
970a0ade4b Update Slack link. 2015-12-30 13:42:32 -05:00
Sebastian McKenzie
1ec3a348d6 Merge pull request #3221 from skleeschulte/patch-1
Added handling of "--nolazy" flag
2015-12-30 03:38:07 +00:00
Henry Zhu
dc1796674f Merge pull request #3218 from jdalton/_typeof
Defer to the built-in `typeof` if support for symbols exists.
2015-12-29 12:31:15 -05:00
Fabio M. Costa
699868ed2a [fix][babel-plugin-transform-es2015-parameters] arguments.length optimization bugfix 2015-12-28 21:56:49 -08:00
Stefan Kleeschulte
f9bab3a25c Added handling of "--nolazy" flag
See https://phabricator.babeljs.io/T6897
2015-12-29 06:43:46 +01:00
Jesse McCarthy
b1da92e8cb Don't make directive from parenthesized string. 2015-12-28 11:04:33 -05:00
Jesse McCarthy
424d059292 Don't make directive from parenthesized string. 2015-12-28 11:04:33 -05:00
Jesse McCarthy
c5a8d4c5b0 Add non-directive fixture.
(Failing.)
2015-12-28 11:04:33 -05:00
Jesse McCarthy
00505ac171 Add non-directive fixture.
(Failing.)
2015-12-28 11:04:33 -05:00
John-David Dalton
d9bf5da460 Defer to built-in typeof if built-in support for symbols exists. 2015-12-27 22:50:48 -06:00
Amjad Masad
570b50c895 Merge pull request #3213 from babel/print-bugs
Fix various print inefficiencies/bugs
2015-12-27 18:28:27 -06:00
Sebastian McKenzie
082c7852fc Merge pull request #3216 from babel/crawl-up-display-name
More relaxed `displayName` inference
2015-12-27 21:58:25 +00:00
Sebastian McKenzie
05896b834b Crawl up ancestry looking for possible candidates to infer displayName from rather than just checking the direct parent 2015-12-27 21:48:28 +00:00
Sebastian McKenzie
326e157e5d Merge pull request #3203 from samwgoldman/flow-mixins-6.x
Add support for mixins to Babel 6.x
2015-12-27 21:04:40 +00:00
Sebastian McKenzie
5ca1cf0506 Merge pull request #3203 from samwgoldman/flow-mixins-6.x
Add support for mixins to Babel 6.x
2015-12-27 21:04:40 +00:00
Sebastian McKenzie
5fa8092725 Merge pull request #3215 from spicyj/fn-name
Set function names from assignment expressions
2015-12-27 21:00:41 +00:00
Ben Alpert
248f00fe82 Set function names from assignment expressions
Based on http://www.2ality.com/2015/09/function-names-es6.html.
2015-12-27 12:46:56 -08:00
Sebastian McKenzie
e5e085a567 Merge pull request #3195 from babel/hzoo-patch-1-1
validate: allow JSXText node in JSXElement children property
2015-12-27 20:30:32 +00:00
Amjad Masad
5be9d9d8aa More tests 2015-12-27 01:59:24 -08:00
Amjad Masad
ed5a057e4e Fix various print inefficiencies/bugs 2015-12-27 01:24:19 -08:00
Amjad Masad
fd998cb9af Merge pull request #3210 from babel/fun-paren
Use a printStack to determine parenthesis
2015-12-27 01:21:37 -08:00
Amjad Masad
10c9d26983 Also use for object expressions 2015-12-24 15:01:46 -08:00
Amjad Masad
0d8e5a9e86 Fix over-parenthesizing of function expressions 2015-12-24 14:55:51 -08:00
Henry Zhu
2befeb0657 remove validation for StringLiteral in JSXElement children property 2015-12-24 15:53:43 -05:00
Denis Pushkarev
15760dfed2 Merge pull request #3208 from zloirock/remove-array-generics-from-runtime
remove array generics from runtime
2015-12-25 00:20:32 +06:00
Denis Pushkarev
fd8477d881 remove array generics from runtime 2015-12-25 00:16:50 +06:00
Denis Pushkarev
99622e3d0f Merge pull request #3206 from zloirock/update-core-js
update core-js
2015-12-24 21:42:15 +06:00
Denis Pushkarev
49880e4e81 update core-js 2015-12-24 21:34:53 +06:00
Sam Goldman
5cfec9d8ca Add mixins to the class declaration visitor 2015-12-24 10:31:03 -05:00
Sebastian McKenzie
97faab3418 Merge pull request #3204 from babel/no-babylon-patch
Stop people from patching babylon by building it
2015-12-24 04:13:40 +00:00
Sebastian McKenzie
5b091c17f3 Merge pull request #3205 from babel/external-helpers
Rename babel-plugin-external-helpers-2 to babel-plugin-external-helpers
2015-12-24 04:09:15 +00:00
Sebastian McKenzie
c72ef3755a stop people from patching babylon by building it 2015-12-24 03:58:52 +00:00
Sebastian McKenzie
6fe210d4bf stop people from patching babylon by building it 2015-12-24 03:58:52 +00:00
Sebastian McKenzie
1fa24b1efd rename babel-plugin-external-helpers-2 to babel-plugin-external-helpers 2015-12-24 03:54:40 +00:00
James Kyle
730e80b231 Merge pull request #3199 from babel/hzoo-patch-2
v6.3.26 changelog
2015-12-23 19:44:35 -08:00
Henry Zhu
8489c6bfa1 typo 2015-12-23 22:29:43 -05:00
Sam Goldman
ef60fed7d6 Add test ensuring declare statements are transformed to comments 2015-12-23 16:49:18 -05:00
Sam Goldman
b4f130fd14 Add test ensuring declare class w/ mixins are stripped 2015-12-23 16:42:23 -05:00
Sam Goldman
e9c23ba7a1 Don't generate class mixins if prop doesn't exist 2015-12-23 16:37:14 -05:00
Sam Goldman
bb874a4e46 Add babel-generator support for mixins to Babel 6.x 2015-12-23 16:26:29 -05:00
Sam Goldman
137abcaf7a Add support for mixins to Babel 6.x 2015-12-23 16:09:12 -05:00
Sam Goldman
123a9596ce Add support for mixins to Babel 6.x 2015-12-23 16:09:12 -05:00
Amjad Masad
1932211235 Merge pull request #3202 from samwgoldman/flow-this-type-6.x
Add support for this type to Babel 6.x
2015-12-23 11:15:08 -08:00
Sam Goldman
f0fd729883 Add support for this type to Babel 6.x 2015-12-23 13:54:57 -05:00
Sam Goldman
32c03222bf Add support for this type to Babel 6.x 2015-12-23 13:54:57 -05:00
Henry Zhu
17e63580c1 v6.3.26 changelog 2015-12-23 11:43:24 -05:00
Amjad Masad
939ad92deb v6.3.26 2015-12-22 23:11:59 -08:00
Amjad Masad
ae8b7ea352 v6.3.26 2015-12-22 23:11:59 -08:00
Amjad Masad
ad6a28b3ed Merge pull request #3196 from jmm/resolve-relative-to-file
Add test for file-relative plugin & preset resolution
2015-12-22 23:03:42 -08:00
Amjad Masad
c8e3d9154b Merge pull request #3185 from antigremlin/fix-gulp-paths-windows
Allow gulp build to work on Windows
2015-12-22 22:57:58 -08:00
Amjad Masad
a2030e5804 Merge pull request #3198 from babel/eval-bug-2
Eval bug with lack of confidence considered falsy
2015-12-22 22:57:32 -08:00
Amjad Masad
1d82e48d36 Merge pull request #3190 from hzoo/remove-await-star
Remove await* from babel-generator, add parsing error to babylon - (fixes T6688)
2015-12-22 22:57:23 -08:00
Amjad Masad
959021dc70 Merge pull request #3190 from hzoo/remove-await-star
Remove await* from babel-generator, add parsing error to babylon - (fixes T6688)
2015-12-22 22:57:23 -08:00
Henry Zhu
c7bdf7fc63 remove all property, fixup tests 2015-12-23 00:02:02 -05:00
Henry Zhu
0037cf6b34 remove all property, fixup tests 2015-12-23 00:02:02 -05:00
Amjad Masad
090e8b18ea Merge pull request #3191 from vhf/destructuring-rest-args-initialization-order
Order of arguments initialization - fixes T6809
2015-12-22 20:51:20 -08:00
Amjad Masad
6ce463399d Fix evaluation bug with || 2015-12-22 20:48:50 -08:00
Amjad Masad
76eae9bcd8 add failing test 2015-12-22 20:47:08 -08:00
Jesse McCarthy
77f5d30fb1 Add test for file-relative addon resolution
Plugins & presets.
2015-12-22 14:25:23 -05:00
Henry Zhu
aa2cc907ea validate: allow JSXText node in JSXElement children property (fixes T6876) 2015-12-22 09:35:14 -05:00
James Kyle
fd3aad5811 Merge pull request #3193 from babel/thejameskyle-patch-1
Point devs to cli docs instead of installing
2015-12-21 17:11:01 -08:00
Amjad Masad
436a8c8461 add package names 2015-12-21 14:05:40 -08:00
Amjad Masad
189e4ecdc4 v6.3.25 changelog 2015-12-21 14:03:20 -08:00
Amjad Masad
75e2a398af v6.3.25 2015-12-21 13:59:11 -08:00
Amjad Masad
705b0959e7 v6.3.25 2015-12-21 13:59:11 -08:00
Amjad Masad
319838bd14 Merge pull request #3192 from babel/eval-bug
Evaluation may succeed even when not confident
2015-12-21 13:55:27 -08:00
James Kyle
dbc85cff69 Point devs to cli docs instead of installing
https://github.com/babel/babel.github.io/issues/650
2015-12-21 10:34:11 -08:00
Andrey Taranov
dd0b96ca5d Allow gulp build to work on Windows
The problem with gulp pipeline is that it replaces /src/ with /lib/ in
filenames as a regex replace operation. The regex only worked for Unix
before. Here we add a 2nd regex accomodate Windows backslashes and choose
between the two by looking if we're using path.win32.  The Unix regex is
changed to only match the package/*/src. This seemingly has no effect on
the build.

Fixes T6855
2015-12-21 14:18:59 +01:00
Amjad Masad
c5f504b865 Merge pull request #3189 from hzoo/T6859
babel-generator: keep double quotes in StringLiteral for JSX parent
2015-12-21 02:51:04 -08:00
Amjad Masad
65c13d1385 Merge pull request #3187 from MakeNowJust/fix/use-strict-use-strict
Fix ignoring previous strict mode after twice "use strict"
2015-12-21 02:25:29 -08:00
Amjad Masad
6354e7185b Merge pull request #3165 from vhf/multiple-rest-arguments
[optimisation] Fixing T6818
2015-12-21 02:13:31 -08:00
Amjad Masad
a5b9afbebe Make sure we always return when not confident 2015-12-21 02:04:16 -08:00
Amjad Masad
902d04b8f1 Failing test 2015-12-21 02:04:16 -08:00
Victor Felder
27f2918abb Minor refactoring 2015-12-21 10:43:59 +01:00
Victor Felder
28adaa49b2 Order of arguments initialization - fixes T6809
When using a default param + some destructuring param + a rest param, the
initialization order of the destructured arguments was incorrect due to the
presence of the rest parameter.
2015-12-21 02:53:36 +01:00
Victor Felder
f472670503 Add test case for regression possibly introduced by #2833 2015-12-21 02:42:01 +01:00
Henry Zhu
7bac3627fe Remove await* from babel-generator, add parsing error to babylon - (fixes T6688) 2015-12-19 23:15:09 -05:00
Henry Zhu
276c98f7f0 Remove await* from babel-generator, add parsing error to babylon - (fixes T6688) 2015-12-19 23:15:09 -05:00
Henry Zhu
379be365d6 babel-generator: keep double quotes in StringLiteral for JSX parent (fixes T6859) 2015-12-19 22:12:41 -05:00
Amjad Masad
bbd14f88c4 Merge pull request #3188 from steveluscher/patch-3
Make use of `opts.quotes` in the CodeGenerator
2015-12-18 19:15:14 -08:00
Steven Luscher
370c3ad343 Make use of opts.quotes in the CodeGenerator
I think we're meant to respect the value of `opts.quotes`, and try to infer it if none was supplied.
2015-12-18 18:23:20 -08:00
TSUYUSATO Kitsune
8d8f75a5b8 Fix ignoring previous strict mode after twice "use strict"
For example:

    var foo = function () {
      "use strict";
      "use strict";
      // there is inside of strict mode,
      // so `0123` (octal number) occurs a syntax error.
    };
    // there is outside of strict mode,
    0123; // so left is valid syntax.
    // however:
    //   SyntaxError: Invalid number (8:0)

I fixed it and add the test case.
2015-12-19 09:26:10 +09:00
TSUYUSATO Kitsune
eb2266fb1a Fix ignoring previous strict mode after twice "use strict"
For example:

    var foo = function () {
      "use strict";
      "use strict";
      // there is inside of strict mode,
      // so `0123` (octal number) occurs a syntax error.
    };
    // there is outside of strict mode,
    0123; // so left is valid syntax.
    // however:
    //   SyntaxError: Invalid number (8:0)

I fixed it and add the test case.
2015-12-19 09:26:10 +09:00
Amjad Masad
691741d201 changelog for 6.3.24 2015-12-18 15:57:14 -08:00
Amjad Masad
2b69dec01a v6.3.24 2015-12-18 15:53:49 -08:00
Amjad Masad
fdac02fa26 Merge pull request #3184 from babel/workaround-inference
Test and workaround inference bugs
2015-12-18 15:33:42 -08:00
guybedford
40714d004c add __moduleName wrapper support 2015-12-18 20:42:35 +02:00
Victor Felder
5d414a2323 Handle case where optimisation concist of only replacing rest param id with args 2015-12-18 17:43:00 +01:00
Henry Zhu
472ad1e6a6 update changelog for 6.3.21-6.3.23 2015-12-18 11:06:00 -05:00
Henry Zhu
b79ff75c31 v6.3.23 2015-12-18 10:18:12 -05:00
Henry Zhu
ed6daa794f Merge pull request #3169 from hzoo/rename-flow-comments
rename flow-comments plugin to transform-flow-comments
2015-12-18 10:07:30 -05:00
Amjad Masad
57b2ccdb66 Test and workaround inference bugs 2015-12-18 03:15:27 -08:00
Victor Felder
6cc0538d2f Safely transform all usages of rest arguments 2015-12-18 11:30:48 +01:00
Victor Felder
2dea8b2352 Safely transform multiple rest arguments 2015-12-18 11:30:48 +01:00
Victor Felder
3dfb4eb8c6 Simplify rest transformation 2015-12-18 11:30:48 +01:00
Amjad Masad
31032ee7ad v6.3.21 2015-12-18 00:23:03 -08:00
Amjad Masad
2304ce0b4a v6.3.21 2015-12-18 00:23:03 -08:00
Amjad Masad
135e1e56ca Merge pull request #3182 from babel/arrow-fn
Parenthesize arrow function when part of logical or binary expression
2015-12-18 00:11:24 -08:00
kpdecker
9e382b1686 Fix aux comment termination in lists and calls 2015-12-18 01:37:26 -06:00
kpdecker
3791491b79 Strip location information from import remaps
Fixes https://phabricator.babeljs.io/T6851
2015-12-18 01:36:24 -06:00
Amjad Masad
4aaaeb9ccf decouple arrow functions from function exprs 2015-12-17 23:31:52 -08:00
Amjad Masad
c889ef4058 Parenthesize arrow function when part of logical or binary expression 2015-12-17 23:18:43 -08:00
kpdecker
94e7e4da8e Update source map handling to be reentrant
Rather than repeating the original location when we exit a node, we need to restore the previous parent’s original line location, since the source map format denotes the start location.
2015-12-18 01:11:32 -06:00
Amjad Masad
4c693085a6 Merge pull request #3180 from babel/needsblock
Handle nested if statements with alternates in printer
2015-12-17 23:06:05 -08:00
kpdecker
9b79fbcdf5 Avoid emitting duplicate source map entries 2015-12-18 00:57:48 -06:00
Amjad Masad
9de3a3cbb9 Merge pull request #3176 from jmm/T6779-func-name-method
Don't transform method definition in transform-es2015-function-name (T6779)
2015-12-17 22:54:39 -08:00
Amjad Masad
cda9fd291f Merge pull request #3143 from fabiomcosta/improved_rest_transform_optimisations
[babel-plugin-transform-es2015-parameters][T6774] more opportunities for optimizations
2015-12-17 22:50:28 -08:00
Amjad Masad
47b686b6fa Handle nested if statements with alternates in printer
Previously we saw a bug that when we have nested if statements
and an alternate then the generated code may confuse which
if statement the alternate belongs to.

e.g.

```
if (foo) if (bar) bar(); else baz();
```

But this was handled by looking at the consequent
and if it's an if we add a block. However we didn't
handle situations where it's not an if but the last
recursive statement is an if:

```
if (foo) while (bar) if (baz) baz(); else shoosh()
```

This handles it by recurring until we get the last
statement.
2015-12-17 22:41:55 -08:00
Henry Zhu
0749e2dd92 Merge pull request #3179 from mroch/flow_0_20_0
Upgrade to flow 0.20.0
2015-12-17 16:05:32 -05:00
Marshall Roch
4a140af08d Upgrade to flow 0.20.0 2015-12-17 12:49:48 -08:00
Marshall Roch
8b55f4dfc2 Upgrade to flow 0.20.0 2015-12-17 12:49:48 -08:00
Henry Zhu
c0e322d74a Merge pull request #3177 from steveluscher/patch-1
Clarify description of `comments` config.
2015-12-17 14:18:37 -05:00
Henry Zhu
8ea45fb0e0 Merge pull request #3178 from steveluscher/patch-2
Correct type annotation for `shouldPrintComment`
2015-12-17 14:17:35 -05:00
Steven Luscher
b6dabff82e Correct type annotation for shouldPrintComment
I think this is supposed to be a `Function` that returns a `boolean`.
2015-12-17 10:50:59 -08:00
Fabio M. Costa
3868d36e31 [babel-plugin-transform-es2015-parameters] more oportunities for optimisations 2015-12-17 10:50:56 -08:00
Steven Luscher
603bb64db0 Clarify description of comments config.
It doesn't mean anything for “strip/output” to be “on.”
2015-12-17 10:36:10 -08:00
Sebastian McKenzie
16ae7c2d9a Merge pull request #3171 from babel/inference-recursion
Inference recursion
2015-12-17 14:44:29 +00:00
Sebastian McKenzie
a8a58aaa07 Fix infinite recursion bug 2015-12-17 14:44:18 +00:00
Amjad Masad
b802034a25 Merge pull request #3173 from voideanvalue/T6829
[babel-generator] fix unhandled new-precedence edge case
2015-12-16 13:32:18 -08:00
voideanvalue
2ac8e836f5 [babel-generator] fix unhandled new-precedence edge case 2015-12-16 12:51:13 -08:00
Henry Zhu
fa96d15793 add 6.3.20 changelog 2015-12-16 15:32:32 -05:00
Amjad Masad
f350853db9 v6.3.20 2015-12-16 12:24:45 -08:00
Amjad Masad
c451222d6e v6.3.20 2015-12-16 12:24:45 -08:00
Amjad Masad
4bb7dbabb0 Merge pull request #3170 from babel/fix-numeric-member-expr
Fix invalid codegen for number member expr
2015-12-16 12:21:42 -08:00
Amjad Masad
178da2f59b var 2015-12-16 12:20:49 -08:00
Henry Zhu
6fd294057e Merge pull request #3172 from babel/thejameskyle/T6805
Add Expression alias to BindExpression
2015-12-16 09:48:54 -05:00
Henry Zhu
fa23b4359b add functionBind to babylon plugins readme 2015-12-16 09:47:08 -05:00
Henry Zhu
ed016aef9e add functionBind to babylon plugins readme 2015-12-16 09:47:08 -05:00
James Kyle
2141406c86 Add Expression alias to BindExpression 2015-12-15 23:37:29 -08:00
Amjad Masad
12fac9cadf Inference recursion bug 2015-12-15 19:56:27 -08:00
Amjad Masad
320cede9be Fix invalid codegen for number member expr 2015-12-15 17:47:46 -08:00
Henry Zhu
33ce926c7f rename flow-comments plugin 2015-12-15 20:14:47 -05:00
Henry Zhu
59f5e7f218 v6.3.19 changelog 2015-12-14 17:27:07 -05:00
Amjad Masad
9303517bab v6.3.19 2015-12-14 14:11:36 -08:00
Amjad Masad
2a41f499bd Merge pull request #3167 from babel/binary-expr
Use the leftMost from the right to check if we need spaces in BinaryExpressions
2015-12-14 14:05:05 -08:00
Amjad Masad
f2c8f2ac5c Merge pull request #3157 from hzoo/port-flow-comments
move babel-plugin-flow-comments from babel-plugins repo and convert to use babel 6
2015-12-14 13:43:09 -08:00
Amjad Masad
007ef5cdbb Use the leftMost from the right to check if we need spaces in BinaryExpressions 2015-12-14 13:36:52 -08:00
Logan Smyth
7b25b33ac6 Merge pull request #3161 from loganfsmyth/function-rename-6781
Only rename outer function bindings on conflict - fixes T6781
2015-12-13 23:44:43 -08:00
Logan Smyth
36717cbf81 Merge pull request #3142 from loganfsmyth/runtime-typeof-error-T6644
Add custom transform for babel-runtime builds to avoid circular deps - fixes T6644
2015-12-13 23:44:13 -08:00
Amjad Masad
22424f457d v6.3.18 changelog 2015-12-13 23:15:06 -08:00
Amjad Masad
b0eb0f3ff9 v6.3.18 2015-12-13 23:01:37 -08:00
Amjad Masad
d649b2e36e v6.3.18 2015-12-13 23:01:37 -08:00
Logan Smyth
ee6f470d77 Requeue generators for re-traversal so we pick up regeneratorRuntime - fixes T6676 2015-12-13 16:15:02 -08:00
Logan Smyth
afcfba2075 Only rename outer function bindings on conflict - fixes T6781 2015-12-13 15:35:28 -08:00
Henry Zhu
9c88b8797e Merge pull request #3160 from vslinko-forks/numbericLiteral
Typo: t.numbericLiteral -> t.numericLiteral
2015-12-13 11:44:39 -05:00
Vyacheslav Slinko
925774ed86 Typo: t.numbericLiteral -> t.numericLiteral 2015-12-13 17:03:19 +03:00
Amjad Masad
4e82edb6d0 Merge pull request #3158 from babel/paren-object
Parenthesize object expression when it may end up at the start of an expression
2015-12-12 20:43:46 -08:00
Amjad Masad
07df8515b9 Parenthesize object expression when it could end up at the start of an expression T6811 2015-12-11 18:04:16 -08:00
Henry Zhu
1a545f2761 move babel-plugin-flow-comments from babel-plugins repo and convert to use babel 6 2015-12-11 10:59:08 -05:00
Jesse McCarthy
740604f268 Merge pull request #3123 from jmm/traverse-needs-parent-message
Make traverseNeedsParent message clearer.
2015-12-11 10:05:43 -05:00
Jesse McCarthy
9674ef4b27 Make traverseNeedsParent message clearer. 2015-12-11 09:44:57 -05:00
Sebastian McKenzie
e9fa841ae6 Merge pull request #2833 from vhf/rest-arguments-use
Have es2015 rest transform safely use `arguments`
2015-12-12 01:35:57 +11:00
Sebastian McKenzie
d8445e0e78 Merge pull request #2933 from ForbesLindesay/babel-types-docs
Generate documentation for babel-types
2015-12-12 01:33:48 +11:00
Sebastian McKenzie
694ad8eb8a Merge pull request #3107 from MakeNowJust/fix/t6675-2
Fixed T6675
2015-12-12 01:30:05 +11:00
Sebastian McKenzie
0278f5a2ba Merge pull request #3107 from MakeNowJust/fix/t6675-2
Fixed T6675
2015-12-12 01:30:05 +11:00
Henry Zhu
53d548bb5b fix typo in 6.3.17 changelog 2015-12-10 22:03:40 -05:00
Amjad Masad
7892b7e6f3 Changelog for 6.3.17 2015-12-10 17:29:43 -08:00
Amjad Masad
1fbbdd61e3 v6.3.17 2015-12-10 17:20:27 -08:00
Henry Zhu
caa7fc0853 Merge pull request #3150 from babel/thejameskyle-patch-1
Do not prefer global when installing babel-cli
2015-12-10 16:42:29 -05:00
Amjad Masad
d2e7e6a54d Merge pull request #3152 from babel/minified-format
Add minified format option
2015-12-10 16:28:48 -05:00
Henry Zhu
055374ba18 Merge pull request #3151 from babel/object-property-pure
Support ObjectProperty in purity check
2015-12-09 22:02:38 -05:00
Henry Zhu
f32d6b2d67 Merge pull request #3153 from babel/do-while
do-while takes a statement
2015-12-09 22:00:53 -05:00
Amjad Masad
cbc37bfb2c do-while takes a statement
see http://www.ecma-international.org/ecma-262/6.0/#sec-iteration-statements
2015-12-09 18:37:02 -08:00
Amjad Masad
cb03a98b65 Add minified format option
As a follow up from #3145 we agreed to add a new format that is a
superset of the compact format option. Do things that are considered
dangerous. e.g. not printing semicolons, or print literal values
as opposed to raw values.
2015-12-09 17:34:23 -08:00
Amjad Masad
2a2cb4f160 Support ObjectProperty in purity check 2015-12-09 16:49:16 -08:00
James Kyle
5952b1f133 Do not prefer global when installing babel-cli
We should be encouraging users to install locally just like every other dependency.
2015-12-09 15:30:28 -08:00
Henry Zhu
e96f3544f6 Add 6.3.16 changelog 2015-12-08 23:12:44 -05:00
Henry Zhu
94edd6e461 v6.3.16 2015-12-08 23:10:41 -05:00
Jesse McCarthy
36e58f4d4f Apply only to ObjectProperty.
Fix T6779. It should be possible to apply this to ES5 functions without
mutating ES2015 MethodDefinition's.
2015-12-08 16:46:45 -05:00
Jesse McCarthy
24998bbd3f Add method definition fixtures.
(Failing.)
2015-12-08 16:46:45 -05:00
Henry Zhu
e02606b373 Merge pull request #3148 from babel/unary-pure
Support unary expression in isPure check
2015-12-07 15:20:41 -05:00
Henry Zhu
14bad622f2 add second param 2015-12-07 15:20:30 -05:00
Amjad Masad
6601a6f737 Support unary expression in isPure check 2015-12-07 11:55:21 -08:00
Amjad Masad
b8f5ca4ff0 Merge pull request #3145 from babel/always-print
Always print strings for consistency
2015-12-07 14:12:32 -05:00
Amjad Masad
874ab9dfc7 Merge pull request #3147 from babel/seq-throw
Don't print on throw statements with sequence exprs
2015-12-07 14:01:38 -05:00
Amjad Masad
4b99d18ea7 Only reprint in compact mode 2015-12-07 10:59:50 -08:00
Amjad Masad
aaf834801c Merge pull request #3146 from babel/no-comment
Never print comments in compact mode
2015-12-07 13:38:40 -05:00
Amjad Masad
5b5cd761df fix logical expression 2015-12-07 10:38:14 -08:00
Amjad Masad
19daae6d96 Don't print on throw statements with sequence exprs 2015-12-07 02:48:11 -08:00
Amjad Masad
8689d1a045 Never print comments in compact mode 2015-12-07 02:37:53 -08:00
Amjad Masad
89e6d5bc7e Always print strings for consistency 2015-12-07 02:30:14 -08:00
Amjad Masad
797913d9da Merge pull request #3144 from jochenberger/patch-1
Update CHANGELOG.md
2015-12-07 03:29:58 -05:00
jochenberger
8e98305900 Update CHANGELOG.md 2015-12-07 09:19:05 +01:00
Logan Smyth
05fc7ee05b Merge pull request #3137 from loganfsmyth/export-all-fail-T2763
Set the proper parents for new node paths - fixes T2763
2015-12-06 22:15:46 -08:00
Logan Smyth
d2ee421941 Make runtime point at itself and avoid nesting helpers - fixes T6644 2015-12-06 09:56:50 -08:00
Henry Zhu
2e11839257 Add 6.3.15 changelog 2015-12-06 11:36:16 -05:00
Henry Zhu
15e02657fa v6.3.15 2015-12-06 11:31:46 -05:00
Henry Zhu
3f7019f964 v6.3.15 2015-12-06 11:31:46 -05:00
Henry Zhu
d833e8bbee eslint: add space-after-keywords 2015-12-06 11:30:07 -05:00
Henry Zhu
d06cfe63c2 eslint: add space-after-keywords 2015-12-06 11:30:07 -05:00
Henry Zhu
f52b8f9e99 Merge pull request #3141 from babel/mul-def
Fix bug with evaluating an expression in it's own binding
2015-12-06 11:22:49 -05:00
Amjad Masad
350ee82a83 add comment 2015-12-06 08:00:15 -08:00
Amjad Masad
036e90e9cc Fix bug with evaluating an expression in it's own binding 2015-12-06 07:56:17 -08:00
Henry Zhu
583cde6f8c Merge pull request #3140 from babel/lerna-bin
Fix lerna path
2015-12-06 10:33:18 -05:00
Amjad Masad
064fe9426d Fix lerna path 2015-12-06 06:48:40 -08:00
Logan Smyth
b9e675597c Make alternate compat names load from main helpers 2015-12-05 23:57:35 -08:00
James Kyle
abb85b498a Merge pull request #3138 from loganfsmyth/class-rename-failure-T2494
Skip name inference on hard-to-replace classes - fixes T2494
2015-12-05 20:58:37 -08:00
Logan Smyth
925804798d Skip name inference on hard-to-replace classes - fixes T2494 2015-12-05 17:07:10 -08:00
Logan Smyth
9f32061769 Merge pull request #3134 from loganfsmyth/default-renamer-T6750
Ensure that default exports have a name before splitting them - fixes T6750
2015-12-05 16:23:39 -08:00
Logan Smyth
f37acd293c Set the proper parents for new node paths - fixes T2763 2015-12-05 16:16:02 -08:00
Logan Smyth
a12a116b9f Ensure that default exports have a name before splitting them - fixes T6750 2015-12-05 15:28:48 -08:00
Henry Zhu
ec1e975333 Merge pull request #3136 from loganfsmyth/destructure-export-T6720
Move destructuring statements off export statements before processing - fixes T6720
2015-12-05 18:26:50 -05:00
Logan Smyth
29a3176276 Move destructuring statements off export statements before processing - fixes T6720 2015-12-05 14:27:42 -08:00
Henry Zhu
333dc8dcda Merge pull request #3135 from loganfsmyth/loose-async-gen-T6755
Ensure that the async/generator flags carry over when converting class methods - fixes T6755
2015-12-05 15:42:29 -05:00
Logan Smyth
03f189fc46 Ensure that the async/generator flags carry over when converting class methods - fixes T6755 2015-12-05 12:24:00 -08:00
Henry Zhu
6082ac8a59 skip nested new expressions 2015-12-05 14:19:31 -05:00
Henry Zhu
21f76655ad account for parent NewExpression with arguments 2015-12-05 13:37:06 -05:00
Henry Zhu
8a1ad5350c Merge pull request #3111 from amasad/new
No need for parens for new expressions without args
2015-12-05 13:33:23 -05:00
Jesse McCarthy
412c65deb3 Add discussion forum to README support section. 2015-12-04 14:20:57 -05:00
James Kyle
f4647bbb54 Merge pull request #3128 from jmm/ast-spec
Update description: ESTree ES5 => Babylon.
2015-12-04 11:11:24 -08:00
James Kyle
e7bdbb67e8 Merge pull request #3131 from hzoo/changelog
add changelog
2015-12-04 11:10:50 -08:00
Henry Zhu
72eec06bb9 add changelog for 6.3.8-6.3.14 2015-12-04 14:04:32 -05:00
Henry Zhu
b3de3c2514 v6.3.14 2015-12-04 13:52:36 -05:00
Henry Zhu
0587a5d12c v6.3.14 2015-12-04 13:52:36 -05:00
Logan Smyth
164bc1aed6 Merge pull request #3133 from loganfsmyth/switch-scope-6761
Properly resolve scope from switch statement - fixes T6761
2015-12-04 09:32:45 -08:00
Logan Smyth
8efd1d71ad Properly resolve scope from switch statement - fixes T6761 2015-12-04 09:04:25 -08:00
Sebastian McKenzie
e526643f79 fix wrong bootstrap script reference 2015-12-05 02:21:34 +11:00
Sebastian McKenzie
3e2fa16dbc fix make bootstrap/ci 2015-12-05 02:16:42 +11:00
Sebastian McKenzie
d9dce29d09 move up make build in make bootstrap 2015-12-05 02:08:54 +11:00
Henry Zhu
61e2568c08 add 6.3.1 changelog 2015-12-04 07:33:50 -05:00
Henry Zhu
608e6f9274 add 6.3.2 changelog 2015-12-04 07:33:50 -05:00
Sebastian McKenzie
f60261eafb update to lerna 2015-12-04 23:23:50 +11:00
Sebastian McKenzie
80a10e144b Merge branch 'master' of github.com:babel/babel 2015-12-04 23:17:11 +11:00
Sebastian McKenzie
d6117a9e27 Merge branch 'master' of github.com:babel/babel 2015-12-04 23:17:11 +11:00
Sebastian McKenzie
d2ff843dae Merge pull request #3130 from amasad/flow-null-type
Add support for null literal type
2015-12-04 23:01:03 +11:00
Sebastian McKenzie
e81a5dc8fe v6.3.13 2015-12-04 22:56:51 +11:00
Sebastian McKenzie
7b36967416 v6.3.13 2015-12-04 22:56:51 +11:00
Sebastian McKenzie
a5cd87c401 v6.3.12 2015-12-04 22:56:13 +11:00
Sebastian McKenzie
ae831c2270 v6.3.12 2015-12-04 22:56:13 +11:00
Sebastian McKenzie
74609ec82c v6.3.10 2015-12-04 22:54:49 +11:00
Sebastian McKenzie
06809c7f81 v6.3.9 2015-12-04 22:54:38 +11:00
Sebastian McKenzie
659d310a2b v6.3.8 2015-12-04 22:54:22 +11:00
Amjad Masad
8716fb6f3f Test name, and remove todos 2015-12-04 00:12:37 -08:00
Amjad Masad
37797c4d50 Test name, and remove todos 2015-12-04 00:12:37 -08:00
Amjad Masad
e3da84bcc3 Add support for null literal type 2015-12-03 23:58:25 -08:00
Amjad Masad
9c20ace184 Add support for null literal type 2015-12-03 23:58:25 -08:00
Henry Zhu
b515fa8db8 v6.3.2 2015-12-03 22:48:04 -05:00
Logan Smyth
aa6dc5d153 Merge pull request #3116 from loganfsmyth/register-plugin-duplication
Disable babelrc processing on the already-processed configuration - fixes T6690
2015-12-03 18:33:58 -08:00
Jesse McCarthy
e8beafa1dd Update description: ESTree ES5 => Babylon.
Also remove doctoc comments that aren't currently being used.
2015-12-03 15:04:26 -05:00
Henry Zhu
c8a6d8117d Merge pull request #3108 from cspotcode/feature/fix-T2864
source-maps: Fix T2864
2015-12-03 14:46:00 -05:00
Henry Zhu
8d78ea4ecf Merge pull request #3112 from phantom10111/fix-es2015-classes
Fix return super(); in class constructor - fixes T2997
2015-12-03 10:34:18 -05:00
Henry Zhu
ae666c1e09 Merge pull request #3127 from loganfsmyth/where-fit-3051
Ensure we always push into a BlockStatement - fixes T3051
2015-12-02 22:58:10 -05:00
Logan Smyth
d71b59d0cc Ensure we always push into a BlockStatement - fixes T3051 2015-12-02 19:41:22 -08:00
Henry Zhu
f51fe91488 Merge pull request #3124 from hzoo/changelog
add 6.3.1 and 6.3.0 changelog
2015-12-02 21:55:03 -05:00
Henry Zhu
8cf1b418fc transform-inline-environment-variables: replace -> replaceWith - fixes T6724 2015-12-02 21:53:12 -05:00
Henry Zhu
ec86e2ebfd add 6.3.1 and 6.3.0 changelog 2015-12-02 00:09:26 -05:00
Henry Zhu
53877ec158 Merge pull request #3119 from loganfsmyth/default-export-generator-6733
Ensure that generator functions always have an identifier - fixes T6733
2015-12-01 22:27:59 -05:00
Henry Zhu
4f69482896 Merge pull request #3113 from phantom10111/fix-static-class-properties
Fix static class properties - fixes T2983
2015-12-01 22:21:37 -05:00
Amjad Masad
88ab37ecb4 v6.3.1 2015-12-01 10:52:40 -08:00
Amjad Masad
27252b2039 Merge pull request #3121 from amasad/fix-T6736
Fix spacing in binary expression when right is a binary expression and has a unary on the left
2015-12-01 10:50:06 -08:00
Amjad Masad
2efb677822 Add test cases with spaces 2015-12-01 10:47:25 -08:00
Amjad Masad
54a2a47030 Fix spacing in binary expression when right is a binary expression and has a unary on the left 2015-12-01 10:37:58 -08:00
phantom10111
36ebe0c939 Fix static class properties in class expressions and anonymous default exported classes - fixes T2983 2015-12-01 17:59:53 +01:00
Logan Smyth
a675234526 Ensure that generator functions always have an identifier - fixes T6733 2015-11-30 23:14:10 -08:00
Amjad Masad
5a15231cfe v6.3.0 2015-11-30 14:58:30 -08:00
Amjad Masad
2f5b953066 v6.3.0 2015-11-30 14:58:30 -08:00
Henry Zhu
1d4526cd69 Merge pull request #3109 from phantom10111/additional-validators
Additional validators for CallExpression, NewExpresion,TemplateLiteral, ArrayExpression, SequenceExpression
2015-11-29 21:35:18 -05:00
Henry Zhu
b4f44e7637 Merge pull request #3102 from roadhump/issue/T2422
Make arrow functions to work with multiple args and flow type (fixes T2422)
2015-11-29 20:51:20 -05:00
James Kyle
7f0eed0c66 Merge pull request #3117 from nooks/patch-1
Optimizations for asyncToGenerator
2015-11-29 16:43:35 -08:00
James Kyle
211a241050 Merge pull request #3115 from justinfagnani/class-properties
Check for empty decorators array on property nodes
2015-11-29 16:40:55 -08:00
Nook Scheel
a81e11c4ae Use arguments with #apply 2015-11-29 21:47:04 +03:00
Nook Scheel
b2ff128e94 Unnecessary #call 2015-11-29 21:28:14 +03:00
Nook Scheel
8c7a81d317 Optimizations for asyncToGenerator
Never use a bind!
Never use arguments as an array!
2015-11-29 21:25:09 +03:00
Logan Smyth
2bb01c6373 Disable babelrc processing on the already-processed configuration - fixes T6690 2015-11-28 23:54:01 -08:00
Henry Zhu
c7c80bc0a3 Merge pull request #3097 from laskos/fix-async-module-export
Fix async exports undefined - fixes T3085
2015-11-28 20:45:00 -05:00
Sławomir Laskowski
d34cb69912 Don't mark async functions as hoist
`babel-template` no longer crashes in IE attempting to access unpopulated error stack
2015-11-29 01:47:24 +01:00
Justin Fagnani
6f0fcc8e7b Check for empty decorators array on property nodes 2015-11-28 13:06:50 -08:00
phantom10111
9a270a3d0a Fix return super(); in class constructor - fixes T2997 2015-11-25 23:53:53 +01:00
phantom10111
11a8086432 Make ArrayExpression validator accept nulls as holes in the array 2015-11-25 23:39:35 +01:00
Henry Zhu
d0f63c1a7b add validators for TemplateLiteral and ArrayExpression 2015-11-25 23:10:27 +01:00
phantom10111
615160ba66 Fix babel-helper-remap-async-to-generator to not fail with the new validation rules 2015-11-25 23:09:21 +01:00
phantom10111
8186510b5d Add validators to CallExpression and SequenceExpression 2015-11-25 23:09:13 +01:00
James Kyle
afd68f47dd Merge pull request #3106 from hon2a/hon2a/ie-error-stack
`babel-template` no longer crashes in IE attempting to access unpopulated error stack
2015-11-25 13:01:54 -08:00
hon2a
8df5a9d49e Merge branch 'master' into hon2a/ie-error-stack 2015-11-25 11:50:09 +01:00
Amjad Masad
c78c27a8d6 It's only valid if the node is the callee 2015-11-24 19:24:05 -08:00
Amjad Masad
486d781be3 Handle member expressions 2015-11-24 19:20:06 -08:00
Amjad Masad
f1f6c820fe Handle new X()() 2015-11-24 19:12:24 -08:00
Amjad Masad
d32fae6fcd No need for parens for new expressions without args 2015-11-24 19:07:03 -08:00
Sebastian McKenzie
58f512f7c4 Merge pull request #3103 from amasad/spacing
Respect spacing in compact mode
2015-11-25 14:02:05 +11:00
Amjad Masad
e481c5b570 use + instead of template string 2015-11-24 19:01:12 -08:00
Amjad Masad
e4c5d9dcb3 Respect compact mode in spacing 2015-11-24 19:01:12 -08:00
Sebastian McKenzie
8457885599 Merge pull request #3104 from amasad/semi
Fix up semicolon omission in compact mode
2015-11-25 13:55:09 +11:00
Sebastian McKenzie
71e53a5d4d Merge pull request #3110 from thejameskyle/tjk/ObjectMember
Add ObjectMember abstract type
2015-11-25 13:54:52 +11:00
James Kyle
86287a7a8c Add ObjectMember abstract type 2015-11-24 15:00:04 -08:00
Andrew Bradley
9c27f1e86a Fixes the wrong source path being passed to SourceMapConsumer#generatedPositionFor
`generatedPositionFor` accepts a position in one of the sourcemap's *input* source files. Therefore the `source` path
should be one of the sourcemap's input `sources`, not the output `file`.
2015-11-24 16:10:10 -05:00
Andrew Bradley
bbec2114ce Fixes T2864
- Drops input mappings that cannot be mapped through Babel's sourcemap
- For example, Babel's sourcemap does not have mappings for leading comments, so any mapping from an input sourcemap for those leading comments must be dropped from the merged sourcemap
2015-11-24 16:07:37 -05:00
TSUYUSATO Kitsune
dc596d73d3 Fixed T6675
https://phabricator.babeljs.io/T6675.
2015-11-24 22:39:50 +09:00
TSUYUSATO Kitsune
922c621ffb Fixed T6675
https://phabricator.babeljs.io/T6675.
2015-11-24 22:39:50 +09:00
hon2a
af4271a262 babel-template no longer crashes in IE attempting to access unpopulated error stack. 2015-11-24 13:54:49 +01:00
Sebastian McKenzie
5c1d2ab92f Merge pull request #3099 from hzoo/validate-jsx
add more validation for jsx nodes
2015-11-24 20:42:42 +11:00
Amjad Masad
44d5552840 Fix up semicolon omission in compact mode 2015-11-23 21:32:44 -08:00
Aliaksei Shytkin
5e987cd46e Make arrow functions to work with multiple args and flow return type (fixes T2422) 2015-11-23 15:20:16 +03:00
Aliaksei Shytkin
47871f80dd Make arrow functions to work with multiple args and flow return type (fixes T2422) 2015-11-23 15:20:16 +03:00
Henry Zhu
f56af90c20 add numericliteral 2015-11-21 22:50:21 -05:00
Henry Zhu
3a05513e31 literal to stringLiteral - fixes T6667 2015-11-21 22:25:21 -05:00
Henry Zhu
efa9a1abf2 add more validation for jsx nodes 2015-11-21 21:13:09 -05:00
Sebastian McKenzie
4c311ec2ab add 6.2.2 changelog 2015-11-19 14:48:44 -08:00
Sebastian McKenzie
3c5bced67d v6.2.2 2015-11-19 14:45:57 -08:00
Sebastian McKenzie
ba0388eba5 Merge pull request #3096 from loganfsmyth/double-class-traverse
Avoid duplicating traversal of class declarations - fixes T2694
2015-11-19 14:37:21 -08:00
Sebastian McKenzie
8df82c4f3c add 6.2.1 changelog 2015-11-19 14:04:15 -08:00
Sebastian McKenzie
a4e3af1c63 v6.2.1 2015-11-19 14:03:33 -08:00
Sebastian McKenzie
45d4e50b39 add resolution dirname to unknown plugin/preset error message 2015-11-19 14:01:38 -08:00
Victor Felder
9a97d92217 T2965: Patterns as rest parameter operands are not valid, therefore this relic should go 2015-11-19 13:50:12 +01:00
Victor Felder
a510e7325b Factor out optimiseCandidate to reduce nesting & complexity 2015-11-19 13:47:07 +01:00
Victor Felder
306b5db1ef Have es2015 rest transform safely use arguments 2015-11-19 12:47:55 +01:00
Logan Smyth
b3f2ea0aa1 Avoid duplicating traversal of class declarations - fixes T2694 2015-11-19 00:30:56 -08:00
Sebastian McKenzie
82ddbc0ecd add missing changelogs - fixes T6655 2015-11-18 21:03:02 -08:00
Sebastian McKenzie
7ce5c4307a remove travis git scripts - Fixes T6661 2015-11-18 20:41:41 -08:00
Sebastian McKenzie
59ec2b2dfb v6.2.0 2015-11-18 20:33:47 -08:00
Sebastian McKenzie
ac90ea20ea v6.2.0 2015-11-18 20:33:47 -08:00
Sebastian McKenzie
94887d35e1 add babel-plugin-syntax-function-sent plugin 2015-11-18 20:32:11 -08:00
Sebastian McKenzie
8fd543edae make base option plugin/preset resolving happen relative to the input filename 2015-11-18 20:31:59 -08:00
Sebastian McKenzie
89d9db8648 bump invariant dependency version 2015-11-17 23:02:29 -08:00
Sebastian McKenzie
d79d0cf73d add function.sent 2015-11-17 23:02:21 -08:00
Sebastian McKenzie
983ca5c71f add function.sent 2015-11-17 23:02:21 -08:00
Sebastian McKenzie
f8c2beb9d8 Merge pull request #3088 from kpdecker/terminal-after-comment
Output auxiliaryCommentAfter before trail comment
2015-11-17 23:01:32 -08:00
Sebastian McKenzie
02c155e32a Merge pull request #3087 from nordluf/master
Make babel-cli watching only given files and extensions.
2015-11-17 23:00:35 -08:00
Sebastian McKenzie
eb4841932f Merge branch 'master' of github.com:babel/babel 2015-11-17 22:59:23 -08:00
Sebastian McKenzie
ba68bd255e add package.json dirname to mergeOptions - closes #3093 2015-11-17 22:58:24 -08:00
Sebastian McKenzie
9249f7715c Merge pull request #3091 from claudiopro/master
Fixes @jsx pragma detection + tests
2015-11-17 22:55:14 -08:00
Sebastian McKenzie
f8501bdee3 Merge pull request #3092 from amasad/nested-if
Print a block when the consequent is an if statement
2015-11-17 22:54:21 -08:00
Amjad Masad
1612c70c10 Take the alternate existence into account 2015-11-17 19:16:19 -08:00
Amjad Masad
35e575cf93 Print a block when encountering consequents that are if statements 2015-11-17 19:07:20 -08:00
Amjad Masad
507557c48e Add failing test 2015-11-17 18:45:35 -08:00
claudiopro
6d1a6dfc94 Fixes @jsx pragma detection + tests 2015-11-17 22:32:44 +01:00
kpdecker
1286200712 Output auxiliaryCommentAfter before trail comment
Quick fix for the case where generated comment is the terminal leaf in a subtree that is followed by a trailing comment.

Partial for #3034
2015-11-16 20:59:24 -06:00
Sebastian McKenzie
d2e07cffb9 add note about where to request features and report bugs 2015-11-16 14:41:10 -08:00
Evgeny Kruglov
a43a60e5b8 Make babel-cli watching only given files and extensions. Use --only, --ignore and --extensions while process filenames with --out-file option. 2015-11-16 23:43:14 +03:00
Sebastian McKenzie
8cd68ddc74 Merge pull request #3074 from Daniel15/flow-clowntown
Fix Flow.
2015-11-15 23:43:16 -08:00
Daniel Lo Nigro
828ce54637 Run Flow after building so that it actually runs properly in a CI run. It seems like there's a bunch of "module not found" if you run a Flow check before building, even after running "npm install". 2015-11-15 21:44:03 -08:00
Daniel Lo Nigro
20a483cd58 Fix Flow.
Removed `@flow` annotation from files that don't actually pass Flow check at the moment. These will be added back file by file once the files are properly converted to use Flow.

Closes #3064
2015-11-15 21:30:22 -08:00
Daniel Lo Nigro
0076204f80 Fix Flow.
Removed `@flow` annotation from files that don't actually pass Flow check at the moment. These will be added back file by file once the files are properly converted to use Flow.

Closes #3064
2015-11-15 21:30:22 -08:00
Sebastian McKenzie
1d34d19ce9 Merge pull request #3050 from kpdecker/aux-chain
auxiliaryComment chaining
2015-11-15 20:13:47 -08:00
Sebastian McKenzie
f6dea87102 Merge pull request #3066 from zertosh/cleanup-deps
Remove (a few) unused deps
2015-11-15 20:12:52 -08:00
Sebastian McKenzie
aec97a1b12 Merge pull request #3069 from jrsearles/add-modulus-op
Add modulus operator
2015-11-15 20:12:31 -08:00
Joshua Searles
750fca9a88 Add module operator 2015-11-15 02:44:43 -05:00
Andres Suarez
c8f3fd8a34 Remove unused deps 2015-11-14 16:04:48 -08:00
James Kyle
c4c9c6f123 Fix transform-es2015-block-scoping link 2015-11-13 20:15:52 -08:00
Sebastian McKenzie
a3fe3933da v6.1.21 2015-11-13 16:57:03 -08:00
Sebastian McKenzie
11e50695d3 v6.1.21 2015-11-13 16:57:03 -08:00
Sebastian McKenzie
31f3eac566 Merge branch 'master' of github.com:babel/babel 2015-11-13 16:56:04 -08:00
Sebastian McKenzie
01356191d4 avoid revisiting classes - #2694 2015-11-13 16:55:54 -08:00
Sebastian McKenzie
5cb326a7f6 add aliases to plugins that are where they were first specified for performance 2015-11-13 16:54:47 -08:00
kpdecker
488f5a067e Avoid duplicate auxiliary start if in aux section
Fixes #3032
2015-11-13 13:43:23 -06:00
kpdecker
1563e74cc0 Add a few auxiliary comment tests 2015-11-13 12:56:30 -06:00
Jesse McCarthy
90327aee47 Merge pull request #3043 from jmm/babylon-readme-features-to-plugins
Correct option name: features => plugins.

Fix #3042.
2015-11-13 10:42:59 -05:00
Jesse McCarthy
81edfcbd93 Correct option name: features => plugins. 2015-11-13 10:25:40 -05:00
Jesse McCarthy
f660dd3430 Correct option name: features => plugins. 2015-11-13 10:25:40 -05:00
Sebastian McKenzie
5b6a39f227 v6.1.20 2015-11-13 03:38:54 -08:00
Sebastian McKenzie
c985006597 v6.1.20 2015-11-13 03:38:54 -08:00
Sebastian McKenzie
9f6dcdbc29 add regression test - fixes #3028 2015-11-13 03:37:43 -08:00
Sebastian McKenzie
9d8db74517 only infer whitespace when we've been passed tokens 2015-11-13 03:37:27 -08:00
Sebastian McKenzie
688dcec6a3 fix queueing of nested paths being pushed onto the priority queue 2015-11-13 03:37:15 -08:00
Sebastian McKenzie
02e4dcdbe2 Merge pull request #3029 from spicyj/inline2
React inlining: Refactor to reduce parsing cost
2015-11-12 22:53:09 -08:00
Sebastian McKenzie
00d3f8f7d3 Merge pull request #3022 from tadeuzagallo/patch-1
Fix the source maps merging
2015-11-12 22:53:05 -08:00
Sebastian McKenzie
0fc160ce42 Merge pull request #3031 from forivall/remove-unused-param
Remove unused second parameter of isIdentifierStart
2015-11-12 22:52:48 -08:00
Jordan Klassen
021688e1c0 Remove unused second parameter of isIdentifierStart 2015-11-12 22:45:35 -08:00
Jordan Klassen
3b68a58e0c Remove unused second parameter of isIdentifierStart 2015-11-12 22:45:35 -08:00
Ben Alpert
d1b8db1532 React inlining: Refactor to reduce parsing cost
- Have the `jsx` helper do the `defaultProps` work instead of calling `defaultProps` inline.
- Put `key` after `props` and make it optional.
- Inline `children` as rest args instead of in the object.
- Rename `createRawReactElement` to `jsx`. I wish I was kidding.

Most of these are silly microoptimizations. In my test file (based off an internal RN app), this reduces the parsing overhead of inlining from around 1% to 0.1% in JSC and from 0.6% to 0.0% in V8 (compared to element inlining before this commit).

Once parsed, the initial render with inlining is the same speed as not inlining in JSC and ~1% slower in V8. A second initial render in the same context (reusing the function objects, JIT, etc) is 2.0% faster in JSC and 5.5% faster in V8.
2015-11-12 18:05:57 -08:00
Sebastian McKenzie
4b5a284efb fix unknown helper message - fixes #3025 2015-11-12 14:24:26 -08:00
Sebastian McKenzie
c0afdfd1a8 remove babel-browser 2015-11-12 14:20:09 -08:00
Sebastian McKenzie
16366d887c v6.1.19 2015-11-12 14:18:24 -08:00
Sebastian McKenzie
d4a351fc87 add config check to package.json babel reading 2015-11-12 14:16:40 -08:00
Sebastian McKenzie
6530d565d9 fix ship method 2015-11-12 14:10:36 -08:00
Sebastian McKenzie
e89699f07c remove checked in polyfill... 2015-11-12 14:10:30 -08:00
Sebastian McKenzie
3017999b3c v6.1.18 2015-11-12 13:46:30 -08:00
Sebastian McKenzie
4a1e5c17b4 v6.1.18 2015-11-12 13:46:30 -08:00
Sebastian McKenzie
7625e61b97 v6.1.17 2015-11-12 13:40:25 -08:00
Sebastian McKenzie
23fd185590 v6.1.17 2015-11-12 13:40:25 -08:00
Sebastian McKenzie
18e419db50 ignore duplicate publish errors 2015-11-12 13:40:10 -08:00
Sebastian McKenzie
e28e01bb86 v6.1.16 2015-11-12 13:33:20 -08:00
Sebastian McKenzie
c4c66687ea v6.1.16 2015-11-12 13:33:20 -08:00
Sebastian McKenzie
9be985c712 add retries 2015-11-12 13:33:02 -08:00
Sebastian McKenzie
d2fdd1f673 v6.1.15 2015-11-12 12:15:47 -08:00
Sebastian McKenzie
9c91b555f9 v6.1.15 2015-11-12 12:15:47 -08:00
Sebastian McKenzie
a2aa3583b6 v6.1.14 2015-11-12 12:01:18 -08:00
Sebastian McKenzie
f127f81cb7 v6.1.14 2015-11-12 12:01:18 -08:00
Sebastian McKenzie
5c22a23754 perform package publish in series rather than parallel 2015-11-12 12:00:59 -08:00
Sebastian McKenzie
8f9c531531 v6.1.13 2015-11-12 11:57:45 -08:00
Sebastian McKenzie
548d973d12 v6.1.13 2015-11-12 11:57:45 -08:00
Tadeu Zagallo
5412c4d6be Fix the source maps merging
In the current state, when the inputSourceMap has multiple sources, all the generated source map will point to the first file. Use the mapping's source instead.
2015-11-12 18:18:41 +00:00
Sebastian McKenzie
f91cfa68b9 ignore callee supers when doing spread compilation - fixes #2775 2015-11-12 01:59:07 -08:00
Sebastian McKenzie
69fb1854d7 add error for decorators not being implemented yet 2015-11-12 01:49:01 -08:00
Sebastian McKenzie
2d3760c1f7 add internal note to test modules 2015-11-12 01:09:31 -08:00
Sebastian McKenzie
2ee4960944 v6.1.12 2015-11-12 00:47:51 -08:00
Sebastian McKenzie
af208e8acb v6.1.12 2015-11-12 00:47:51 -08:00
Sebastian McKenzie
903201af31 v6.1.11 2015-11-11 23:58:22 -08:00
Sebastian McKenzie
8fb4d55687 v6.1.11 2015-11-11 23:58:22 -08:00
Sebastian McKenzie
aff324a4ca npm might be rate limiting me? 2015-11-11 23:58:10 -08:00
Sebastian McKenzie
4b2194e793 v6.1.10 2015-11-11 23:52:57 -08:00
Sebastian McKenzie
98b3dda500 v6.1.10 2015-11-11 23:52:57 -08:00
Sebastian McKenzie
b65774993d v6.1.9 2015-11-11 23:46:00 -08:00
Sebastian McKenzie
15baf2afb5 v6.1.9 2015-11-11 23:46:00 -08:00
Sebastian McKenzie
1165090c58 v6.1.8 2015-11-11 23:40:20 -08:00
Sebastian McKenzie
e018723c7e v6.1.8 2015-11-11 23:40:20 -08:00
Sebastian McKenzie
445e914c4e remove VERSION rollback 2015-11-11 23:37:37 -08:00
Sebastian McKenzie
d52985f575 v6.1.7 2015-11-11 23:37:19 -08:00
Sebastian McKenzie
8dcf4aedc0 v6.1.7 2015-11-11 23:37:19 -08:00
Sebastian McKenzie
b6515634c7 clean up tag creation and removal 2015-11-11 23:37:02 -08:00
Sebastian McKenzie
f37616c5fd v6.1.6 2015-11-11 23:32:43 -08:00
Sebastian McKenzie
97443eada6 v6.1.6 2015-11-11 23:32:43 -08:00
Sebastian McKenzie
b354d46be1 add browser scripts to make clean 2015-11-11 23:32:27 -08:00
Sebastian McKenzie
7791de81c1 fix async parallelLimit in publish script 2015-11-11 23:32:21 -08:00
Sebastian McKenzie
7d4a603356 v6.1.5 2015-11-11 23:30:14 -08:00
Sebastian McKenzie
803f58f7ad v6.1.5 2015-11-11 23:30:14 -08:00
Sebastian McKenzie
e5d3eed9f0 v6.1.10 2015-11-11 23:28:53 -08:00
Sebastian McKenzie
caff1e72a5 v6.1.10 2015-11-11 23:28:53 -08:00
Sebastian McKenzie
cfdc2b7268 add missing async declaration 2015-11-11 23:28:33 -08:00
Sebastian McKenzie
398eb606df v6.1.9 2015-11-11 23:27:56 -08:00
Sebastian McKenzie
541e547848 v6.1.9 2015-11-11 23:27:56 -08:00
Sebastian McKenzie
562023726f move up changedPackages declaration 2015-11-11 23:27:44 -08:00
Sebastian McKenzie
82a931c289 Merge branch 'development' 2015-11-11 23:24:58 -08:00
Sebastian McKenzie
67b8f10eba Merge branch 'master' of github.com:babel/babel 2015-11-11 23:24:53 -08:00
Sebastian McKenzie
afe12412a8 add npm owners 2015-11-11 23:24:39 -08:00
Sebastian McKenzie
a203596e0c make publish script parallel 2015-11-11 23:24:35 -08:00
Sebastian McKenzie
4cbe6b380a Merge pull request #2998 from spicyj/inline2
React inlining: Two bug fixes
2015-11-11 23:16:33 -08:00
Sebastian McKenzie
6e01f3cbc0 v6.1.5 2015-11-11 22:48:30 -08:00
Sebastian McKenzie
26e56bc966 v6.1.5 2015-11-11 22:48:30 -08:00
Sebastian McKenzie
fe5aff09a4 fix remaining babel helper issues 2015-11-11 22:45:50 -08:00
Sebastian McKenzie
ca1ca2055d Merge branch 'development' 2015-11-11 22:11:55 -08:00
Sebastian McKenzie
139a61e50d account for integers with decimal 0 - fixes #3002 2015-11-11 22:11:47 -08:00
Sebastian McKenzie
74a1b7fce6 make helper names more predictable - fixes #2986 2015-11-11 20:57:56 -08:00
Sebastian McKenzie
8d7a3894ea comment out react env block - fixes #2994 2015-11-11 17:54:24 -08:00
Sebastian McKenzie
78f06be9b9 move dependency from devDependencies to normal dependencies in babel-register - fixes #2989 2015-11-11 17:53:31 -08:00
Henry Zhu
52dd3e8006 Merge pull request #2999 from hzoo/inline-env
Fix transform-inline-environment-variables - fixes #2991
2015-11-11 20:20:36 -05:00
Henry Zhu
837022c2ad Fix transform-inline-environment-variables - fixes #2991 2015-11-11 19:49:19 -05:00
Ben Alpert
e8ebc7074e React inlining: Make sure some props object always exists 2015-11-11 15:33:43 -08:00
Ben Alpert
07a5bcc04a React inlining: Fix transform for computed key
(This was broken before my last change too.)
2015-11-11 15:27:02 -08:00
Sebastian McKenzie
0b7b2e4a3a Merge pull request #2995 from jimfb/master
In JSX-source plugin, handle case where filename or line are null
2015-11-11 14:12:38 -08:00
Sebastian McKenzie
a05330b2e5 Merge pull request #2993 from amasad/2772
Fix #2772
2015-11-11 14:11:58 -08:00
jim
2198f46f53 In JSX-source plugin, handle case where filename or line are null 2015-11-11 14:06:04 -08:00
Amjad Masad
46d8241caf Use node for parent check 2015-11-11 13:30:45 -08:00
Sebastian McKenzie
e63ac82d80 Merge pull request #2970 from amasad/no-const
Convert the constants transform plugin to a validation plugin
2015-11-11 12:55:39 -08:00
Sebastian McKenzie
26abba9880 Merge pull request #2972 from spicyj/inline2
Use a helper function for React "inlining"
2015-11-11 12:39:54 -08:00
Sebastian McKenzie
e75f2ef5bb Merge pull request #2923 from thejameskyle/tjk/doctor-on-win32
Add link to npm upgrade guide on windows
2015-11-11 12:25:21 -08:00
Amjad Masad
352a604fe2 Make sure the test fails 2015-11-11 12:07:23 -08:00
Amjad Masad
6825846c82 Use Symbol.for 2015-11-11 11:06:47 -08:00
Amjad Masad
a17d62ca2b Convert the constants transform plugin to a validation plugin
A follow up from https://github.com/babel/babel/pull/2969 were we added support for consts in the block-scoping plugin.
2015-11-11 10:45:31 -08:00
Amjad Masad
0711fa67b4 ensure block 2015-11-11 10:42:55 -08:00
Amjad Masad
8891ed38b8 cleanup 2015-11-11 10:42:55 -08:00
Amjad Masad
ed4a5fb811 get rid of _let 2015-11-11 10:42:55 -08:00
Amjad Masad
aa8b96bf38 Support consts in block-scoping transform 2015-11-11 10:42:55 -08:00
Amjad Masad
4cca0abd2f move them to the correct place 2015-11-11 10:42:54 -08:00
Amjad Masad
cd6a972342 move test files 2015-11-11 10:42:54 -08:00
Amjad Masad
ea0e55c5af Add failing test 2015-11-11 10:42:54 -08:00
Sebastian McKenzie
65dc981ce9 remove longest name detection and just use 50 2015-11-11 02:52:42 -08:00
Sebastian McKenzie
6f7a81c30d add tagging to npm publish to prevent publish racing 2015-11-11 02:52:14 -08:00
Sebastian McKenzie
538d778064 add 6.1.4 changelog 2015-11-11 02:51:56 -08:00
Sebastian McKenzie
6ca969684e v6.1.4 2015-11-11 02:04:26 -08:00
Sebastian McKenzie
03383bdf31 v6.1.4 2015-11-11 02:04:26 -08:00
Sebastian McKenzie
e09d442be6 remove redundant test 2015-11-11 02:02:39 -08:00
Sebastian McKenzie
ea59e23633 Merge branch 'development' 2015-11-11 02:01:19 -08:00
Sebastian McKenzie
2658adf7e4 Merge branch 'master' of github.com:babel/babel 2015-11-11 02:00:50 -08:00
Ben Alpert
3cad287233 Use a helper function for React "inlining"
Either due to lower parsing costs or better type inference, this seems
to perform better than direct object inlining. (All along, the main win
was skipping a loop through props, not avoiding a function call.)
2015-11-10 21:10:06 -08:00
Amjad Masad
3f41023e02 Merge pull request #2966 from hzoo/npmig
babel-plugin-transform-x: add test to .npmignore
2015-11-10 17:35:55 -08:00
Sebastian McKenzie
f601e62678 add regression test - fixes #2941 2015-11-10 16:02:45 -08:00
Sebastian McKenzie
54c13eef5c fix exported classes with static class properties - fixes #2868 2015-11-10 15:56:22 -08:00
Henry Zhu
4751caab3b babel-plugin-transform-x: add test to .npmignore 2015-11-10 17:53:30 -05:00
Sebastian McKenzie
29f756fd6f add regression tests - closes #2663 2015-11-10 14:40:30 -08:00
Sebastian McKenzie
482e4229db Merge branch 'development' 2015-11-10 14:26:48 -08:00
Sebastian McKenzie
884252b90f increase test coverage 2015-11-10 14:26:40 -08:00
Sebastian McKenzie
e65e6bb19d Merge pull request #2963 from jimfb/master
Added jsx-source plugin
2015-11-10 13:58:24 -08:00
jim
f4049db99d Added jsx-source plugin 2015-11-10 13:49:46 -08:00
Sebastian McKenzie
985e71f288 Merge pull request #2953 from zloirock/update-runtime-definition
Update definition entry points for runtime
2015-11-10 03:43:18 -08:00
Sebastian McKenzie
a55f210c7f fix buildExternalHelpers whitelist not including underscored helpers - fixes #2940 2015-11-10 03:40:35 -08:00
Sebastian McKenzie
28a13bd400 add missing babel-types constants file 2015-11-10 02:54:38 -08:00
ForbesLindesay
5f1329ef5a Fix lint error 2015-11-10 10:38:46 +00:00
ForbesLindesay
650cb22fd8 s/aliases/Aliases:/ 2015-11-10 10:34:36 +00:00
ForbesLindesay
4f9bff0c6b Generate documentation for babel-types 2015-11-10 10:34:36 +00:00
Denis Pushkarev
4b9dc79aa4 update definition entry points for runtime 2015-11-10 15:52:37 +06:00
Sebastian McKenzie
a59e5eecc8 fix cyclic dependency issue in babel-types 2015-11-10 00:16:52 -08:00
Sebastian McKenzie
d96ccd9763 Merge branch 'master' into development 2015-11-10 00:06:41 -08:00
Sebastian McKenzie
06bc0ef50c remove appveyor 2015-11-09 22:58:17 -08:00
Sebastian McKenzie
6044d559ec Merge pull request #2936 from babel/hzoo-patch-1
babel-types: update validators
2015-11-09 20:56:45 -08:00
Sebastian McKenzie
965690ac80 switch appveyor command to install mingw instead of make 2015-11-09 20:55:25 -08:00
Sebastian McKenzie
17d47267ca add choco install make to appveyor 2015-11-09 19:27:10 -08:00
Sebastian McKenzie
4479aed11c add os: unstable to appveyor config 2015-11-09 19:12:31 -08:00
Sebastian McKenzie
70790c2d36 add appveyor badge 2015-11-09 19:04:10 -08:00
James Kyle
3c3ee42850 Merge pull request #2950 from babel/hzoo-patch-2
fix circleci link
2015-11-09 19:03:27 -08:00
Sebastian McKenzie
306be9eb94 add appveyor.yml 2015-11-09 19:02:30 -08:00
Henry Zhu
2f27ca7cb7 fix circleci link 2015-11-09 21:37:42 -05:00
Sebastian McKenzie
5e02ba9b48 remove wanky badges 2015-11-09 18:21:24 -08:00
Sebastian McKenzie
f47be98cf2 Merge branch 'development'
Conflicts:
	package.json
2015-11-09 18:20:23 -08:00
Sebastian McKenzie
8b424452a2 remove open command from test-cov 2015-11-09 18:11:13 -08:00
Sebastian McKenzie
837091e3e9 clean up test-ci task 2015-11-09 17:58:48 -08:00
Sebastian McKenzie
5a8fa4ccf1 add 10s timeout to mocha tests 2015-11-09 17:58:36 -08:00
Sebastian McKenzie
5eeaf6597f add babel-runtime to babel-plugin-transform-regenerator package 2015-11-09 17:42:12 -08:00
Sebastian McKenzie
f53ac0a09c remove assertion 2015-11-09 17:37:23 -08:00
Sebastian McKenzie
10158b5ae7 minor nits 2015-11-09 17:35:51 -08:00
James Kyle
cd11f1e4f5 double quotes 2015-11-09 15:59:43 -08:00
Henry Zhu
ce5b27fed8 babel-types: add validators for core 2015-11-09 17:56:21 -05:00
Henry Zhu
d4a1127012 babel-types: add validators for es2015 exports 2015-11-09 13:54:36 -05:00
Henry Zhu
a2efb41748 Merge pull request #2927 from chalbert/fix-es2015-assertion-type
Fix wrong assertion type on es2015 type definitions
2015-11-09 13:48:17 -05:00
Nicolas Gilbert
68e1e3c90c Merge remote-tracking branch 'babel/master' into fix-es2015-assertion-type
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
2015-11-10 06:40:43 +13:00
Henry Zhu
00b082a3de Merge pull request #2938 from hzoo/eslint
pin eslint to 1.8.0
2015-11-09 11:55:58 -05:00
Henry Zhu
d60be61ced pin eslint to 1.8.0 2015-11-09 10:55:50 -05:00
Sebastian McKenzie
8ecca614ba remove regenerator plugin lib folder 2015-11-09 04:16:53 -08:00
Sebastian McKenzie
6fa85e6f5b clean up babel-plugin-transform-regenerator 2015-11-09 04:15:51 -08:00
Sebastian McKenzie
f047a593df add test coverage to ci 2015-11-09 04:03:59 -08:00
Sebastian McKenzie
63b28ecc89 fix eslint version 2015-11-09 03:38:55 -08:00
Sebastian McKenzie
36493121c1 add circleci 2015-11-09 03:38:50 -08:00
Sebastian McKenzie
f8b22aeee4 use test-only task instead of test in test-travis 2015-11-09 02:58:35 -08:00
Sebastian McKenzie
3bb88bde77 remove some travis cache directories 2015-11-09 02:58:20 -08:00
Sebastian McKenzie
a218f29cc8 add package directories to travis cache 2015-11-09 02:50:46 -08:00
Sebastian McKenzie
bd39ea2611 add polyfill and regenerator options to babel-plugin-transform-runtime 2015-11-09 02:50:39 -08:00
Nicolas Gilbert
3eec81763f Fix wrong assertion type on es2015 type definitions 2015-11-09 21:12:05 +13:00
Sebastian McKenzie
0df276272a add progress bar to bootstrap script and clean up the output 2015-11-08 23:04:29 -08:00
Sebastian McKenzie
15969a0904 move all plugin tests out of babel-core and into their appropriate folders 2015-11-08 23:04:10 -08:00
Sebastian McKenzie
dfd9316e27 abstract out test runner into a module, move traceur and esnext tests to babel-preset-es2015, clean up and make existing tests more consistent 2015-11-08 21:58:01 -08:00
Sebastian McKenzie
5f40b53dee abstract out test runner into a module, move traceur and esnext tests to babel-preset-es2015, clean up and make existing tests more consistent 2015-11-08 21:58:01 -08:00
Sebastian McKenzie
f13ba90f17 Merge branch 'master' into development 2015-11-08 19:42:43 -08:00
Sebastian McKenzie
87be7d0e33 add babel-helper-fixtures usage 2015-11-08 18:53:53 -08:00
Sebastian McKenzie
da20aa90c1 omit defaultProps helper when there are no props 2015-11-08 17:10:33 -08:00
Sebastian McKenzie
e6313dec2c make compiler environment support document more clear 2015-11-08 17:10:21 -08:00
Sebastian McKenzie
65c4fd8fb8 add enter/exit catch-all note to changelog 2015-11-08 17:09:46 -08:00
James Kyle
0f90b6eaf2 Add link to npm upgrade guide on windows. Re: 1c3b4aa410 (commitcomment-14211658) 2015-11-08 15:35:14 -08:00
Sebastian McKenzie
785b01b8cd Merge branch 'development' 2015-11-08 07:22:22 -08:00
Sebastian McKenzie
99b9d20d35 switch travis build badge in readme to only be of the master branch 2015-11-08 06:58:43 -08:00
Sebastian McKenzie
826538790e switch travis build badge in readme to only be of the master branch 2015-11-08 06:58:30 -08:00
Sebastian McKenzie
9b48167a00 switch back to stable flag 2015-11-08 06:56:50 -08:00
Sebastian McKenzie
52363ab8d8 remove err.stack hack 2015-11-08 06:56:18 -08:00
Sebastian McKenzie
81ba799ba4 add compiler support document - closes #2839 2015-11-08 06:51:20 -08:00
Sebastian McKenzie
5f732d1c02 ignore babel-runtime version mismatch in babel-doctor - fixes #2915 2015-11-08 06:43:32 -08:00
Sebastian McKenzie
a2da61a497 switch from stable flag in travis config to 5.0 2015-11-08 06:41:55 -08:00
Sebastian McKenzie
b07f8c8eab fix react inline elements tests 2015-11-08 06:38:45 -08:00
Sebastian McKenzie
1a996cdcc7 move babel-register import down 2015-11-08 06:26:31 -08:00
Sebastian McKenzie
2a1a038031 move children prop pushing to after props to ensure correct order - fixes #2395 2015-11-08 06:24:10 -08:00
Sebastian McKenzie
8f00700b9f fix order of babel-register in test transformation helper script 2015-11-08 06:23:51 -08:00
Sebastian McKenzie
defa9e1b09 change template literal to normal string 2015-11-08 06:23:30 -08:00
Sebastian McKenzie
fc1653694f add custom errorHandler to gulp-plumber 2015-11-08 06:23:21 -08:00
Sebastian McKenzie
6c2cc17d1d fix GLOBAL_VISITOR_PROPS usage 2015-11-08 06:14:23 -08:00
Sebastian McKenzie
c8901cf98d cherry-pick and fix merge conflicts in #2695 - closes #2695 2015-11-08 06:08:18 -08:00
Sebastian McKenzie
d1c4945a13 clean up visitor verification 2015-11-08 06:03:11 -08:00
Sebastian McKenzie
e40c93791c disallow plugins creating catch-all enter/exit handlers - closes #2906 2015-11-08 06:02:57 -08:00
Sebastian McKenzie
064fdb41fc remove use of gulp-rename and add gulp-plumber to prevent crashing on build errors 2015-11-08 06:02:36 -08:00
Sebastian McKenzie
5f8aa92ea3 add Symbol/GetOwnPropertySymbols to traceur ignore tests 2015-11-08 05:42:05 -08:00
Sebastian McKenzie
59759f28bb add Expression alias to TypeCastExpression - fixes #2889 2015-11-08 05:40:05 -08:00
Sebastian McKenzie
bbfb599be2 fix __proto__ clashes in parser in old v8 2015-11-08 05:34:11 -08:00
Sebastian McKenzie
bab696c365 fix __proto__ clashes in parser in old v8 2015-11-08 05:34:11 -08:00
Sebastian McKenzie
0869d321b4 clean up _verifyNodeList error messages 2015-11-08 05:33:51 -08:00
Sebastian McKenzie
bcd639672d add defineEnumerableProperties helper 2015-11-08 05:33:42 -08:00
Sebastian McKenzie
ab6ec75905 add support for computed mutators in babel-plugin-transform-es2015-computed-properties 2015-11-08 05:33:35 -08:00
Sebastian McKenzie
9616e4b06c remove use of template literals in plugin regression exec test for unsupported environments 2015-11-08 05:33:13 -08:00
Sebastian McKenzie
9d8ee901d1 abstract out run exec test logic and add mutiline function 2015-11-08 05:32:59 -08:00
Sebastian McKenzie
288b470e73 reenable node 0.10 2015-11-08 05:32:45 -08:00
Sebastian McKenzie
3076063d47 move babel/register into a separate package 2015-11-08 04:05:13 -08:00
Sebastian McKenzie
b5b9794b3f switch to symbols and add matches parent helper function to abstract out matching 2015-11-08 03:41:15 -08:00
Sebastian McKenzie
f1f42164fc add toString to allow reflection of original traversal methods when wrapping for state 2015-11-08 03:41:00 -08:00
Sebastian McKenzie
8280e18ed4 remove force inheriting of symbols from t.inherits 2015-11-08 03:40:41 -08:00
Sebastian McKenzie
b6807021a8 perform esModule plugin normalisation in the normalisePlugin method rather than only doing it for string plugins 2015-11-08 02:47:22 -08:00
Sebastian McKenzie
5589a583c8 don't use absolute paths when importing the runtime definitions, instead just export it - fixes #2909 2015-11-08 02:44:05 -08:00
Sebastian McKenzie
7b552aee4d Merge pull request #2911 from hzoo/i-2821
babel-generator: ignore if TemplateLiteral - fixes #2821
2015-11-08 02:36:16 -08:00
Sebastian McKenzie
4b5b814872 Merge pull request #2907 from phantom10111/some-fixes
Some fixes in babel-traverse
2015-11-08 02:34:51 -08:00
Henry Zhu
5c33038117 fix ast/spec toc 2015-11-07 20:07:20 -05:00
Henry Zhu
99284822f3 babel-generator: ignore if TemplateLiteral - fixes #2821 2015-11-07 19:55:36 -05:00
Henry Zhu
264c207cb9 Merge pull request #2910 from babel/revert-2858-i-2835
Revert 5508f4de56
2015-11-07 18:15:07 -05:00
Henry Zhu
fa78aba67b Revert 5508f4de56 2015-11-07 18:13:12 -05:00
Henry Zhu
dd13a585a1 Merge pull request #2908 from phantom10111/fix-async-to-generator
Set the correct node type in helper-remap-async-to-generator - fixes #2744
2015-11-07 18:11:44 -05:00
Amjad Masad
4e32e2732f Add test-only to .PHONY 2015-11-07 14:29:23 -08:00
phantom10111
22dc8f8323 Fix scope cache returning an item that was just inserted 2015-11-07 23:09:54 +01:00
phantom10111
e0f1bd76cb Fix clearNode clearing all properties instead of just symbols 2015-11-07 23:09:50 +01:00
phantom10111
1f38dcdf8a Set the correct node type in helper-remap-async-to-generator 2015-11-07 23:06:02 +01:00
Sebastian McKenzie
9d43776fbe add dummy package.json output to bootstrap script 2015-11-06 21:03:22 -05:00
Sebastian McKenzie
0370402a0d fix lint errors 2015-11-06 20:55:05 -05:00
Sebastian McKenzie
bb1703e1a1 add header comment for scope cache function 2015-11-06 20:53:12 -05:00
Sebastian McKenzie
e80c206591 clear and inherit all symbols and underscore propertes in t.inherits and traverse.removeProperties 2015-11-06 20:52:59 -05:00
Sebastian McKenzie
63cd3008d2 clean up parameter names in Scope constructor 2015-11-06 20:42:16 -05:00
Sebastian McKenzie
8dd292075a clean up scope cache 2015-11-06 20:39:16 -05:00
Sebastian McKenzie
acbeda8182 Merge branch 'master' of github.com:babel/babel 2015-11-06 19:56:52 -05:00
Sebastian McKenzie
9a1cf40296 Merge pull request #2861 from hzoo/i-2838
helper-remap-async-to-generator: account for ObjectMethod - fixes #2838
2015-11-06 19:40:30 -05:00
Sebastian McKenzie
a2202802e4 Merge pull request #2866 from hzoo/i-2865
transform-es2015-typeof-symbol: check for undefined - fixes #2865
2015-11-06 19:40:21 -05:00
Sebastian McKenzie
d7adedad3c Merge pull request #2873 from ForbesLindesay/patch-1
Use `i - 1` instead of `--i`
2015-11-06 19:40:07 -05:00
Sebastian McKenzie
b9ac356914 Merge pull request #2887 from amasad/test-only
test-only (minus the lint) make task for faster iteration
2015-11-06 19:38:20 -05:00
Sebastian McKenzie
64688dfe9c Merge pull request #2888 from amasad/plugin-regression
Introduce exec tests for plugin regressions
2015-11-06 19:38:04 -05:00
Amjad Masad
8e2aae7e05 Introduce new tests for plugins 2015-11-06 15:14:20 -08:00
Amjad Masad
4a92be5e2a test-only (minus the lint) make task for faster iteration 2015-11-06 15:10:24 -08:00
Henry Zhu
99af9c60a5 Merge pull request #2882 from lookfirst/patch-1
docs: fixed external helpers plugin name
2015-11-06 16:29:33 -05:00
Jon Stevens
12b1b0b5d9 docs: fixed external helpers plugin name 2015-11-06 13:18:23 -08:00
Forbes Lindesay
1a4f5d80f0 Use i - 1 instead of --i 2015-11-06 14:52:25 +00:00
Henry Zhu
bb5a7804bc transform-es2015-typeof-symbol: check for undefined - fixes #2865 2015-11-06 06:54:51 -05:00
Henry Zhu
042af348bc helper-remap-async-to-generator: account for ObjectMethod - fixes #2838 2015-11-05 23:57:53 -05:00
Sebastian McKenzie
5508f4de56 Merge pull request #2858 from hzoo/i-2835
transform-regenerator: set node.id to an identifier if null - fixes #…
2015-11-06 01:28:37 +00:00
Sebastian McKenzie
6291c46596 Merge pull request #2851 from zertosh/fix-browser-build
Use source-map ^0.5.0
2015-11-06 01:28:33 +00:00
Sebastian McKenzie
0d5f2401f7 Merge pull request #2853 from wesbos/react-display-name
Added react-dispaly-name to the default react package
2015-11-06 01:28:01 +00:00
Henry Zhu
940b86dadb transform-regenerator: set node.id to an identifier if null - fixes #2835 2015-11-05 20:13:05 -05:00
wesbos
c167e6dcc3 Added react-dispaly-name to the default react package 2015-11-05 15:39:36 -05:00
Andres Suarez
af9da3b7e9 Use source-map ^0.5.0 2015-11-05 11:44:35 -08:00
Sebastian McKenzie
fc0baf1e2c Merge pull request #2841 from hzoo/i-2694
transform-es2015-classes: check if node.id is null
2015-11-05 17:09:50 +00:00
Sebastian McKenzie
ff62a33825 Merge pull request #2829 from zloirock/master
Change polyfill compression options
2015-11-05 17:07:30 +00:00
Henry Zhu
f1a62ef078 transform-es2015-classes: check if node.id is null 2015-11-05 10:25:56 -05:00
Sebastian McKenzie
72c5ecf250 add babel-browser sanity check test 2015-11-05 12:58:28 +00:00
Sebastian McKenzie
4d1145f872 add make build to bootstrap script again 2015-11-05 12:45:04 +00:00
Sebastian McKenzie
f16f88d6bb add concurrency to bootstrap script 2015-11-05 12:28:00 +00:00
Sebastian McKenzie
09479378d3 don't compile files if they haven't changed 2015-11-05 11:46:48 +00:00
Sebastian McKenzie
5d61840c10 v6.1.3 2015-11-05 11:31:14 +00:00
Sebastian McKenzie
a6246a5c69 add 6.1.3 changelog 2015-11-05 11:30:20 +00:00
Sebastian McKenzie
51143beab2 add allowTopLevelThis option to babel-plugin-transform-es2015-modules-commonjs 2015-11-05 11:29:39 +00:00
Sebastian McKenzie
3b56b295b2 add 6.1.2 changelog 2015-11-05 11:23:57 +00:00
Sebastian McKenzie
c06576497b v6.1.2 2015-11-05 11:10:22 +00:00
Sebastian McKenzie
f2215915ff v6.1.2 2015-11-05 11:10:22 +00:00
Sebastian McKenzie
5802e2e334 add strict option to bable-plugin-transform-strict-mode 2015-11-05 11:04:14 +00:00
Sebastian McKenzie
35b5ff103c fix mocha.opts reference 2015-11-05 10:00:57 +00:00
Sebastian McKenzie
779675610f fix defaults on type annotated arrow function params - fixes #2493 2015-11-05 09:49:03 +00:00
Sebastian McKenzie
592193321d fix defaults on type annotated arrow function params - fixes #2493 2015-11-05 09:49:03 +00:00
Denis Pushkarev
f82f8b444a change polyfill compression options 2015-11-05 10:42:04 +06:00
Sebastian McKenzie
f4fe578a6c add node existence check to NodePath#has - fixes #2800 2015-11-04 23:38:14 +00:00
Sebastian McKenzie
1bfb7039e9 protect against replacing a class expression with itself when attempting to infer a new function name - fixes #2803 2015-11-04 23:34:33 +00:00
Sebastian McKenzie
1796b1926c Merge pull request #2798 from amasad/fix-2782
Fix recursion in async-to-generator transforms
2015-11-04 19:19:15 +00:00
Sebastian McKenzie
5aa1b29ef8 Merge pull request #2793 from amasad/fix-2789
Convert arrow functions when remaping to generator. Fixes #2789
2015-11-04 19:18:50 +00:00
Sebastian McKenzie
1cfeb391f7 Merge pull request #2784 from tschaub/instanceof-without-symbol
Allow use of instanceof without Symbol
2015-11-04 19:18:14 +00:00
Sebastian McKenzie
2d3c1cc5df Merge pull request #2810 from hzoo/i-2806
Docs: change preset to presets
2015-11-04 19:16:43 +00:00
Sebastian McKenzie
9680bf6a68 Merge pull request #2811 from hzoo/i-2808
transformation-react-inline-elements: ensure invalid identifier JSX attribute keys are quoted - fixes #2808
2015-11-04 19:16:32 +00:00
Sebastian McKenzie
cc7e5ef1b3 Merge pull request #2818 from lijunle/typo-presets
Fix the typo in example: preset -> presets.
2015-11-04 19:16:07 +00:00
Sebastian McKenzie
999158fd31 Merge pull request #2813 from jmm/log-gulp-compilation
Log each file as compiled by build task
2015-11-04 19:15:57 +00:00
Sebastian McKenzie
f0ec155207 Merge pull request #2812 from jmm/make-path-node-bins
Add node_modules/.bin to makefile PATH
2015-11-04 19:15:45 +00:00
Junle
763d1d1f51 Fix the typo: preset -> presets. 2015-11-05 02:10:59 +08:00
Jesse McCarthy
0cd585126a Log each file as compiled. 2015-11-04 10:51:51 -05:00
Jesse McCarthy
25fb2b8410 Add node_modules/.bin to PATH.
Allows local bins, like gulp, to work.
2015-11-04 09:17:18 -05:00
Henry Zhu
f01d2054d4 transformation-react-inline-elements: ensure invalid identifier JSX attribute keys are quoted - fixes #2808 2015-11-04 08:47:09 -05:00
Henry Zhu
0007e4ba72 Docs: change preset to presets 2015-11-04 08:25:08 -05:00
Amjad Masad
2220167903 Fix recursion in async-to-generator transforms
We're naming the inner generator function in the name of the
original async function. This means when people have recursive
await calls it refers to the generator version. Which is fine
if we had a `yield *` (delegate). However, if not it leads to
returning an unresolved generator object.

We can either capture all recursive calls and add a delegate, which
becomes really hard with expressions. I choose to have the name
reserved to the exposed function `retFunction`.

Fixes #2782
2015-11-03 17:05:41 -08:00
Sebastian McKenzie
232439460f switch to gulp for build process 2015-11-04 00:00:18 +00:00
Sebastian McKenzie
bcfe582fef remove json files in favor of just plain js files 2015-11-04 00:00:08 +00:00
Amjad Masad
e33ad7d2fb Convert arrow functions when remaping to generator. Fixes #2789 2015-11-03 14:58:31 -08:00
Sebastian McKenzie
9eee677321 Merge pull request #2790 from moretti/issue-2613
Preserve indentation in template literals, fixes #2613
2015-11-03 20:13:09 +00:00
Sebastian McKenzie
2b6f78df83 fix existential type param parsing 2015-11-03 20:04:55 +00:00
Sebastian McKenzie
0e76a5ace1 fix existential type param parsing 2015-11-03 20:04:55 +00:00
Sebastian McKenzie
4ad8a1dc83 fix es2015-instanceof and es2015-typeof-symbol packages and add README 2015-11-03 19:36:51 +00:00
Sebastian McKenzie
a9ac3b0c94 move instanceof functionality to separate plugin - fixes #2745 2015-11-03 19:22:51 +00:00
Sebastian McKenzie
1c3b4aa410 add npm check to babel-doctor 2015-11-03 19:13:46 +00:00
Paolo Moretti
232bf76b4d preserve original indentation in template literals, fixes #2613 2015-11-03 18:05:26 +00:00
Paolo Moretti
f5bbd09b49 add fixtures for #2613 2015-11-03 18:05:22 +00:00
Tim Schaub
8edb208992 Allow use of instanceof without Symbol 2015-11-03 08:34:35 -08:00
Sebastian McKenzie
30311d121e Merge branch 'master' of github.com:babel/babel
Conflicts:
	packages/babel-core/src/transformation/file/index.js
2015-11-03 14:25:30 +00:00
Sebastian McKenzie
dd76272fb1 fix source map merging - closes #2522, fixes #2336 2015-11-03 14:24:36 +00:00
Sebastian McKenzie
0ef6072445 fix source map merging - closes #2522, fixes #2336 2015-11-03 13:50:06 +00:00
Sebastian McKenzie
4016bae694 add ExistentialTypeParam - fixes #2587 2015-11-03 13:48:03 +00:00
Sebastian McKenzie
7dc1b4e7e9 add ExistentialTypeParam - fixes #2587 2015-11-03 13:48:03 +00:00
Sebastian McKenzie
c3b1b25966 simplify Parser::semicolon method 2015-11-03 11:46:11 +00:00
Sebastian McKenzie
49cbd27441 simplify Parser::semicolon method 2015-11-03 11:46:11 +00:00
Sebastian McKenzie
14ca4d1dc9 add lineBreak test to tt.name.updateContext - fixes #2591 2015-11-03 11:46:01 +00:00
Sebastian McKenzie
b486dfb675 add lineBreak test to tt.name.updateContext - fixes #2591 2015-11-03 11:46:01 +00:00
Sebastian McKenzie
3b3c1897d0 add support for async generator concise methods - fixes #2603 2015-11-03 11:19:04 +00:00
Sebastian McKenzie
d8b17a9eaa add support for async generator concise methods - fixes #2603 2015-11-03 11:19:04 +00:00
Sebastian McKenzie
cbe94f4653 fix object rest/spread in arrow function params - fixes #2631 2015-11-03 11:14:12 +00:00
Sebastian McKenzie
72b6e42b34 fix object rest/spread in arrow function params - fixes #2631 2015-11-03 11:14:12 +00:00
Sebastian McKenzie
8ffc7012cc autoclear cache when it gets too big - fixes #2678 2015-11-03 10:57:32 +00:00
Sebastian McKenzie
cdeff2fbb1 simplify parentheses logic and properly parenthesise unaries - fixes #2711 2015-11-03 10:49:24 +00:00
Sebastian McKenzie
1e725f4806 add babel-browser package - fixes #2635, closes #2721 2015-11-03 10:43:43 +00:00
Sebastian McKenzie
a7f35e39f8 v6.1.1 2015-11-03 10:21:51 +00:00
Sebastian McKenzie
9110cbfbc8 stop looking for configs in babel-doctor when we get to the root 2015-11-03 10:20:57 +00:00
Sebastian McKenzie
c004777efa v6.1.0 2015-11-03 10:06:50 +00:00
Sebastian McKenzie
a31d211e2e remove unused imports 2015-11-03 10:05:39 +00:00
Sebastian McKenzie
a4c3111e55 add 6.1.0 changelog 2015-11-03 10:05:04 +00:00
Sebastian McKenzie
5ee8f7568b add babel-doctor 2015-11-03 10:04:20 +00:00
Sebastian McKenzie
751c53b728 v6.0.20 2015-11-03 04:21:25 +00:00
Sebastian McKenzie
1c08fe3c16 add 6.0.20 changelog 2015-11-03 04:20:26 +00:00
Sebastian McKenzie
59ecfecb9e fix indentation and skip check for references that are inside the function we're checking execution status against 2015-11-03 04:17:38 +00:00
Sebastian McKenzie
91c463c0f7 fix react inline elements plugin when creating properties out of jsx expression containers - fixes #2766 2015-11-03 03:34:46 +00:00
Sebastian McKenzie
c1cceef128 make class constructor call transform ignore derived classes and fix transforming of classes in export default position - fixes #2700 2015-11-03 03:31:05 +00:00
Sebastian McKenzie
f160565004 add 6.0.19 changelog 2015-11-03 03:22:57 +00:00
Sebastian McKenzie
072fffcbdf v6.0.19 2015-11-03 03:14:31 +00:00
Sebastian McKenzie
8ec3e16794 fix remaining outer binding identifier issues 2015-11-03 03:13:39 +00:00
Sebastian McKenzie
64a9a6027e refactor t.getOuterBindingIdentifiers to only return the id if it's a function declaration 2015-11-03 03:05:57 +00:00
Sebastian McKenzie
e72d4508de only use outer bindings when registering a binding to prevent retreiving function params - fixes #2615 2015-11-03 03:00:27 +00:00
Sebastian McKenzie
a639bffcd6 clean up auxiliaryComment 2015-11-03 02:46:00 +00:00
Sebastian McKenzie
924423123b v6.0.18 2015-11-03 01:23:11 +00:00
Sebastian McKenzie
56e9805657 v6.0.18 2015-11-03 01:23:11 +00:00
Sebastian McKenzie
7955548ad1 update docs and add 6.0.18 changelog 2015-11-03 01:21:51 +00:00
Sebastian McKenzie
85dd7ec40e add error for too many builder method args 2015-11-03 01:20:17 +00:00
Sebastian McKenzie
06afafa8ff remove comprehension support from t.getBindingIdentifiers 2015-11-03 01:20:04 +00:00
Sebastian McKenzie
336be752f8 remove state arg from pre and post plugin hooks 2015-11-03 01:19:52 +00:00
Sebastian McKenzie
ea40d0134f rename NumberLiteral to NumericLiteral and RegexLiteral to RegExpLiteral 2015-11-03 01:19:35 +00:00
Sebastian McKenzie
e62a00df50 rename NumberLiteral to NumericLiteral and RegexLiteral to RegExpLiteral 2015-11-03 01:19:35 +00:00
Sebastian McKenzie
87bb8a84f3 v6.0.17 2015-11-02 19:53:45 +00:00
Sebastian McKenzie
9bc95258e6 v6.0.17 2015-11-02 19:53:45 +00:00
Sebastian McKenzie
aeaa4e1d32 fix op declaration in simplify comparison operator plugin 2015-11-02 19:47:18 +00:00
Sebastian McKenzie
83dca691d2 remove use strict directive 2015-11-02 19:47:09 +00:00
Sebastian McKenzie
f8c15c7a78 add 6.0.17 changelog 2015-11-02 19:41:19 +00:00
Sebastian McKenzie
ad7b1c6578 add flow types definition 2015-11-02 19:40:59 +00:00
Sebastian McKenzie
d2b67d5048 remove buggy traceur test 2015-11-02 19:40:27 +00:00
Sebastian McKenzie
ff8bafaece Merge pull request #2754 from hzoo/fix-simp-comp-op
WIP: Fix transform-simplify-comparison-operators plugin
2015-11-02 19:37:28 +00:00
Sebastian McKenzie
cbefcdc7a1 Merge pull request #2723 from devongovett/master
Remove assert from regenerator plugin
2015-11-02 19:32:57 +00:00
Henry Zhu
44e64c41f8 Fix transform-simplify-comparison-operators plugin 2015-11-02 14:31:48 -05:00
Sebastian McKenzie
d91fab7337 Merge pull request #2528 from STRML/react-inline-children-fix
optimisations.react.inline: don't pass empty array.
2015-11-02 19:31:26 +00:00
Sebastian McKenzie
82dbbc95e1 Merge pull request #2737 from babel/thejameskyle-patch-1
Fix minify-booleans transform
2015-11-02 19:27:53 +00:00
Sebastian McKenzie
0767616934 Merge pull request #2749 from douglasduteil/chore-travis-run-tests-on-latest-stable-version
chore(travis): run tests on latest stable version
2015-11-02 19:27:34 +00:00
Sebastian McKenzie
cbafed0f50 Merge pull request #2748 from douglasduteil/chore-travis-faster-travis-with-git-depth-1
chore(travis): faster travis with git --depth 1
2015-11-02 19:27:29 +00:00
Sebastian McKenzie
31a6cb9c57 add Symbol existence check to typeof helper - closes #2745 2015-11-02 19:26:49 +00:00
Sebastian McKenzie
d1d0ed901e fix export of parameters when renaming the binding of exported functions - fixes #2753 2015-11-02 19:24:23 +00:00
Sebastian McKenzie
2bdc222c0b wWhen merging options, take precedence over the current array - fixes #2648 2015-11-02 19:21:24 +00:00
Douglas Duteil
c4cbdc22e7 chore(travis): run tests on latest stable version 2015-11-02 14:18:12 +01:00
Douglas Duteil
a7951ae29c chore(travis): faster travis with git --depth 1 2015-11-02 14:12:52 +01:00
James Kyle
45d8ac7c12 Add minify-booleans test 2015-11-02 00:38:56 -08:00
James Kyle
b32e0f540c Fix minify-booleans transform. Fixes #2736 2015-11-02 00:24:45 -08:00
Sebastian McKenzie
c2973d0c7a disallow invalid async function forms inside object literals - fixes #2629 2015-11-02 08:00:01 +00:00
Sebastian McKenzie
72f384bb29 disallow invalid async function forms inside object literals - fixes #2629 2015-11-02 08:00:01 +00:00
Sebastian McKenzie
9e5a9b77b4 add AST spec 2015-11-02 07:31:41 +00:00
Sebastian McKenzie
d730f349e6 v6.0.16 2015-11-02 07:13:43 +00:00
Sebastian McKenzie
7a3fef26fa update tests 2015-11-02 07:11:12 +00:00
Sebastian McKenzie
80dfe05ffc add 6.0.16 changelog 2015-11-02 07:08:28 +00:00
Sebastian McKenzie
d2d48e9f7f fix bug where async class methods weren't having their awaits converted to yields in the async to generator helper - fixes #2661 2015-11-02 07:05:00 +00:00
Sebastian McKenzie
41ccee89c9 fix runtime plugin helper generation - fixes #2726 2015-11-02 06:56:36 +00:00
Sebastian McKenzie
6ccee750e3 check for path existence before checking that it's the correct instance 2015-11-02 06:42:48 +00:00
Sebastian McKenzie
24f5ef50b0 when we encounter a different NodePath instance, ignore it and create a new one. this is going to thrash the tree and memory but npm and node module resolution is atrociously bad 2015-11-02 06:36:07 +00:00
Sebastian McKenzie
740c76e53a ignore non-origin template nodes when replacing placeholders in babel-template - fixes #2664 2015-11-02 06:31:17 +00:00
Sebastian McKenzie
bfc58917ad Merge branch 'master' of github.com:babel/babel 2015-11-02 05:25:23 +00:00
Sebastian McKenzie
9fe9a1e76e ensure there's a newline after prepended original shebang - fixes #2719 2015-11-02 05:25:12 +00:00
James Kyle
f892938a8f Merge pull request #2733 from ariporad/patch-1
Fix typo related to name change.
2015-11-01 20:05:18 -08:00
Ari Porad
d631f38209 Fix typo related to name change. 2015-11-01 20:02:23 -08:00
Sebastian McKenzie
c865cb4bf9 v6.0.15 2015-11-01 22:07:03 +00:00
Devon Govett
fde11131a9 Remove assert from regenerator plugin 2015-11-01 09:58:04 -08:00
Sebastian McKenzie
9702ceb074 remove property mutators transfrom from esnext computed properties test 2015-11-01 06:01:48 +00:00
Sebastian McKenzie
f7073383e3 fix some tests to run on node 0.10 2015-11-01 05:01:34 +00:00
Sebastian McKenzie
bbb1db7e6d add arrow functions transform to jscript test plugins 2015-11-01 04:39:43 +00:00
Sebastian McKenzie
39bdecb119 fix async function remap helper from outputing incorrect calls causing wrong scoping - fixes #2708 - fixes #2715 2015-11-01 04:39:31 +00:00
Sebastian McKenzie
f89724929e remove parse test helper 2015-11-01 03:38:22 +00:00
Sebastian McKenzie
c846c94771 Merge branch 'master' of github.com:babel/babel
t push
2015-11-01 00:23:25 +00:00
James Kyle
25cb82c611 Fix link 2015-10-31 15:06:11 -07:00
James Kyle
2957bd7f2b Add note about transform-es2015-block-scoping 2015-10-31 14:08:14 -07:00
Sebastian McKenzie
a1dd25104a add preset name to couldn't find preset message 2015-10-31 20:52:46 +00:00
Sebastian McKenzie
bfef4fa46a fix transform locations in tests 2015-10-31 20:52:36 +00:00
Sebastian McKenzie
f1a92bbb59 Merge pull request #2701 from goto-bus-stop/stages-readme
add readme files to stage-N presets
2015-10-31 16:27:45 +00:00
René Kooi
f4d8083530 add readme files to stage-N presets
Copied from the es2015/react presets.
2015-10-31 11:59:36 +01:00
Sebastian McKenzie
0dd64f3ce9 Merge branch 'master' of github.com:babel/babel
t push
2015-10-31 06:32:14 +00:00
Sebastian McKenzie
d83d8f8e5d babel-generator -> babylon 2015-10-31 06:21:05 +00:00
Sebastian McKenzie
b5b7e346a0 Merge pull request #2697 from shuhei/enable-plugins-built-with-babel-6
Enable plugins built with Babel 6.0
2015-10-31 06:14:29 +00:00
Sebastian McKenzie
231017d3ae return -> path.replaceWith - fixes #2699 2015-10-31 06:13:42 +00:00
Shuhei Kagawa
81b7af2808 enable plugins built with babel 6.0 2015-10-31 12:17:42 +09:00
Sebastian McKenzie
22fb054a7a Merge pull request #2696 from shuhei/fix-external-helpers-2-readme
Fix plugin names in the README of babel-plugin-external-helpers-2
2015-10-31 02:55:34 +00:00
Shuhei Kagawa
e5454343b1 fix plugin names in the readme of babel-plugin-external-helpers-2 2015-10-31 10:24:43 +09:00
Sebastian McKenzie
950f4b2aea ensure package.json files have a newline 2015-10-31 01:02:44 +00:00
Sebastian McKenzie
66440a92ae add babylon to devDependencies of babel-generator 2015-10-31 01:02:12 +00:00
Sebastian McKenzie
8c6ab3aa26 add missing npmignores 2015-10-30 23:45:42 +00:00
Sebastian McKenzie
8e35c0b615 fix babel-runtime version in some packages 2015-10-30 23:45:34 +00:00
Sebastian McKenzie
7fabc4c83d v6.0.14 2015-10-30 23:30:40 +00:00
Sebastian McKenzie
34665bdfda v6.0.14 2015-10-30 23:30:40 +00:00
Sebastian McKenzie
2a7c16b045 add missing chalk dependency 2015-10-30 23:29:43 +00:00
Sebastian McKenzie
bfd333b602 change version of babel-runtime that babel-template uses 2015-10-30 23:28:14 +00:00
Sebastian McKenzie
fbbb42e79e bump mocha-fixtures to 2 2015-10-30 23:26:35 +00:00
Sebastian McKenzie
1ba7ff873c remove excess newline 2015-10-30 23:26:28 +00:00
Sebastian McKenzie
3d842df554 update exponentiation operator precedence - fixes #2431 2015-10-30 23:14:10 +00:00
Sebastian McKenzie
8748ff0802 update exponentiation operator precedence - fixes #2431 2015-10-30 23:14:10 +00:00
Sebastian McKenzie
3c2208cdf6 Merge branch 'master' of github.com:babel/babel 2015-10-30 22:51:09 +00:00
Sebastian McKenzie
370b7913b4 add ArrowFunctionExpression parentheses logic 2015-10-30 22:51:02 +00:00
Sebastian McKenzie
c224a7a370 fix parser bug where arrow functions have a higher precedence than they should - fixes #2118 2015-10-30 22:50:53 +00:00
Sebastian McKenzie
7012116f4e fix parser bug where arrow functions have a higher precedence than they should - fixes #2118 2015-10-30 22:50:53 +00:00
Sebastian McKenzie
d7dbd1ec4a Merge pull request #2690 from hzoo/patch-1
update 6.0.0 changelog
2015-10-30 19:47:51 +00:00
Henry Zhu
cea7e1a20d Update CHANGELOG.md 2015-10-30 15:28:39 -04:00
Henry Zhu
c87bc3d3fd update 6.0.0 changelog 2015-10-30 15:25:17 -04:00
Sebastian McKenzie
37294c3c0a Merge branch 'master' of github.com:babel/babel 2015-10-30 19:17:19 +00:00
Sebastian McKenzie
37159fbc7d Merge branch 'master' of github.com:babel/babel 2015-10-30 19:17:19 +00:00
Sebastian McKenzie
822a5903c9 add plugin traversal/visitor method changes to changelog 2015-10-30 19:17:13 +00:00
Sebastian McKenzie
466f22afff fix babel-runtime dependencies - fixes #2655 2015-10-30 19:16:42 +00:00
Sebastian McKenzie
255288cda5 fix babel-runtime dependencies - fixes #2655 2015-10-30 19:16:42 +00:00
James Kyle
19d1b53fc5 Update package.json 2015-10-30 11:38:02 -07:00
James Kyle
753d0f7995 Update package.json 2015-10-30 11:38:02 -07:00
James Kyle
e9deab1dfc Update package.json 2015-10-30 11:38:01 -07:00
James Kyle
20e002a313 Update package.json 2015-10-30 11:38:00 -07:00
James Kyle
6e3f61747b Update package.json 2015-10-30 11:37:59 -07:00
James Kyle
6666698b97 Update package.json 2015-10-30 11:37:58 -07:00
James Kyle
24d3216a73 Update package.json 2015-10-30 11:37:57 -07:00
James Kyle
ba30fbb759 Update package.json 2015-10-30 11:37:56 -07:00
James Kyle
0468dad22f Update package.json 2015-10-30 11:37:54 -07:00
James Kyle
8e726889e2 Update package.json 2015-10-30 11:37:53 -07:00
James Kyle
70e9892f1e Update package.json 2015-10-30 11:37:52 -07:00
James Kyle
76837351b8 Update package.json 2015-10-30 11:37:51 -07:00
James Kyle
c8b6c00719 Update package.json 2015-10-30 11:37:50 -07:00
James Kyle
8a1592132b Update package.json 2015-10-30 11:37:49 -07:00
James Kyle
f7003c2393 Update package.json 2015-10-30 11:37:48 -07:00
James Kyle
fca45816c5 Update package.json 2015-10-30 11:37:47 -07:00
James Kyle
6a2e0ff163 Update package.json 2015-10-30 11:37:46 -07:00
James Kyle
8c2f50a4c6 Update package.json 2015-10-30 11:37:44 -07:00
James Kyle
a0cf4ecf4a Update package.json 2015-10-30 11:37:43 -07:00
James Kyle
5cc5335255 Update package.json 2015-10-30 11:37:42 -07:00
James Kyle
36b363d097 Update package.json 2015-10-30 11:37:40 -07:00
James Kyle
dbf90e1525 Update package.json 2015-10-30 11:37:39 -07:00
James Kyle
a3b6eceea9 Update package.json 2015-10-30 11:37:38 -07:00
James Kyle
ea5ae3845a Update package.json 2015-10-30 11:37:37 -07:00
James Kyle
5e3fee2258 Update package.json 2015-10-30 11:37:35 -07:00
James Kyle
975fafddc5 Update package.json 2015-10-30 11:37:34 -07:00
James Kyle
e206a94f5f Update package.json 2015-10-30 11:37:33 -07:00
James Kyle
97aea37e7d Update package.json 2015-10-30 11:37:32 -07:00
James Kyle
0ee654d2cf Update package.json 2015-10-30 11:37:31 -07:00
James Kyle
f1ccc86603 Update package.json 2015-10-30 11:37:30 -07:00
James Kyle
b45231e04b Update package.json 2015-10-30 11:37:28 -07:00
James Kyle
46f34fbc2f Update package.json 2015-10-30 11:37:27 -07:00
James Kyle
cd8c9369b0 Update package.json 2015-10-30 11:37:26 -07:00
James Kyle
735efad255 Update package.json 2015-10-30 11:37:25 -07:00
James Kyle
b46271bb12 Update package.json 2015-10-30 11:37:24 -07:00
James Kyle
01e09c06c0 Update package.json 2015-10-30 11:37:23 -07:00
James Kyle
5f249b3928 Update package.json 2015-10-30 11:37:21 -07:00
James Kyle
8192a095d4 Update package.json 2015-10-30 11:37:20 -07:00
James Kyle
c1f5536154 Update package.json 2015-10-30 11:37:19 -07:00
James Kyle
dd3d2d4b44 Update package.json 2015-10-30 11:37:18 -07:00
James Kyle
b0c31153a4 Update package.json 2015-10-30 11:37:17 -07:00
James Kyle
317f14b146 Update package.json 2015-10-30 11:37:16 -07:00
James Kyle
38700bc784 Update package.json 2015-10-30 11:37:14 -07:00
James Kyle
38ad512d50 Update package.json 2015-10-30 11:37:13 -07:00
James Kyle
f8ae60d143 Update package.json 2015-10-30 11:37:11 -07:00
James Kyle
aa230e69de Update package.json 2015-10-30 11:37:10 -07:00
James Kyle
c5c0609f92 Update package.json 2015-10-30 11:37:09 -07:00
James Kyle
4e21e72b7f Update package.json 2015-10-30 11:37:08 -07:00
James Kyle
afbabaa4f8 Update package.json 2015-10-30 11:37:07 -07:00
James Kyle
9c69800806 Update package.json 2015-10-30 11:37:05 -07:00
James Kyle
c954658786 Update package.json 2015-10-30 11:37:04 -07:00
James Kyle
7725e768aa Update package.json 2015-10-30 11:37:03 -07:00
James Kyle
5c5d53dca1 Update package.json 2015-10-30 11:37:02 -07:00
James Kyle
8d67c17a69 Update package.json 2015-10-30 11:37:01 -07:00
James Kyle
af80279a84 Update package.json 2015-10-30 11:37:00 -07:00
James Kyle
0441b7d688 Update package.json 2015-10-30 11:36:59 -07:00
James Kyle
f3d09cd6d0 Update package.json 2015-10-30 11:36:58 -07:00
James Kyle
3d959d7567 Update package.json 2015-10-30 11:36:57 -07:00
James Kyle
7ae7b6e607 Update package.json 2015-10-30 11:36:56 -07:00
James Kyle
b41ffd2b48 Update package.json 2015-10-30 11:36:55 -07:00
James Kyle
04022eb5be Update package.json 2015-10-30 11:36:54 -07:00
James Kyle
bc5204fe70 Update package.json 2015-10-30 11:36:53 -07:00
James Kyle
f8d991abf4 Update package.json 2015-10-30 11:36:52 -07:00
James Kyle
c8f951d141 Update package.json 2015-10-30 11:36:51 -07:00
James Kyle
8aa1b740b7 Update package.json 2015-10-30 11:36:50 -07:00
James Kyle
c63796f201 Update package.json 2015-10-30 11:36:49 -07:00
James Kyle
ec9781330c Update package.json 2015-10-30 11:36:48 -07:00
James Kyle
302a694907 Update package.json 2015-10-30 11:36:47 -07:00
James Kyle
af780ed52c Update package.json 2015-10-30 11:36:46 -07:00
James Kyle
765ed24470 Update package.json 2015-10-30 11:36:45 -07:00
James Kyle
9af5e78405 Update package.json 2015-10-30 11:36:44 -07:00
James Kyle
d4aa50b83c Update package.json 2015-10-30 11:36:44 -07:00
James Kyle
11fedeefb1 Update package.json 2015-10-30 11:36:43 -07:00
James Kyle
939082c37d Update package.json 2015-10-30 11:36:42 -07:00
James Kyle
176cbb8a7d Update package.json 2015-10-30 11:36:41 -07:00
James Kyle
525ab6ca05 Update package.json 2015-10-30 11:20:55 -07:00
James Kyle
5c11db5eda Update package.json 2015-10-30 11:20:54 -07:00
James Kyle
32f40d58da Update package.json 2015-10-30 11:20:54 -07:00
James Kyle
95e024dc19 Update package.json 2015-10-30 11:20:53 -07:00
James Kyle
91ccea4c95 Update package.json 2015-10-30 11:20:52 -07:00
James Kyle
0aac550f14 Update package.json 2015-10-30 11:20:51 -07:00
James Kyle
4cc7aaa798 Update package.json 2015-10-30 11:20:50 -07:00
James Kyle
febb791ffd Update package.json 2015-10-30 11:20:50 -07:00
James Kyle
83d8fa71f4 Update package.json 2015-10-30 11:20:49 -07:00
James Kyle
1882a2a4c8 Update package.json 2015-10-30 11:20:48 -07:00
James Kyle
6097188029 Update package.json 2015-10-30 11:18:10 -07:00
James Kyle
820abf41f7 Update package.json 2015-10-30 11:18:08 -07:00
James Kyle
a70b853006 Update package.json 2015-10-30 11:18:06 -07:00
James Kyle
c062288677 Update package.json 2015-10-30 11:18:03 -07:00
James Kyle
f3495fb133 Update package.json 2015-10-30 11:17:58 -07:00
James Kyle
bf10ba70e3 Update package.json 2015-10-30 11:17:55 -07:00
James Kyle
4d0b3ff823 Update package.json 2015-10-30 11:17:53 -07:00
James Kyle
ff21d392cc Update package.json 2015-10-30 11:17:51 -07:00
James Kyle
aeb8bb4861 Update package.json 2015-10-30 11:17:47 -07:00
James Kyle
810a64b201 Update package.json 2015-10-30 11:17:45 -07:00
James Kyle
8eef26c2ff Update package.json 2015-10-30 11:15:19 -07:00
James Kyle
c582d41ea5 Update package.json 2015-10-30 11:15:00 -07:00
James Kyle
d178c40991 Update package.json 2015-10-30 11:14:44 -07:00
James Kyle
6adf5428d8 Update package.json 2015-10-30 11:14:28 -07:00
James Kyle
30e651b21c Update package.json 2015-10-30 11:13:41 -07:00
Sebastian McKenzie
9aefb03625 when publishing, don't override 5.x dependencies 2015-10-30 18:13:29 +00:00
James Kyle
8c5f1a6a07 Update package.json 2015-10-30 11:13:23 -07:00
Sebastian McKenzie
bf514620e2 start on 6.0.0 changelog 2015-10-30 18:13:16 +00:00
Sebastian McKenzie
9926cd998b add 6.0.14 changelog 2015-10-30 18:13:10 +00:00
James Kyle
6665198287 Update package.json 2015-10-30 11:13:03 -07:00
James Kyle
5135d4a35a Update package.json 2015-10-30 11:12:47 -07:00
James Kyle
a7966e283c Update package.json 2015-10-30 11:12:27 -07:00
James Kyle
6b0c4a8349 Update package.json 2015-10-30 11:11:59 -07:00
James Kyle
013afd8dbb Update package.json 2015-10-30 11:11:30 -07:00
James Kyle
92b1f5046b Update babel-helper-bindify-decorators repository field 2015-10-30 11:11:05 -07:00
James Kyle
b8d5d2fc78 Update babel-generator repository field 2015-10-30 11:10:27 -07:00
James Kyle
b0f4f6b55f Update babel-core repository field 2015-10-30 11:10:04 -07:00
James Kyle
a4b9d89d22 Update babel-code-frame repository field 2015-10-30 11:09:40 -07:00
James Kyle
51046391c0 Update babel-cli repository field 2015-10-30 11:08:56 -07:00
Sebastian McKenzie
a025432c31 Merge pull request #2649 from hzoo/stage-x-presets
add stage-x presets
2015-10-30 18:02:25 +00:00
Sebastian McKenzie
d3268a5cda when using regenerator in the es2015 preset, don't transform async and asyncGenerators 2015-10-30 17:59:54 +00:00
Sebastian McKenzie
f72802bec9 hoist requires required for core-js build-dist 2015-10-30 17:58:49 +00:00
Sebastian McKenzie
c91509b87a Merge pull request #2651 from babel/thejameskyle-patch-1
Remove unused Lodash import
2015-10-30 17:57:22 +00:00
Sebastian McKenzie
e92b0cad69 move up core-js in babel-runtime build-dist 2015-10-30 17:54:10 +00:00
Sebastian McKenzie
5c7f88a5fb fix parameters after defaults in arrow functions refering to the wrong arguments - fixes #2682 2015-10-30 17:39:57 +00:00
Sebastian McKenzie
e440fef815 Merge pull request #2657 from zertosh/fix-tr-es3-prop-literals
fix transform-es3-property-literals
2015-10-30 17:31:09 +00:00
Sebastian McKenzie
60748578fd fix bin cli shebang 2015-10-30 17:18:31 +00:00
Sebastian McKenzie
309a7556ff ensure that invalid identifier JSX attribute keys are quoted when transforming to calls - fixes #2675 2015-10-30 17:16:47 +00:00
Sebastian McKenzie
5bda4d9744 Merge branch 'master' of github.com:babel/babel 2015-10-30 17:05:37 +00:00
Sebastian McKenzie
26cb025151 fix SystemJS module formatter exporting function parameters - fixes #2681 2015-10-30 17:05:26 +00:00
James Kyle
814c4acacf Merge pull request #2659 from sindresorhus/patch-1
only include the `lib` folder in the `babel-generator` package
2015-10-29 23:08:25 -07:00
Sindre Sorhus
b8c5032830 only include the lib folder in the package
currently, over a megabyte is wasted on including the `test` folder
2015-10-30 13:04:00 +07:00
Andres Suarez
eb5507d644 fix transform-es3-property-literals 2015-10-29 22:57:23 -07:00
Sebastian McKenzie
3a7d258c5c v6.0.13 2015-10-30 05:07:39 +00:00
Sebastian McKenzie
b81039e3e5 don't consider uncomputed object method property identifier to be a reference - fixes #2650 2015-10-30 05:06:45 +00:00
Sebastian McKenzie
b5e0ab97d1 add 6.0.12 changelog 2015-10-30 04:57:22 +00:00
Sebastian McKenzie
69f17f7df1 v6.0.12 2015-10-30 04:53:38 +00:00
Sebastian McKenzie
fb1da98c47 bump babel-plugin-transform-runtime version in babel-runtime 2015-10-30 04:52:30 +00:00
Sebastian McKenzie
24df725f48 add use strict directive to modules tests 2015-10-30 04:52:30 +00:00
Sebastian McKenzie
08aac0bf06 add runtime build to bootstrap script 2015-10-30 04:52:29 +00:00
Sebastian McKenzie
79f39c3be1 add strict mode plugin to module transforms 2015-10-30 04:52:29 +00:00
Sebastian McKenzie
268a1f80a0 only ignore cloning of plugins 2015-10-30 04:52:29 +00:00
Sebastian McKenzie
a365fd74a5 add 6.0.0 changelog placeholder 2015-10-30 04:52:29 +00:00
James Kyle
1a772d5cbf Remove unused Lodash import 2015-10-29 21:26:44 -07:00
James Kyle
5e2c0b3859 Update package.json 2015-10-29 21:20:05 -07:00
James Kyle
ecb4ae405f Add babel-template README 2015-10-29 21:19:55 -07:00
Henry Zhu
8a4fa3725f add stage-x presets 2015-10-30 00:04:01 -04:00
James Kyle
448b3948bd Update README.md 2015-10-29 20:55:08 -07:00
James Kyle
1d5ad67764 Update package.json 2015-10-29 20:54:59 -07:00
James Kyle
2d499734fd Add babel-preset-react README 2015-10-29 20:54:46 -07:00
James Kyle
c7573c43ee Update package.json 2015-10-29 20:53:51 -07:00
James Kyle
b698c31ddc Add babel-preset-es2015 README 2015-10-29 20:53:40 -07:00
James Kyle
820a2fc5fb Delete README.md 2015-10-29 20:45:33 -07:00
James Kyle
01d3197792 Update package.json 2015-10-29 20:38:27 -07:00
James Kyle
c10c3f4ce4 Add babel-messages README 2015-10-29 20:38:12 -07:00
James Kyle
98ddc81676 Update package.json 2015-10-29 20:34:17 -07:00
James Kyle
2d2259890d Add babel-helpers README 2015-10-29 20:33:49 -07:00
James Kyle
cbbeb26a08 Update package.json 2015-10-29 20:15:19 -07:00
James Kyle
1d377986c4 Add babel-core README 2015-10-29 20:15:06 -07:00
James Kyle
818cec5b83 Update README.md 2015-10-29 19:57:48 -07:00
James Kyle
b58bad532b Fix install for babel-code-frame 2015-10-29 19:57:25 -07:00
James Kyle
585612a41f Add babel-code-frame package.json description 2015-10-29 19:56:49 -07:00
James Kyle
3274a40bbf Add babel-code-frame README 2015-10-29 19:56:25 -07:00
James Kyle
a4bdfb1bbe Update package.json 2015-10-29 19:39:01 -07:00
James Kyle
0d561cf60c Add babel-cli README 2015-10-29 19:37:00 -07:00
Sebastian McKenzie
292af5f5a2 t push
Merge branch 'master' of github.com:babel/babel
2015-10-30 02:30:20 +00:00
James Kyle
58ef0bba08 Add babel-generator package.json description 2015-10-29 19:29:09 -07:00
James Kyle
2c8b0e420a Add babel-generator README 2015-10-29 19:28:05 -07:00
Samuel Reed
b98d24594a optimisations.react.inline: don't pass empty array.
This fixes incompatibilities with code that check for the existence
of children.
2015-10-29 21:18:07 -05:00
Sebastian McKenzie
d8ee84edd1 remove asserts from babel-transform-regenerator 2015-10-30 01:39:32 +00:00
Sebastian McKenzie
1ac63f11f1 add shebang to babel/cli complain scirpt 2015-10-30 01:39:32 +00:00
Sebastian McKenzie
f058b07375 add babel-plugin-transform-regenerator/lib 2015-10-30 01:39:32 +00:00
James Kyle
b9160b3a6c Merge pull request #2639 from existentialism/typo-2
Fix typo
2015-10-29 18:07:09 -07:00
Brian Ng
d9b89200e3 Fix typo 2015-10-29 20:04:16 -05:00
Sebastian McKenzie
470d5738e1 Merge branch 'development'
Conflicts:
	VERSION
	packages/babel-cli/package.json
	packages/babel-generator/src/buffer.js
	packages/babel-runtime/package.json
	packages/babel-traverse/src/scope/index.js
	packages/babel-types/src/validators.js
	packages/babel/package.json
	packages/babel/src/generation/generators/expressions.js
	packages/babel/src/generation/generators/statements.js
	packages/babel/src/transformation/transformers/es6/tail-call.js
	packages/babel/src/transformation/transformers/es7/async-functions.js
	packages/babel/src/transformation/transformers/es7/exponentiation-operator.js
	packages/babel/src/types/retrievers.js
	packages/babel/test/fixtures/transformation/es6.tail-call/default-parameters/expected.js
	packages/babel/test/fixtures/transformation/es6.tail-call/factorial/expected.js
	packages/babel/test/fixtures/transformation/es6.tail-call/max-args/expected.js
	packages/babel/test/fixtures/transformation/es6.tail-call/recursion/expected.js
	packages/babylon/package.json
2015-10-30 00:48:36 +00:00
Sebastian McKenzie
0b88a89b87 Merge branch 'development'
Conflicts:
	VERSION
	packages/babel-cli/package.json
	packages/babel-generator/src/buffer.js
	packages/babel-runtime/package.json
	packages/babel-traverse/src/scope/index.js
	packages/babel-types/src/validators.js
	packages/babel/package.json
	packages/babel/src/generation/generators/expressions.js
	packages/babel/src/generation/generators/statements.js
	packages/babel/src/transformation/transformers/es6/tail-call.js
	packages/babel/src/transformation/transformers/es7/async-functions.js
	packages/babel/src/transformation/transformers/es7/exponentiation-operator.js
	packages/babel/src/types/retrievers.js
	packages/babel/test/fixtures/transformation/es6.tail-call/default-parameters/expected.js
	packages/babel/test/fixtures/transformation/es6.tail-call/factorial/expected.js
	packages/babel/test/fixtures/transformation/es6.tail-call/max-args/expected.js
	packages/babel/test/fixtures/transformation/es6.tail-call/recursion/expected.js
	packages/babylon/package.json
2015-10-30 00:48:36 +00:00
Sebastian McKenzie
25f78c356e v6.0.11 2015-10-30 00:13:15 +00:00
Sebastian McKenzie
198025aea9 add babel-plugin-transform-es2015-modules-commonjs to babel-preset-es2015 2015-10-29 23:49:03 +00:00
James Kyle
4905f59456 Merge pull request #2630 from mquandalle/patch-2
Add Meteor as a Monorepo example
2015-10-29 14:55:00 -07:00
Maxime Quandalle
b23ffca1cb Add Meteor as a Monorepo example 2015-10-29 22:52:04 +01:00
Sebastian McKenzie
90b125bc1d v6.0.10 2015-10-29 18:54:16 +00:00
Sebastian McKenzie
ac70f690e9 fix babel-plugin-transform-regenerator dependencies 2015-10-29 18:53:40 +00:00
Sebastian McKenzie
08c87ddcfd v6.0.9 2015-10-29 18:50:17 +00:00
Sebastian McKenzie
a4cedf62a2 v6.0.8 2015-10-29 18:47:35 +00:00
Sebastian McKenzie
ec45294111 v6.0.7 2015-10-29 18:45:13 +00:00
Sebastian McKenzie
7501582d56 v6.0.6 2015-10-29 18:44:09 +00:00
Sebastian McKenzie
a9b1c3ee52 fix plugin reference 2015-10-29 18:43:02 +00:00
Sebastian McKenzie
ff99383b5b v6.0.5 2015-10-29 18:41:24 +00:00
Sebastian McKenzie
2889e01e1e fix plugin name 2015-10-29 18:40:34 +00:00
Sebastian McKenzie
6e3f794cd4 add empty src directory 2015-10-29 18:33:52 +00:00
Sebastian McKenzie
3185741bcd newline 2015-10-29 18:32:26 +00:00
Sebastian McKenzie
40ec120b32 temporarily hide regenerator tests 2015-10-29 18:29:32 +00:00
Sebastian McKenzie
aea351636f add babel-plugin-transform-regenerator 2015-10-29 18:28:30 +00:00
Sebastian McKenzie
301912d9c6 add babel-types package to babel-plugin-transform-es2015-classes 2015-10-29 18:25:05 +00:00
Sebastian McKenzie
182bea64a8 remove babel-plugin-transform-regenerator 2015-10-29 18:24:52 +00:00
Sebastian McKenzie
d7610ef9b0 v6.0.2 2015-10-29 18:06:55 +00:00
Sebastian McKenzie
a8cf46d8f4 v6.0.2 2015-10-29 18:06:55 +00:00
Sebastian McKenzie
7ff965a6f8 v6.0.1 2015-10-29 18:04:29 +00:00
Sebastian McKenzie
32ef6b465b v6.0.0 2015-10-29 18:02:15 +00:00
Sebastian McKenzie
b2af8af7c8 v6.0.0 2015-10-29 18:02:15 +00:00
Sebastian McKenzie
b909a81ab7 6.0.0
I'm extremely stupid and didn't commit as I go. To anyone reading this
I'm extremely sorry. A lot of these changes are very broad and I plan on
releasing Babel 6.0.0 today live on stage at Ember Camp London so I'm
afraid I couldn't wait. If you're ever in London I'll buy you a beer
(or assorted beverage!) to make up for it, also I'll kiss your feet and
give you a back massage, maybe.
2015-10-29 17:51:24 +00:00
Sebastian McKenzie
ae7d5367f1 6.0.0
I'm extremely stupid and didn't commit as I go. To anyone reading this
I'm extremely sorry. A lot of these changes are very broad and I plan on
releasing Babel 6.0.0 today live on stage at Ember Camp London so I'm
afraid I couldn't wait. If you're ever in London I'll buy you a beer
(or assorted beverage!) to make up for it, also I'll kiss your feet and
give you a back massage, maybe.
2015-10-29 17:51:24 +00:00
Sebastian McKenzie
bb8b6ab718 v5.8.33 2015-10-29 08:40:32 +00:00
Sebastian McKenzie
de12747a3c comment out semicolon removal for right braces in code generator - fixes #2621 2015-10-29 08:39:48 +00:00
Sebastian McKenzie
08fafb748c v5.8.32 2015-10-28 23:15:16 +00:00
Sebastian McKenzie
794f696a59 don't register function as binding path for params 2015-10-28 23:09:56 +00:00
Sebastian McKenzie
953a121aad make the binding path for a function declaration the function itself 2015-10-28 23:06:47 +00:00
Sebastian McKenzie
25daed751d making the binding path for ids and params the function itself 2015-10-28 23:04:58 +00:00
Sebastian McKenzie
c6d7e704ff v5.8.31 2015-10-28 22:57:35 +00:00
Sebastian McKenzie
37d40a03c1 only explicitly add id when scope tracking function expressions - fixes #2617 2015-10-28 22:54:37 +00:00
Sebastian McKenzie
9146a4cc81 v5.8.30 2015-10-28 01:14:19 +00:00
Amjad Masad
382c0d9c1a Parens are needed unless it's a logical expression 2015-10-27 18:10:13 -07:00
Sebastian McKenzie
f9c923b87f Merge pull request #2609 from amasad/extra-parens
If binary expression precedence is equal no need for parens. Fixes #2602
2015-10-28 00:26:31 +00:00
Amjad Masad
2d36d8b616 If binary expression precedence is equal no need for parens. Fixes #2602 2015-10-27 17:25:36 -07:00
Sebastian McKenzie
5c514bfa75 Merge pull request #2608 from amasad/compact-remove-semi
No need for semicolons at the end of the block in compact mode
2015-10-28 00:14:28 +00:00
Amjad Masad
9011dcbfeb No need for semicolons at the end of the block in compact mode 2015-10-27 17:01:09 -07:00
Sebastian McKenzie
86b4f0dbe8 Merge pull request #2606 from amasad/for-in-edge-case
Special case paren printing in for-loop init node
2015-10-27 23:32:55 +00:00
Sebastian McKenzie
7d60bcbcb6 Merge pull request #2607 from amasad/extra-paren-return
It's safe not to parenthesize SequenceExpressions in ReturnStatements
2015-10-27 23:32:35 +00:00
Amjad Masad
84d80df181 It's safe not to parenthesize SequenceExpressions in ReturnStatements 2015-10-27 16:28:19 -07:00
Amjad Masad
50289bd2b0 whitespace 2015-10-27 16:11:37 -07:00
Amjad Masad
6caaf68024 Special case paren printing in for-loop init node
The printer doesn't have ancestry information so we have to set a flag before printing for's `node.init`.
We also need to make sure we're not printing extra parens so we check `node.needsParens` before adding them.
2015-10-27 16:04:46 -07:00
Sebastian McKenzie
3974dd762d add node 4.0 to travis matrix 2015-10-25 21:04:02 +00:00
Sebastian McKenzie
543378b81f v5.8.29 2015-10-24 17:26:54 +01:00
Sebastian McKenzie
332bde6a0d v5.8.29 2015-10-24 17:26:54 +01:00
Sebastian McKenzie
355905a3bb v5.8.28 2015-10-23 18:00:12 +01:00
Sebastian McKenzie
37604bd572 v5.8.27 2015-10-23 17:54:03 +01:00
Sebastian McKenzie
35169762ef add 5.8.27 changelog 2015-10-23 17:53:21 +01:00
Sebastian McKenzie
7c3f0f98f5 remove faulty tests 2015-10-23 17:52:21 +01:00
Sebastian McKenzie
0b71625440 sync babel 5.x with 6.0 scope/traversal fixes - fixes #2570, fixes #2574 2015-10-23 17:51:18 +01:00
Sebastian McKenzie
745f9fb5bd clean up babel-code-frame, var -> let etc - closes #2505 2015-10-08 01:19:27 +01:00
Sebastian McKenzie
9c2b4e30b6 use basename of relative filename when using source map defaults - fixes #1567 2015-10-05 17:46:59 +01:00
Sebastian McKenzie
71031be044 Merge pull request #2405 from jhen0409/patch-1
[es6.tailCall] Move '<arg> = undefined' to the place in front of Continue statement.
2015-10-05 17:26:45 +01:00
Sebastian McKenzie
9320d661f9 flesh out async-to-generator and bluebird-coroutines transformers, add babel-helper-async-to-generator module 2015-10-05 17:25:43 +01:00
Sebastian McKenzie
de45daaef8 don't execute the callback inside of a try-catch as if the callback errors then it'll emit the error back to the callback 2015-10-05 16:46:45 +01:00
Sebastian McKenzie
52202543ff better error messages for unknown extends clause and unknown options 2015-10-05 16:46:20 +01:00
Sebastian McKenzie
51c9d59050 allow plugins to be instances 2015-10-05 16:45:47 +01:00
Sebastian McKenzie
210910513d remove babel.register 2015-10-05 16:44:59 +01:00
Sebastian McKenzie
5006403cd7 remove polyfill from babel/register 2015-10-05 16:44:39 +01:00
Sebastian McKenzie
d108d799bf remove babel.parse and encourage use of babylon directly 2015-10-05 16:44:14 +01:00
Sebastian McKenzie
64d5ec090b extend Store from Map 2015-10-05 16:43:37 +01:00
Sebastian McKenzie
72b74de833 add 5.8.23-5.8.26 changelog 2015-10-05 16:43:24 +01:00
Sebastian McKenzie
6467bf6809 add script to generate a flow lib file for babel types 2015-10-05 16:42:08 +01:00
Sebastian McKenzie
3e6b76aa41 add support for devDependencies to publish script 2015-10-05 16:41:54 +01:00
Sebastian McKenzie
c4dbb38f8a remove bjs 2015-10-05 16:41:36 +01:00
Sebastian McKenzie
91f9cfb902 remove browser tests 2015-10-05 16:41:32 +01:00
Sebastian McKenzie
65e059e69b allow local packages to be specified as devDependencies in bootstrap script 2015-10-05 16:41:11 +01:00
Sebastian McKenzie
d0b584fd13 add filename to babylon test errors 2015-10-05 16:40:55 +01:00
Sebastian McKenzie
95c9b2c8e0 add filename to babylon test errors 2015-10-05 16:40:55 +01:00
Sebastian McKenzie
9908dc6f50 update babylon tests 2015-10-05 16:40:43 +01:00
Sebastian McKenzie
3a89ee84ef update babylon tests 2015-10-05 16:40:43 +01:00
Sebastian McKenzie
55976b6392 remove redundant generator tests 2015-10-05 16:40:18 +01:00
Sebastian McKenzie
6568aaa175 add babel-polyfill to CLI 2015-10-05 16:39:16 +01:00
Sebastian McKenzie
31e4d2e515 remove CLI aliases 2015-10-05 16:38:53 +01:00
Sebastian McKenzie
9113542b12 add syntax plugins 2015-10-05 16:37:49 +01:00
Sebastian McKenzie
f88cc9d509 clean up babel-generator - closes #2210 2015-10-05 16:37:37 +01:00
Sebastian McKenzie
63cfb82ca7 clean up mergeSourceMap method - closes #2479 2015-10-05 16:34:40 +01:00
Sebastian McKenzie
92553a91f0 Merge pull request #2469 from jridgewell/replace-implicit-arrow-with-block
Replace arrow expression body with block statement
2015-10-05 16:29:23 +01:00
Sebastian McKenzie
6740561f91 remove comments from old node after inheriting from new one when replacing nodes - closes #2490, closes #2489 2015-10-05 16:27:17 +01:00
Justin Ridgewell
24d766fc57 Replace arrow expression body with block statement
Without this, the only way to replace the arrow function is to either
manually override its `node.body`, or duplicate the arrow:

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

// New
ArrowFunctionExpression: function() {
  this.get("body").replaceWith(t.blockStatement(...));
}
```
2015-09-30 15:01:35 -04:00
Sebastian McKenzie
369b9fdc4b Merge pull request #2465 from jfsiii/patch-2
Move to exponentiation operator to stage 3
2015-09-30 15:58:19 +01:00
Sebastian McKenzie
95fb1e2251 Merge pull request #2464 from jfsiii/patch-1
Move to async functions to stage 3
2015-09-30 15:58:11 +01:00
John Schulz
afc687dc5d Bump to exponentiation operator to stage 3
https://github.com/tc39/ecma262#current-proposals
2015-09-30 07:53:16 -07:00
John Schulz
959f607a5a Bump to async functions to stage 3
https://github.com/tc39/ecma262#current-proposals
2015-09-30 07:51:26 -07:00
Sebastian McKenzie
fa88b1c00d abstract out scope binding rename and handle function/class cases where we can retain the name with some ~magic~ - fixes #2435 2015-09-28 02:45:00 +01:00
Sebastian McKenzie
8ab4a5df43 Merge pull request #2403 from alawatthe/double-decimal-point
BinaryIntegerLiterals, OctalIntegerLiterals, HexIntegerLiterals shoul…
2015-09-27 21:24:05 +01:00
Sebastian McKenzie
32d2794bf8 Merge branch 'mathiasbynens-patch-5' 2015-09-27 21:23:33 +01:00
Sebastian McKenzie
0230368d23 Merge branch 'patch-5' of https://github.com/mathiasbynens/6to5 into mathiasbynens-patch-5
Conflicts:
	packages/babel/package.json
2015-09-27 21:23:27 +01:00
Jhen
67efa9ee4a [es6.tailCall] Add default-parameters-black-es6-block-scoping test case
refer: https://github.com/babel/babel/issues/2401
2015-09-26 13:24:44 +08:00
Sebastian McKenzie
d1588990d5 add flow-comments plugin to babelrc and format json 2015-09-24 18:43:10 +01:00
Sebastian McKenzie
464d2b7ef3 enable no-var rule in eslint config 2015-09-24 18:42:50 +01:00
Sebastian McKenzie
112c24a3d3 Merge pull request #2427 from michaelficarra/patch-2
advance es7.trailingFunctionCommas to stage 2
2015-09-24 18:27:14 +01:00
Sebastian McKenzie
55989d1c34 Merge pull request #2425 from zertosh/browserify-shrink
Use source-map@^0.5.0 and optimize bundle builds
2015-09-24 15:34:30 +01:00
Sebastian McKenzie
0421224ad0 Merge pull request #2424 from benjamn/patch-5
Upgrade Regenerator to 0.8.40
2015-09-24 15:34:09 +01:00
Mathias Bynens
88f0f8995f Update regexpu to v1.3.0 2015-09-24 13:03:29 +02:00
Andres Suarez
2f13cfa85b optimize bundle builds 2015-09-23 21:58:23 -07:00
Andres Suarez
a5fc32e598 bump source-map to ^0.5.0 2015-09-23 21:05:57 -07:00
Michael Ficarra
7e9a9296ef advance es7.trailingFunctionCommas to stage 2 2015-09-23 16:41:40 -07:00
Sebastian McKenzie
b522fccbd1 Merge pull request #2423 from michaelficarra/patch-1
move class properties proposal to stage 1
2015-09-23 23:22:10 +01:00
Ben Newman
e50476b8a4 Upgrade Regenerator to 0.8.40
Most notably, this pegs regenerator to a version of recast (0.10.33) which pegs ast-types to a version (0.8.12) that contains https://github.com/benjamn/ast-types/pull/128, so the Babel client bundle size will be a bit smaller.
2015-09-23 15:01:42 -04:00
Michael Ficarra
46e2a86183 move class properties proposal to stage 1 2015-09-23 11:13:38 -07:00
Sebastian McKenzie
227ed5638a add flow type annotations 2015-09-23 16:10:44 +01:00
Sebastian McKenzie
119520ed87 add lib folder 2015-09-23 16:00:41 +01:00
Sebastian McKenzie
6d6ddf0bcd type annotate babylon 2015-09-23 15:59:41 +01:00
Sebastian McKenzie
20f643b419 type annotate babylon 2015-09-23 15:59:41 +01:00
Sebastian McKenzie
31a01cc4d2 Merge pull request #2414 from benjamn/patch-4
Upgrade Regenerator to v0.8.39
2015-09-22 16:23:51 +01:00
Ben Newman
5553fddd84 Upgrade Regenerator to v0.8.39
Most notably, this release fixes a bug that made it difficult for Promise implementations to track unhandled rejections when using async functions: 3d8ee21f3a
2015-09-22 11:16:22 -04:00
Jhen
441f5a14f6 [es6.tailCall] Update tests 2015-09-20 04:01:24 +08:00
Jhen
3e0b9b6b4e [es6.tailCall] Move '<arg> = undefined' to the place in front of Continue statement 2015-09-20 04:01:10 +08:00
Alexander Zeilmann
4f57a7b092 BinaryIntegerLiterals, OctalIntegerLiterals, HexIntegerLiterals should not have a decimal point afer them - fixes #2402 2015-09-19 16:20:32 +02:00
Sebastian McKenzie
75cd1a5531 v5.8.26 2015-09-19 02:17:50 +01:00
Sebastian McKenzie
7eb45351bd add FORCE_VERSION check when validating whether or not any packages have changed 2015-09-19 02:17:05 +01:00
Sebastian McKenzie
0f8eb6691b add 5.8.26 changelog 2015-09-19 02:12:55 +01:00
Sebastian McKenzie
1d17f85a87 add 5.8.25 changelog 2015-09-19 02:12:17 +01:00
Sebastian McKenzie
273b7c5e07 v5.8.25 2015-09-19 01:52:08 +01:00
Sebastian McKenzie
bfd8f41e5e Merge pull request #2372 from hzoo/evaluation-tests
evaluation: tests for UnaryExpression and BinaryExpression
2015-09-19 01:40:43 +01:00
Sebastian McKenzie
c99a179401 var -> let 2015-09-18 18:45:55 +01:00
Sebastian McKenzie
0708edb927 it's now safe to use path.remove() 2015-09-18 18:41:44 +01:00
Sebastian McKenzie
c695248d89 remove dead deprecated/aliases for transformers 2015-09-18 18:41:19 +01:00
Sebastian McKenzie
901c578e01 remove unused templates 2015-09-18 18:40:59 +01:00
Sebastian McKenzie
b1648fb339 switch babel-node binary to use v8 flags 2015-09-18 18:40:46 +01:00
Sebastian McKenzie
e4bd19ea7d Merge pull request #2394 from steveluscher/rename-type-definer
Rename the define method to defineType to disambiguate from AMD's “define”
2015-09-18 00:15:30 +01:00
Steven Luscher
c28007c044 Rename the define method to defineType to disambiguate from AMD's “define” 2015-09-16 17:17:11 -07:00
Sebastian McKenzie
5dadb67a1a remove transformers and module formatters from $ babel --help 2015-09-15 06:33:50 +01:00
Sebastian McKenzie
8a32666052 remove dead options 2015-09-15 06:32:49 +01:00
Sebastian McKenzie
c10af9236e remove transformerList option parser and remove redundant comments 2015-09-15 06:32:37 +01:00
Sebastian McKenzie
69f67c9ec3 merge plugin manager into option manager 2015-09-15 06:32:24 +01:00
Sebastian McKenzie
4924a9adea add store class 2015-09-15 06:32:04 +01:00
Sebastian McKenzie
dff098e77b rename errorWithNode to buildCodeFrameError and when erroring on dynamic nodes try and estimate a location 2015-09-15 06:31:51 +01:00
Sebastian McKenzie
c00bf262a7 update to new visitor method signature 2015-09-15 06:30:39 +01:00
Sebastian McKenzie
945c2587e1 remove metadata from plugins, simplify intialisation of a plugin 2015-09-15 06:29:51 +01:00
Sebastian McKenzie
6c656e30bc make PluginPass the state each plugin visitor gets 2015-09-15 06:29:30 +01:00
Sebastian McKenzie
b865b8862e remove filters, aliases, deprecations and more from plugin pipeline 2015-09-15 06:29:07 +01:00
Sebastian McKenzie
8d5a93d4da move block-hoist and shadow-functions to internal plugins 2015-09-15 06:28:27 +01:00
Sebastian McKenzie
6d72b02591 add babel-preset-2015 package 2015-09-15 06:27:56 +01:00
Sebastian McKenzie
dc0329eb7c add babel-preset-react package 2015-09-15 06:27:51 +01:00
Sebastian McKenzie
3277f3272d add babel-template package 2015-09-15 06:27:44 +01:00
Sebastian McKenzie
6898cf83d0 don't allow visitor methods to return a new node to replace 2015-09-15 06:27:37 +01:00
Sebastian McKenzie
13773e3c02 change traversal visitor method signature from (node, parent, scope, state) to (path, state) 2015-09-15 06:27:19 +01:00
Sebastian McKenzie
8eeda9f75f add traverse.cheap and upgrade to new traverse API 2015-09-15 06:26:57 +01:00
Sebastian McKenzie
b91e8699e1 whitespace! 2015-09-15 06:26:30 +01:00
Sebastian McKenzie
cfec910a17 add validation to node builders 2015-09-15 06:26:17 +01:00
Sebastian McKenzie
0612f69141 flesh out babylon readme 2015-09-15 06:25:52 +01:00
Sebastian McKenzie
c44fd54621 flesh out babylon readme 2015-09-15 06:25:52 +01:00
Sebastian McKenzie
c9aff26824 Merge branch 'development' of github.com:babel/babel into development 2015-09-15 06:21:39 +01:00
Sebastian McKenzie
75609f21d7 add optional runtime transformer to base compiler options 2015-09-15 06:20:54 +01:00
Sebastian McKenzie
11b1e39973 add no-constant-condition lint rule 2015-09-15 06:20:45 +01:00
Sebastian McKenzie
a4d6ea0d07 put monorepo intro on same line 2015-09-15 06:20:34 +01:00
Sebastian McKenzie
f3a016df30 add babel-runtime to babylon dependencies 2015-09-15 06:20:21 +01:00
Sebastian McKenzie
78fafdf18b add babel-runtime to babylon dependencies 2015-09-15 06:20:21 +01:00
Sebastian McKenzie
446cc3e869 add babylon description 2015-09-15 06:20:03 +01:00
Sebastian McKenzie
800b039d02 add babylon description 2015-09-15 06:20:03 +01:00
Sebastian McKenzie
fc87af4c81 add dead simple babylon bin 2015-09-15 06:19:49 +01:00
Sebastian McKenzie
c751771889 add dead simple babylon bin 2015-09-15 06:19:49 +01:00
Sebastian McKenzie
e8fa03ea1c add parser util addExtra method 2015-09-15 06:19:35 +01:00
Sebastian McKenzie
4996e6bc7f add parser util addExtra method 2015-09-15 06:19:35 +01:00
Sebastian McKenzie
bf841c7e27 use extra.parenthesized rather than parenthesizedExpression 2015-09-15 06:19:26 +01:00
Sebastian McKenzie
fbda587964 use extra.parenthesized rather than parenthesizedExpression 2015-09-15 06:19:26 +01:00
Sebastian McKenzie
d1ecb04d0f add hasFeature util method 2015-09-15 06:18:23 +01:00
Sebastian McKenzie
25aa6da989 add hasFeature util method 2015-09-15 06:18:23 +01:00
Sebastian McKenzie
40aab69ed0 remove weird acorn conditional formatting 2015-09-15 06:18:15 +01:00
Sebastian McKenzie
c31d2afc7f remove weird acorn conditional formatting 2015-09-15 06:18:15 +01:00
Sebastian McKenzie
9e264e70ae only allow identifiers as rest expressions 2015-09-15 06:18:04 +01:00
Sebastian McKenzie
76eb259ea8 only allow identifiers as rest expressions 2015-09-15 06:18:04 +01:00
Sebastian McKenzie
54a4f16b08 add RestProperty node 2015-09-15 06:17:45 +01:00
Sebastian McKenzie
bcab30e606 add RestProperty node 2015-09-15 06:17:45 +01:00
Sebastian McKenzie
c5e2e4d39e loop over all directives to check for use strict 2015-09-15 06:16:57 +01:00
Sebastian McKenzie
eae82799e6 loop over all directives to check for use strict 2015-09-15 06:16:57 +01:00
Sebastian McKenzie
c892cae6af use hasFeature rather than directly looking up options 2015-09-15 06:16:46 +01:00
Sebastian McKenzie
8a13465f80 use hasFeature rather than directly looking up options 2015-09-15 06:16:46 +01:00
Sebastian McKenzie
415752dbb7 add directives property to Program and BlockStatement 2015-09-15 06:16:07 +01:00
Sebastian McKenzie
dae16fa192 add directives property to Program and BlockStatement 2015-09-15 06:16:07 +01:00
Sebastian McKenzie
59948c6649 add babylon hasFeature util method 2015-09-15 06:15:19 +01:00
Sebastian McKenzie
5ea5d47d7f add babylon hasFeature util method 2015-09-15 06:15:19 +01:00
Sebastian McKenzie
ae85fc0251 rename features in babylon tests 2015-09-15 06:13:11 +01:00
Sebastian McKenzie
e1575c468c rename features in babylon tests 2015-09-15 06:13:11 +01:00
Sebastian McKenzie
9969224a93 add more plugins, rename some 2015-09-15 06:12:46 +01:00
Sebastian McKenzie
3e8cbc60eb export babel-template from babel-core 2015-09-15 06:11:38 +01:00
Sebastian McKenzie
daa95ad400 simplify parse helper options 2015-09-15 06:11:25 +01:00
Sebastian McKenzie
248d457d87 remove parse API from referring to transformers 2015-09-15 06:11:14 +01:00
Sebastian McKenzie
6e38c037d5 removal redundant comments 2015-09-15 06:10:52 +01:00
Sebastian McKenzie
c7130181f7 clean up browser API 2015-09-15 06:10:38 +01:00
Sebastian McKenzie
95e36e10be update babel-node with plugins and presets option 2015-09-15 06:10:17 +01:00
Sebastian McKenzie
5a5e72f0bd Merge pull request #2382 from jucrouzet/patch-1
Test build on Node4.0
2015-09-14 17:36:33 +01:00
Sebastian McKenzie
37172857b4 Merge pull request #2379 from bradencanderson/defaults_correct_remap
RHS of AssignmentPattern can be a reference to a bound variable
2015-09-14 17:36:22 +01:00
Julien CROUZET
b2021277b3 Test build on Node4.0 2015-09-14 16:08:49 +02:00
Braden Anderson
9780858722 RHS of AssignmentPattern can be a reference to a bound variable 2015-09-14 17:25:23 +07:00
Sebastian McKenzie
bd9b86d6d5 Merge pull request #2316 from andrewimm/development
Let dead code elimination run over exported functions
2015-09-14 03:38:55 +01:00
Henry Zhu
f742806978 evaluation: tests for UnaryExpression and BinaryExpression 2015-09-12 20:11:33 -04:00
Sebastian McKenzie
f18f79cc6d Merge pull request #2293 from andrewimm/master
Allow more certainty when evaluating Logical Expressions
2015-09-12 18:59:48 +01:00
Sebastian McKenzie
58723068d3 Merge pull request #2357 from hzoo/i-2355
evaluation: don't evaluate `in` and `instanceof` binary exp - fixes #…
2015-09-11 20:21:30 +01:00
Henry Zhu
95e63fd9c9 evaluation: don't evaluate in and instanceof binary exp - fixes #2355 2015-09-11 00:41:03 -04:00
Sebastian McKenzie
554fda00c1 add 5.8.23-24 changelog 2015-09-10 20:18:02 +01:00
Sebastian McKenzie
8d422bb69c v5.8.24 2015-09-10 20:13:20 +01:00
Sebastian McKenzie
ade747eb9c Merge pull request #2352 from spicyj/jsx-xss
Include $$typeof on inlined React elements
2015-09-10 20:03:42 +01:00
Ben Alpert
52fb99a341 Reorder React element properties for consistent hidden class 2015-09-10 01:22:06 -07:00
Ben Alpert
1d0e68f5a1 Include $$typeof on inlined React elements
See https://github.com/facebook/react/pull/4832.
2015-09-10 00:02:09 -07:00
Sebastian McKenzie
e29d089d2b Merge pull request #2353 from spicyj/tmpl-hidden
Fix template loading when hidden files exist
2015-09-10 07:59:26 +01:00
Ben Alpert
150720f431 Fix template loading when hidden files exist
This made debugging https://github.com/babel/babel/pull/2352 confusing
because I had some vim swap files so it didn't load any of the
templates. (I assume this was the original intention.)
2015-09-09 23:57:10 -07:00
Sebastian McKenzie
3720174a32 update tests to reflect new whitelist by default model 2015-09-05 20:02:36 +01:00
Sebastian McKenzie
3b301c88da add missing FunctionExpression conversion when wrapping a function expression in a call for async to generator helper - fixes #2325 2015-09-05 08:41:13 +01:00
Sebastian McKenzie
392b7b0333 ignore ExportDefaultSpecifiers and ExportNamespaceSpecifiers in t.isReferenced - fixes #2324 2015-09-05 03:05:29 +01:00
Andrew Imm
a6e0ec8371 Allow more certainty when evaluating Logical Expressions 2015-09-03 08:55:26 -07:00
Sebastian McKenzie
436ba9b653 Merge pull request #2306 from hzoo/eval-typeof
evaluation: evaluate typeof
2015-09-03 15:49:31 +01:00
Sebastian McKenzie
213a9923b9 add builder keys for JSXElement and add starter validation 2015-09-03 15:45:43 +01:00
Sebastian McKenzie
b6b553f27f update JSXElement visitor keys - fixes #2318 2015-09-03 15:45:26 +01:00
Henry Zhu
5c58b52d40 evaluation: evaluate typeof UnaryExpression 2015-09-03 09:32:01 -04:00
Andrew Imm
79c25ecf13 Let dead code elimination run over exported functions 2015-09-03 00:52:05 -07:00
Sebastian McKenzie
64be6530fe add packages README 2015-09-03 06:33:51 +01:00
Sebastian McKenzie
3831b1b37a add support for bind expression to t.isReferenced 2015-09-02 18:06:51 +01:00
Sebastian McKenzie
3f69534ae5 add JSXText 2015-09-02 18:06:42 +01:00
Sebastian McKenzie
f770f337a4 add Scope#buildUndefinedNode method 2015-09-02 18:06:23 +01:00
Sebastian McKenzie
6ff53e35f3 cap uids based on nodes at 20 characters - fixes #2225 2015-09-02 18:05:33 +01:00
Sebastian McKenzie
a26186cf21 finish metaphor in monorepo doc since @jdalton linked to it and i don't want to look stupid 2015-09-01 17:21:32 +01:00
Sebastian McKenzie
acc801897a Merge pull request #2300 from hzoo/add-more-binary-ops
evaluation: add more binary operators
2015-09-01 15:34:32 +01:00
Sebastian McKenzie
edae7970b1 Merge pull request #2301 from danez/patch-1
Fix typo in code
2015-09-01 15:31:51 +01:00
Daniel Tschinder
ab1dd2c090 Fix typo in code 2015-09-01 16:28:29 +02:00
Henry Zhu
5bb42ed10d evaluation: add more binary operators 2015-09-01 10:14:38 -04:00
Sebastian McKenzie
1ea835f42f start moving more transformers to packages and finish import of plugins from babel-plugins 2015-09-01 08:37:37 +01:00
Sebastian McKenzie
9f9d9cd84b move some babel-plugins into the main repo 2015-09-01 06:58:53 +01:00
Sebastian McKenzie
069b969b1d make export default anoynmous class/function statements - fixes #2205 2015-09-01 05:34:11 +01:00
Sebastian McKenzie
f33c96c276 make export default anoynmous class/function statements - fixes #2205 2015-09-01 05:34:11 +01:00
Sebastian McKenzie
5161c4839c remove separator in README 2015-09-01 05:09:42 +01:00
Sebastian McKenzie
2dc9ebf830 more readme styling nits 2015-09-01 05:09:16 +01:00
Sebastian McKenzie
08ce312ff2 update styling in docs 2015-09-01 05:08:03 +01:00
Sebastian McKenzie
a86119a5ec update test script mocha.opts location 2015-09-01 05:06:08 +01:00
Sebastian McKenzie
4f2da607b0 add catch to npm uninstall babel in bootstrap 2015-09-01 05:05:59 +01:00
Sebastian McKenzie
5d695482f0 remove build-plugins 2015-09-01 05:05:45 +01:00
Sebastian McKenzie
610b432ba3 add docs 2015-09-01 05:05:32 +01:00
Sebastian McKenzie
5c5191b317 add headings to README 2015-09-01 05:01:25 +01:00
Sebastian McKenzie
125fe8cc56 update CONTRIBUTING.md header message 2015-09-01 05:01:11 +01:00
Sebastian McKenzie
268d575e12 remove noisy comments 2015-09-01 05:00:50 +01:00
Sebastian McKenzie
ac5dcf2884 add support for eslint colons in visitors 2015-09-01 05:00:38 +01:00
Sebastian McKenzie
b7c91178a9 fix babel-runtime build-dist requires 2015-09-01 05:00:24 +01:00
Sebastian McKenzie
68e1a442c5 don't deopt _guessExecutionStatusRelativeTo on specific function cases 2015-09-01 05:00:14 +01:00
Sebastian McKenzie
1895ee02b5 add Path#isStatic 2015-09-01 04:59:52 +01:00
Sebastian McKenzie
1d31db29a5 identify function parameters as binding parameters 2015-09-01 04:59:40 +01:00
Sebastian McKenzie
0bf747c214 convert stragellers to unoverloaded Literal nodes 2015-09-01 04:58:44 +01:00
Sebastian McKenzie
59f71a3a09 add validation to babel-types - fixes #1858 2015-09-01 04:58:11 +01:00
Sebastian McKenzie
ab78685124 remove deprecated features 2015-09-01 04:57:10 +01:00
Sebastian McKenzie
23e0aa8b60 move polyfill dist to babel-polyfill package 2015-09-01 04:56:35 +01:00
Sebastian McKenzie
15f73b4fc3 remove noisy comments/documentation 2015-09-01 04:56:03 +01:00
Sebastian McKenzie
582061a9e8 move mocha.opts into test directory 2015-09-01 04:49:42 +01:00
Sebastian McKenzie
20bcdc0206 add rollback support to publish script 2015-09-01 04:49:29 +01:00
Sebastian McKenzie
446b297465 unoverload Literal AST node 2015-09-01 04:49:16 +01:00
Sebastian McKenzie
8d7b3c462f unoverload Literal AST node 2015-09-01 04:49:16 +01:00
Sebastian McKenzie
95f061b76e move some dotfiles into package.json 2015-09-01 04:34:10 +01:00
Sebastian McKenzie
947ded1563 Merge pull request #2238 from prathamesh-sonpatki/doc-path-context
Document some methods from path/context.js
2015-09-01 04:31:17 +01:00
Sebastian McKenzie
19da69e7b4 Merge pull request #2235 from prathamesh-sonpatki/doc-ensure-callbacks-are-arrays
Document ensureCallbackArrays method from visitors.js
2015-09-01 04:30:36 +01:00
Sebastian McKenzie
310f38f3e7 remove polyfill from main package 2015-08-29 20:16:56 -07:00
Sebastian McKenzie
9908f2420d bump babel-plugin-react-display-name 2015-08-29 20:16:49 -07:00
Sebastian McKenzie
4088d85e32 Merge branch 'master' into development
Conflicts:
	packages/babel/package.json
	packages/babel/src/traversal/scope/index.js
2015-08-27 16:42:21 -07:00
Sebastian McKenzie
faa5cbbd08 Merge branch 'master' into development
Conflicts:
	packages/babel/package.json
	packages/babel/src/traversal/scope/index.js
2015-08-27 16:42:21 -07:00
Sebastian McKenzie
a20a926de1 v5.8.23 2015-08-27 16:38:34 -07:00
Sebastian McKenzie
442f1173d2 v5.8.23 2015-08-27 16:38:34 -07:00
Sebastian McKenzie
dea4c0dd5a update boostrap script to ignore packages with no package.json 2015-08-27 16:37:53 -07:00
Sebastian McKenzie
badf357e4d properly register a binding when pushing it to the scope 2015-08-27 16:29:13 -07:00
Sebastian McKenzie
8067aa65ab properly register a binding when pushing it to the scope 2015-08-27 16:28:59 -07:00
Sebastian McKenzie
d97240ae09 Merge remote-tracking branch 'origin/master' into development
Conflicts:
	packages/babel/scripts/build-dist.sh
2015-08-27 11:12:00 -07:00
Sebastian McKenzie
061ba7b2a2 Merge remote-tracking branch 'origin/master' into development
Conflicts:
	packages/babel/scripts/build-dist.sh
2015-08-27 11:12:00 -07:00
Sebastian McKenzie
69232e525d Merge pull request #2268 from sethcall/master
* use node instead of printf to print BOM
2015-08-27 11:10:59 -07:00
Sebastian McKenzie
b8d53c1811 fix predence of destructuring parameters - fixes #2269 2015-08-27 11:10:22 -07:00
Seth Call
92a4259d08 * use node instead of printf to print BOM to avoid issues with OS/bash differences (issue #2255) 2015-08-27 06:25:42 -05:00
Sebastian McKenzie
ddb6461294 Merge pull request #2264 from cesarandreu/fix-flow-optional-object-key
Fix flow optional object keys
2015-08-26 21:32:00 -07:00
Cesar Andreu
bc59b09f6b Start ObjectTypeProperty's optional property as false in each loop 2015-08-27 00:07:26 -04:00
Cesar Andreu
c44858207e Start ObjectTypeProperty's optional property as false in each loop 2015-08-27 00:07:26 -04:00
Cesar Andreu
60f4003345 Add failing flow ObjectTypeProperty test 2015-08-26 06:51:12 -04:00
Cesar Andreu
fe86c0a4e9 Add failing flow ObjectTypeProperty test 2015-08-26 06:51:12 -04:00
Sebastian McKenzie
310de83b63 update function arity to be the number of params to the left of a default/rest - fixes #2262 2015-08-25 17:33:05 -07:00
Sebastian McKenzie
8408244d93 add WIP build plugins 2015-08-24 15:34:31 -04:00
Sebastian McKenzie
56c2903811 fix duplicate declarations 2015-08-24 15:33:36 -04:00
Sebastian McKenzie
217a05ef9d add the ability to mark node paths 2015-08-24 15:33:27 -04:00
Sebastian McKenzie
171ba75140 split up block scoping transformer and embed TDZ into the main one rather than having a separate transformer 2015-08-24 15:32:48 -04:00
Sebastian McKenzie
f66090d383 add plugin modes 2015-08-24 15:32:20 -04:00
Sebastian McKenzie
112e0890fb remove babel 5 backwards compat cli shim 2015-08-24 15:31:53 -04:00
Sebastian McKenzie
6e24626482 fix weird legacy acorn formatting 2015-08-24 15:31:41 -04:00
Sebastian McKenzie
559272bb02 fix weird legacy acorn formatting 2015-08-24 15:31:41 -04:00
Sebastian McKenzie
032ca7ae1c never attempt to represent regexes natively 2015-08-24 15:31:30 -04:00
Sebastian McKenzie
1de8a57102 never attempt to represent regexes natively 2015-08-24 15:31:30 -04:00
Prathamesh Sonpatki
05be0678a7 Document some methods from path/context.js 2015-08-22 10:06:30 +05:30
Prathamesh Sonpatki
7745698b94 Document ensureCallbackArrays method from visitors.js 2015-08-21 22:17:50 +05:30
Sebastian McKenzie
daf171770a add support for evaluating template literals 2015-08-17 15:09:30 -07:00
Sebastian McKenzie
6f4f3b784a update babel 2015-08-17 14:34:39 -07:00
Sebastian McKenzie
a4a347b4f0 Merge branch 'master' into development
Conflicts:
	packages/babel/src/generation/generators/flow.js
	packages/babel/src/generation/generators/types.js
	packages/babel/src/transformation/transformers/es6/for-of.js
	packages/babel/src/traversal/path/inference/inferers.js
	packages/babel/src/types/index.js
	packages/babel/src/util.js
	packages/babel/test/util.js
2015-08-15 19:50:34 -04:00
Sebastian McKenzie
e2b39084a4 Merge pull request #2216 from hzoo/update-eslint
update eslint, babel-eslint, fix unused vars
2015-08-15 19:39:51 -04:00
Henry Zhu
8c98386434 update eslint, babel-eslint, fix unused vars 2015-08-15 19:36:54 -04:00
Sebastian McKenzie
ac9ee75dac parser: don't mutate or clone state arrays when doing a lookahead - fixes #2211 2015-08-15 19:07:42 -04:00
Sebastian McKenzie
e382d34ed2 parser: don't mutate or clone state arrays when doing a lookahead - fixes #2211 2015-08-15 19:07:42 -04:00
Sebastian McKenzie
def1f8823e don't statically evaluate Math.random - fixes babel-plugins/babel-plugin-constant-folding#1 2015-08-13 15:32:50 +01:00
Sebastian McKenzie
2cca81d4a3 remove dead packages 2015-08-12 02:57:55 +01:00
Sebastian McKenzie
ebc80fe804 add missing npmignore files to packages 2015-08-12 02:57:46 +01:00
Sebastian McKenzie
39fbd550c4 also transforming of File asts 2015-08-12 02:57:36 +01:00
Sebastian McKenzie
f923b2f5a4 remove object helper 2015-08-12 02:57:30 +01:00
Sebastian McKenzie
860322f7b8 add more jsx tests 2015-08-12 02:57:18 +01:00
Sebastian McKenzie
8c44aa4874 add more jsx tests 2015-08-12 02:57:18 +01:00
Sebastian McKenzie
67c96b6ed5 move babel polyfill into a separate package 2015-08-12 02:57:12 +01:00
Sebastian McKenzie
ef29444571 Merge pull request #2190 from prathamesh-sonpatki/doc-_shouldIgnore
Added documentation for _shouldIgnore method
2015-08-11 18:11:31 +01:00
Sebastian McKenzie
e46c5b2398 Merge pull request #2197 from prathamesh-sonpatki/tests-for-should-ignore-with-only
Added missing tests for shouldIgnore with the :only option
2015-08-11 18:11:27 +01:00
Sebastian McKenzie
3ef9bffcc2 split up babel core into multiple modules 2015-08-11 17:40:59 +01:00
Sebastian McKenzie
8887444cf7 fix various bugs surfaced by the esprima test suite, remove some incorrect tests 2015-08-11 16:58:20 +01:00
Sebastian McKenzie
a179f9a48b fix various bugs surfaced by the esprima test suite, remove some incorrect tests 2015-08-11 16:58:20 +01:00
Sebastian McKenzie
1a4f18aab7 inline traceur tests, removing git submodules 2015-08-11 16:57:51 +01:00
Prathamesh Sonpatki
bd17eed96f Added missing tests for shouldIgnore with the :only option 2015-08-11 12:24:13 +05:30
Sebastian McKenzie
b7b43dc282 Merge branch 'master' into development 2015-08-11 01:05:04 +01:00
Sebastian McKenzie
57fd619c76 Merge branch 'master' into development 2015-08-11 01:05:04 +01:00
Sebastian McKenzie
f8a2efb76f add 5.8.22 changelog 2015-08-11 01:04:37 +01:00
Sebastian McKenzie
87c604b64e v5.8.22 2015-08-11 01:00:54 +01:00
Sebastian McKenzie
6429cc69b5 v5.8.22 2015-08-11 01:00:54 +01:00
Sebastian McKenzie
e273d9bfe1 expose File 2015-08-11 00:59:58 +01:00
Sebastian McKenzie
d0729fc731 add t.directive 2015-08-11 00:59:22 +01:00
Sebastian McKenzie
df021c7f23 add esprima tests and fix bugs picked up by it 2015-08-11 00:59:15 +01:00
Sebastian McKenzie
415d1271b9 add esprima tests and fix bugs picked up by it 2015-08-11 00:59:15 +01:00
Sebastian McKenzie
f43e6d4ca8 Merge pull request #2195 from hzoo/i-fix-test
fix broken test from regex-after-block
2015-08-11 00:36:08 +01:00
Henry Zhu
babf64473b fix broken test from regex-after-block 2015-08-10 19:31:26 -04:00
Henry Zhu
f60df12449 fix broken test from regex-after-block 2015-08-10 19:31:26 -04:00
Sebastian McKenzie
55e1c0a4f9 Merge pull request #2194 from hzoo/i-babel-eslint-161
fix unexpected token issue for regex after block case
2015-08-11 00:07:03 +01:00
Henry Zhu
8f3615bf7b fix unexpected token issue for regex after block case
- Ex: `if (1) {} /foo/`

Fixes babel/babel-eslint#161
Ref marijnh/acorn#289
2015-08-10 19:03:13 -04:00
Henry Zhu
04aedf37b4 fix unexpected token issue for regex after block case
- Ex: `if (1) {} /foo/`

Fixes babel/babel-eslint#161
Ref marijnh/acorn#289
2015-08-10 19:03:13 -04:00
Prathamesh Sonpatki
6c59ffb371 Added documentation for _shouldIgnore method 2015-08-10 22:37:08 +05:30
Sebastian McKenzie
c318c88050 forward all arguments to parseClassId in flow parser plugin 2015-08-10 13:10:32 +01:00
Sebastian McKenzie
2afad4b7e9 forward all arguments to parseClassId in flow parser plugin 2015-08-10 13:10:32 +01:00
Sebastian McKenzie
e165e09467 make Directive virtual type check more reliable 2015-08-10 13:04:22 +01:00
Sebastian McKenzie
b581a7590c fix export default function expression disambiguation - fixes #2189 2015-08-10 13:04:08 +01:00
Sebastian McKenzie
4c71038bce fix export default function expression disambiguation - fixes #2189 2015-08-10 13:04:08 +01:00
Sebastian McKenzie
34bc8b0aea disallow let and modules in babel-node REPL 2015-08-09 20:37:18 +01:00
Sebastian McKenzie
50add6753f Merge pull request #2142 from loganfsmyth/import-sourcemap
Map commonjs named imports back to the correct location - fixes #1987
2015-08-08 17:47:52 +01:00
Sebastian McKenzie
d3a73b87e9 add code frame onto err.message when in a browser - fixes #2175 2015-08-07 19:21:11 +01:00
Sebastian McKenzie
20fa6cd8f4 check for ending dot before pushing on another when trying to fix integer member expressions - fixes #2177 2015-08-07 19:11:54 +01:00
Sebastian McKenzie
3961b720be check if a node is static before using it as the reference for an object spread 2015-08-07 17:47:09 +01:00
Sebastian McKenzie
4fda34ce6f properly distinguish shorthand async keys that are the last property - fixes #2176 2015-08-06 19:33:48 +01:00
Sebastian McKenzie
8128b35e25 properly distinguish shorthand async keys that are the last property - fixes #2176 2015-08-06 19:33:48 +01:00
Sebastian McKenzie
aba44e38b7 switch block scoping for in/of var hoisting statements - fixes #2174 2015-08-06 17:36:42 +01:00
Sebastian McKenzie
5ec9f78493 fix patterns with async keys - fixes #2171 2015-08-05 23:22:31 +01:00
Sebastian McKenzie
68d750120a fix patterns with async keys - fixes #2171 2015-08-05 23:22:31 +01:00
Sebastian McKenzie
9826be30cc Merge branch 'master' of github.com:babel/babel 2015-08-05 22:45:00 +01:00
Sebastian McKenzie
5c2b22144c Merge branch 'master' of github.com:babel/babel 2015-08-05 22:45:00 +01:00
Sebastian McKenzie
71a72ced0a clean up publish script to push tags 2015-08-05 22:44:33 +01:00
Sebastian McKenzie
637b708777 add 5.8.13-5.8.21 changelog 2015-08-05 22:44:15 +01:00
Sebastian McKenzie
68e70e55e2 v5.8.21 2015-08-05 22:22:57 +01:00
Sebastian McKenzie
314a851adb v5.8.21 2015-08-05 22:22:57 +01:00
Sebastian McKenzie
226bf3f80d style nits 2015-08-05 21:45:22 +01:00
Sebastian McKenzie
ef6ecbefaf style nits 2015-08-05 21:45:22 +01:00
Sebastian McKenzie
79c62ded0a remove operator property from AssignmentPattern 2015-08-05 21:45:11 +01:00
Sebastian McKenzie
7e80cac728 remove operator property from AssignmentPattern 2015-08-05 21:45:11 +01:00
Sebastian McKenzie
71bbffa797 fix handling of flow method shorthand - fixes #2169 2015-08-05 21:42:15 +01:00
Sebastian McKenzie
a1ca4822dc fix handling of flow method shorthand - fixes #2169 2015-08-05 21:42:15 +01:00
Sebastian McKenzie
00262e4646 Merge pull request #2156 from nmn/patch-1
fix typos
2015-08-04 23:28:43 +01:00
Naman Goel
b5c4dcb7ae fix typos
Found some typos while reading the code.
2015-08-05 00:26:52 +02:00
Naman Goel
df9b0b818f fix typos
Found some typos while reading the code.
2015-08-05 00:26:52 +02:00
Sebastian McKenzie
6fe1909e54 simplify NodePath#inShadow 2015-08-04 13:03:49 +01:00
Sebastian McKenzie
4a17c07668 check if shadow is defined before looking it up - fixes #2152 2015-08-04 13:03:14 +01:00
Sebastian McKenzie
ee2e8d10ce update some es7 transformers to stage 2 2015-08-04 01:31:09 +01:00
Sebastian McKenzie
8596db3bac fix git exec commands in babel-plugin 2015-08-04 01:30:53 +01:00
Sebastian McKenzie
3b3ac1f290 Merge branch 'development' 2015-08-03 02:53:24 +01:00
Sebastian McKenzie
04c2c54700 add exception to non-existent bindings when checking if we need to wrap in a closure 2015-08-03 02:40:43 +01:00
Sebastian McKenzie
cff2fc80e6 Merge pull request #2147 from dariocravero/patch-1
Fix typo on babel-plugin publish: verison x version
2015-08-02 22:38:10 +01:00
Darío Javier Cravero
79d70d85db Fix typo on babel-plugin publish: verison x version 2015-08-02 22:37:47 +01:00
Sebastian McKenzie
89983cead9 make comment retainment for multiple nodes more predictable - fixes #2146 2015-08-02 21:37:12 +01:00
Sebastian McKenzie
94e345e0b2 check valid function/class token when parsing export default before converting to a declaration - fixes #2145 2015-08-02 21:36:52 +01:00
Sebastian McKenzie
dea349c4d4 check valid function/class token when parsing export default before converting to a declaration - fixes #2145 2015-08-02 21:36:52 +01:00
Logan Smyth
c738d8d388 Map commonjs named imports back to the correct location - fixes #1987 2015-08-01 11:38:14 -07:00
Sebastian McKenzie
b5bd7b1c92 always parse package.json with default json parser, use json5 otherwise 2015-07-31 23:36:50 +01:00
Sebastian McKenzie
a0f9d5fbc8 add support for export types 2015-07-31 23:34:45 +01:00
Sebastian McKenzie
855ee71d59 add support for export types 2015-07-31 23:34:45 +01:00
Sebastian McKenzie
c050722611 v5.8.20 2015-07-31 21:24:00 +01:00
Sebastian McKenzie
8352730ff5 v5.8.20 2015-07-31 21:24:00 +01:00
Sebastian McKenzie
f0dd7f5d64 fix syntax error in scripts/publish 2015-07-31 21:23:21 +01:00
Sebastian McKenzie
3d8c0fe0f8 remove strip-json-comments and switch to json5 2015-07-31 21:21:13 +01:00
Sebastian McKenzie
2a2c67ad26 var -> let 2015-07-31 12:56:10 +01:00
Sebastian McKenzie
e96b635ac0 only register export declarations if they're of a valid type 2015-07-31 12:54:00 +01:00
Sebastian McKenzie
e2d673dafa don't register export declarations as a module binding 2015-07-31 12:49:14 +01:00
Sebastian McKenzie
c4e43bdeea add error name to babel-cli syntax errors 2015-07-31 12:48:52 +01:00
Sebastian McKenzie
2d73acdd54 Merge branch 'master' into development 2015-07-31 12:45:13 +01:00
Sebastian McKenzie
9ccbc89653 put containsEsc on state rather than as a local variable 2015-07-31 12:44:54 +01:00
Sebastian McKenzie
aee240c73e put containsEsc on state rather than as a local variable 2015-07-31 12:44:54 +01:00
Sebastian McKenzie
a8572c7088 Merge pull request #2126 from mmun/fix-2122
Register import bindings to the specifier instead of the declaration - fixes #2122
2015-07-31 12:43:45 +01:00
Sebastian McKenzie
72a5e7429b Merge pull request #2136 from jmm/optimize-block-hoist2
Tighten up block-hoist transformer
2015-07-31 12:04:12 +01:00
Jesse McCarthy
2ab41ec1f7 Break loop as soon as change detected. 2015-07-30 23:49:58 -04:00
Martin Muñoz
75d78623f7 Register import bindings to the specifier instead of the declaration - fixes #2122 2015-07-30 22:28:30 -04:00
Sebastian McKenzie
f5d9427153 only output code frame and message on syntax errors in CLI - fixes #1971 2015-07-31 02:19:06 +01:00
Sebastian McKenzie
547aaac0c0 set decorated initialisers that have no initialiser to undefined 2015-07-31 01:39:18 +01:00
Sebastian McKenzie
23cf77746d optimise common typeof cases in es6.spec.symbols transformer 2015-07-31 01:37:50 +01:00
Sebastian McKenzie
e95e836d5a export * should not export default 2015-07-31 01:29:46 +01:00
Sebastian McKenzie
f0aa8fb6eb add es6.spec.modules transformer - fixes #1716, fixes #1714 2015-07-31 01:18:45 +01:00
Sebastian McKenzie
ea31229d95 Merge remote-tracking branch 'origin/no-new-arrow' into development
Conflicts:
	src/babel/transformation/file/index.js
	src/babel/transformation/transformers/es6/arrow-functions.js
	src/babel/transformation/transformers/index.js
	src/babel/transformation/transformers/internal/shadow-functions.js
	src/babel/traversal/path/ancestry.js
2015-07-31 01:08:30 +01:00
Sebastian McKenzie
36b3d5b3b1 Merge pull request #2065 from iamolivinius/master
update to core-js 1.0.0
2015-07-31 00:02:24 +01:00
Sebastian McKenzie
2845913d58 Merge pull request #2089 from dfabulich/master
Add Unicode BOM to browser.js, fixes issue #340 running from file URL.
2015-07-31 00:01:51 +01:00
Sebastian McKenzie
27f622cb30 add babel-plugin templates to babelignore - fixes #2073 2015-07-30 23:56:34 +01:00
Sebastian McKenzie
b1c3ed6d2d fix linting error and add missing tests 2015-07-30 23:47:59 +01:00
Sebastian McKenzie
f97e201b56 fix linting error and add missing tests 2015-07-30 23:47:59 +01:00
Sebastian McKenzie
c480f6d5ba Merge pull request #2132 from benjamn/patch-3
Update Regenerator dependency to 0.8.35.
2015-07-30 23:44:49 +01:00
Sebastian McKenzie
76111143bb remove dead tests 2015-07-30 23:44:41 +01:00
Sebastian McKenzie
1d81dd995c add support for boolean flow literals - fixes #2127 2015-07-30 23:44:36 +01:00
Sebastian McKenzie
436874dac8 add support for boolean flow literals - fixes #2127 2015-07-30 23:44:36 +01:00
Ben Newman
04857656d6 Update Regenerator dependency to 0.8.35.
I fully expect the CI tests to pass, but it's nice to have that safety layer.
2015-07-30 18:41:01 -04:00
Sebastian McKenzie
ba2d18f025 add acorn license - cc @RReverser 2015-07-30 12:57:23 +01:00
Sebastian McKenzie
c91c2eb748 add acorn license - cc @RReverser 2015-07-30 12:57:23 +01:00
Sebastian McKenzie
723d51e6f5 add rollback support to publish script 2015-07-29 23:27:50 +01:00
Sebastian McKenzie
e4a1e491f6 flip around conditional - i hate this style 2015-07-29 23:25:45 +01:00
Sebastian McKenzie
42459fe894 revert ensureTransformerNames changes - fixes #2119 2015-07-29 23:25:32 +01:00
Sebastian McKenzie
7d53f0be1a switch to class prop initialiser 2015-07-29 23:22:38 +01:00
Sebastian McKenzie
3df5d31cee add comments and remove dead code 2015-07-29 23:22:30 +01:00
Sebastian McKenzie
ed156a8ca5 move default module formatter visitors into separate files 2015-07-29 23:22:21 +01:00
Sebastian McKenzie
be8ee7d2c5 remove start property from beginning of node builders 2015-07-29 23:19:51 +01:00
Sebastian McKenzie
aa3f9a16ee switch some classes to class propertie initialisers 2015-07-29 23:19:36 +01:00
Sebastian McKenzie
a1bea6d073 removed unused i variable 2015-07-29 23:19:21 +01:00
Sebastian McKenzie
c2a4276ce9 fix deprecated alias key regression - fixes #2119 2015-07-29 23:16:47 +01:00
Sebastian McKenzie
b91b4a4dc0 fix syntax error 2015-07-29 16:43:52 +01:00
Sebastian McKenzie
53952cb765 fix syntax error 2015-07-29 16:43:52 +01:00
Sebastian McKenzie
99d8dec04d clear rawValue from JSX attribute values as they're tokenised and parsed differently - fixes #2114 2015-07-29 16:15:47 +01:00
Sebastian McKenzie
ffee5615e4 clear rawValue from JSX attribute values as they're tokenised and parsed differently - fixes #2114 2015-07-29 16:15:47 +01:00
Sebastian McKenzie
c43daa83df v5.8.19 2015-07-29 13:32:27 +01:00
Sebastian McKenzie
4945b8e6f6 v5.8.19 2015-07-29 13:32:27 +01:00
Sebastian McKenzie
091d188a67 v5.8.18 2015-07-29 13:30:00 +01:00
Sebastian McKenzie
0888686eb1 v5.8.18 2015-07-29 13:30:00 +01:00
Sebastian McKenzie
dbe1d53e75 v5.8.17 2015-07-29 13:28:24 +01:00
Sebastian McKenzie
a6fabeebaa v5.8.17 2015-07-29 13:28:24 +01:00
Sebastian McKenzie
00d916507a v5.8.16 2015-07-29 04:24:37 +01:00
Sebastian McKenzie
52e87d576d v5.8.15 2015-07-29 04:22:52 +01:00
Sebastian McKenzie
2c197a508d fix esModule error for realsies now 2015-07-29 04:21:34 +01:00
Sebastian McKenzie
f1d42e7beb Revert "don't throw error on locationless illegal export name"
This reverts commit db13cbfa06.
2015-07-29 04:17:50 +01:00
Sebastian McKenzie
db13cbfa06 don't throw error on locationless illegal export name 2015-07-29 04:16:57 +01:00
Sebastian McKenzie
484eb4dee8 Merge branch 'master' into development 2015-07-29 03:22:05 +01:00
Sebastian McKenzie
7ff0146e48 Merge pull request #2107 from samccone/sjs/update-browserify
Update dev browserify.
2015-07-29 03:09:34 +01:00
Sam Saccone
3c07b519f5 Update dev browserify.
This allows us to browserify the contents of test/browser.js without
erroring

The previous version of browserify was choking on the file.

xref #1838
2015-07-28 22:07:38 -04:00
Sebastian McKenzie
5990785ab1 fix bug where files that babel can compile weren't being written when ignored with the --copy-files flag 2015-07-28 20:04:32 +01:00
Sebastian McKenzie
bda0d5cc68 create new export named declaration when we're splitting it up - fixes #2092 2015-07-28 19:58:51 +01:00
Sebastian McKenzie
90fb36d3ea create new raw identifiers instead of cloning the original user one when exploding export specifiers - fixes #2092 2015-07-28 19:42:05 +01:00
Sebastian McKenzie
2c3566de03 remove flow types from being scope tracked - these aren't used anywhere and if they're going to be added back they need to be abstracted from bindings to create any real value - fixes #2105 2015-07-28 19:26:52 +01:00
Sebastian McKenzie
73d6257377 remove trailing whitespace 2015-07-28 18:59:28 +01:00
Sebastian McKenzie
ecf54eeae1 code generator: add terminator parentheses test 2015-07-28 18:57:00 +01:00
Sebastian McKenzie
e5cb0cf32c break on hitting a terminator paren triggering character to avoid pushing multiple starting parens - fixes #2102 2015-07-28 18:55:35 +01:00
Sebastian McKenzie
4d846e3686 consider comment starting character to be a terminatorless separator #2106 2015-07-28 18:54:47 +01:00
Sebastian McKenzie
2b009e8c47 v5.8.14 2015-07-28 18:40:08 +01:00
Sebastian McKenzie
fc8c38ac0d clear scope uids when removing a binding - fixes #2101 2015-07-28 16:14:58 +01:00
Sebastian McKenzie
f9a657dd36 fix chalk API to reset highlighting on codeframe 2015-07-28 16:09:21 +01:00
Sebastian McKenzie
0719a99e4d add 5.8.11-5.8.12 changelog 2015-07-28 13:45:47 +01:00
Sebastian McKenzie
361c6970c0 v5.8.13 2015-07-28 13:41:00 +01:00
Sebastian McKenzie
5712e3c7f2 v5.8.13 2015-07-28 13:41:00 +01:00
Sebastian McKenzie
c966885157 Merge branch 'development'
cially if it merges an updated upstream into a topic branch.
2015-07-28 09:10:49 +01:00
Sebastian McKenzie
1c37c3a8c4 Merge branch 'development'
cially if it merges an updated upstream into a topic branch.
2015-07-28 09:10:49 +01:00
Sebastian McKenzie
a998fa308b v5.8.12 2015-07-28 01:38:31 +01:00
Sebastian McKenzie
770e89d537 v5.8.12 2015-07-28 01:38:31 +01:00
Sebastian McKenzie
1d023d98f7 v5.8.11 2015-07-28 01:37:05 +01:00
Sebastian McKenzie
65c5c0acfd v5.8.10 2015-07-28 01:28:44 +01:00
Sebastian McKenzie
a66470d821 fix es6 parameter tests 2015-07-28 01:25:00 +01:00
Sebastian McKenzie
27c0688742 check if options are nully instead of falsy - fixes #2079 2015-07-28 01:21:23 +01:00
Sebastian McKenzie
57d2323ae9 deopt on binding identifiers with same rest name - fixes #2091 2015-07-28 01:19:59 +01:00
Dan Fabulich
beaff831d2 Add Unicode BOM to browser.js, fixes issue #340 running from file URL. 2015-07-26 23:26:00 -07:00
Sebastian McKenzie
64e7164b55 Merge pull request #2087 from loganfsmyth/lookahead-state-fix
Ensure that the original state is restored on lookahead - fixes #2086
2015-07-27 04:59:58 +01:00
Logan Smyth
c60ffdef7b Ensure that the original state is restored on lookahead - fixes #2086 2015-07-26 20:56:07 -07:00
Logan Smyth
0bfc5a90dc Ensure that the original state is restored on lookahead - fixes #2086 2015-07-26 20:56:07 -07:00
Sebastian McKenzie
507303456f prepend ansi reset to code frame when highlighted - fixes #2058 2015-07-27 00:19:36 +01:00
Sebastian McKenzie
a96b9e1afa v5.8.9 2015-07-27 00:14:29 +01:00
Sebastian McKenzie
bcfe88fc06 v5.8.9 2015-07-27 00:14:29 +01:00
Sebastian McKenzie
e6e3a68a39 make flow transformer use internal state to track whether we're in a type or not - fixes #2083 2015-07-27 00:06:26 +01:00
Sebastian McKenzie
caecebf95b make flow transformer use internal state to track whether we're in a type or not - fixes #2083 2015-07-27 00:06:26 +01:00
Sebastian McKenzie
a971e9e67f update changelog 2015-07-26 22:11:09 +01:00
Sebastian McKenzie
2eebf8f5e0 v5.8.8 2015-07-26 22:07:32 +01:00
Sebastian McKenzie
16179e21c8 v5.8.8 2015-07-26 22:07:32 +01:00
Sebastian McKenzie
c42f1974da v5.8.7 2015-07-26 21:59:55 +01:00
Sebastian McKenzie
c722aadc8d v5.8.7 2015-07-26 21:59:55 +01:00
Sebastian McKenzie
0bbe94c38b really fix comment attachment 2015-07-26 21:58:22 +01:00
Sebastian McKenzie
c5a407f457 really fix comment attachment 2015-07-26 21:58:22 +01:00
Sebastian McKenzie
04ce3db23b add back missing comment fix - fixes #2072 2015-07-26 21:56:28 +01:00
Sebastian McKenzie
d7f59180ce add back missing comment fix - fixes #2072 2015-07-26 21:56:28 +01:00
Sebastian McKenzie
a571907c5d v5.8.6 2015-07-26 21:50:46 +01:00
Sebastian McKenzie
3de3678fae v5.8.6 2015-07-26 21:50:46 +01:00
Sebastian McKenzie
8e63ef162c switch function variables to declarations 2015-07-26 21:48:09 +01:00
Sebastian McKenzie
d2dc5e7149 add LICENSE file to babel-plugin 2015-07-26 21:48:01 +01:00
Sebastian McKenzie
502eab6f1c enforce double quotes in .eslintrc 2015-07-26 05:50:00 +01:00
Sebastian McKenzie
6ef86f67f4 update jsx tests 2015-07-26 05:34:03 +01:00
Sebastian McKenzie
9af5e0526f update jsx tests 2015-07-26 05:34:03 +01:00
Sebastian McKenzie
671196dffa remove rawValue property from JSX inner text Literal nodes 2015-07-26 05:30:27 +01:00
Sebastian McKenzie
6f607ef053 remove rawValue property from JSX inner text Literal nodes 2015-07-26 05:30:27 +01:00
Sebastian McKenzie
9c2621519a add string check to literal raw retainment 2015-07-26 05:26:46 +01:00
Sebastian McKenzie
e229f8ea55 remove gross acorn conditional statement styling 2015-07-26 05:22:33 +01:00
Sebastian McKenzie
d65c29b60a remove gross acorn conditional statement styling 2015-07-26 05:22:33 +01:00
Sebastian McKenzie
18e610820f verify that the raw property we've got stored is actually a string - fixes #2078 2015-07-26 05:22:12 +01:00
Sebastian McKenzie
aa8017ba45 Merge branch 'development' 2015-07-26 05:01:58 +01:00
Sebastian McKenzie
c2c8b2db57 add token match method and remove more dead code 2015-07-26 04:48:42 +01:00
Sebastian McKenzie
69721b930a add token match method and remove more dead code 2015-07-26 04:48:42 +01:00
Sebastian McKenzie
ac742d9a0d Merge pull request #2077 from jadnco/master
Better wording for contribution note
2015-07-26 02:14:42 +01:00
Jaden Dessureault
5e2f12aa8c Better wording for contribution note 2015-07-25 20:12:02 -05:00
Sebastian McKenzie
23aa7b002d improve babylon test coverage and remove dead code 2015-07-25 19:54:19 +01:00
Sebastian McKenzie
676766533c improve babylon test coverage and remove dead code 2015-07-25 19:54:19 +01:00
Sebastian McKenzie
2948108c90 finish reorganisation of babylon 2015-07-25 08:03:39 +01:00
Sebastian McKenzie
2598299e64 finish reorganisation of babylon 2015-07-25 08:03:39 +01:00
Sebastian McKenzie
e7fec51feb remove range property from nodes, clean up babylon codebase 2015-07-25 07:07:22 +01:00
Sebastian McKenzie
7e7ad89724 remove range property from nodes, clean up babylon codebase 2015-07-25 07:07:22 +01:00
Sebastian McKenzie
e14a3e509c temporarily disable node 0.10 from travis 2015-07-25 06:23:26 +01:00
Sebastian McKenzie
af03a301ae fix broken tests take 2 2015-07-25 06:16:50 +01:00
Sebastian McKenzie
4e00575ed5 fix broken tests take 2 2015-07-25 06:16:50 +01:00
Sebastian McKenzie
0e9413e926 fix broken tests 2015-07-25 06:14:09 +01:00
Sebastian McKenzie
7964e3bf11 fix broken tests 2015-07-25 06:14:09 +01:00
Sebastian McKenzie
bed14e9b42 add espree comment attachment tests and remove ranges test property from babylon tests 2015-07-25 06:07:51 +01:00
Sebastian McKenzie
55f3fb3015 add espree comment attachment tests and remove ranges test property from babylon tests 2015-07-25 06:07:51 +01:00
Sebastian McKenzie
006f3db76a update babylon fixtures to use File as the root node rather than Program 2015-07-25 05:24:58 +01:00
Sebastian McKenzie
350e901794 update babylon fixtures to use File as the root node rather than Program 2015-07-25 05:24:58 +01:00
Sebastian McKenzie
b088f8e6ef switch babylon tests to fixtures 2015-07-25 05:19:32 +01:00
Sebastian McKenzie
14d2625753 switch babylon tests to fixtures 2015-07-25 05:19:32 +01:00
Sebastian McKenzie
008f3d6ada fix broken tests 2015-07-25 04:01:30 +01:00
Sebastian McKenzie
00d6b0364d remove unused import 2015-07-25 03:56:42 +01:00
Sebastian McKenzie
b12866db86 extract out mocha fixtures and resolve utils 2015-07-25 03:54:48 +01:00
Sebastian McKenzie
73ff38e35b check whether the last child is the same node as the one we're removing comments from - fixes #2072, fixes #2068 2015-07-25 02:16:31 +01:00
Sebastian McKenzie
2ed9416e19 check whether the last child is the same node as the one we're removing comments from - fixes #2072, fixes #2068 2015-07-25 02:16:31 +01:00
Sebastian McKenzie
e15a28cc1c inherit class constructor function from parent class - fixes babel-plugins/babel-plugin-flow-comments#15 2015-07-25 00:40:52 +01:00
Sebastian McKenzie
e51949e402 better inheritance for t.inherits 2015-07-25 00:40:39 +01:00
Sebastian McKenzie
9cc0442db9 make class container shadowed 2015-07-24 22:34:14 +01:00
Sebastian McKenzie
ea479ca5a8 v5.8.5 2015-07-24 21:59:14 +01:00
Sebastian McKenzie
0531b61d59 v5.8.5 2015-07-24 21:59:14 +01:00
Sebastian McKenzie
bd17e06a2c update changelog 2015-07-24 21:45:03 +01:00
Sebastian McKenzie
41753c1a85 move down prepublish script execution 2015-07-24 21:44:21 +01:00
Sebastian McKenzie
a8f242f4fe add 5.8.4 changelog 2015-07-24 21:35:37 +01:00
Sebastian McKenzie
709f1421bc v5.8.4 2015-07-24 21:30:26 +01:00
Sebastian McKenzie
ca9ea6826f v5.8.4 2015-07-24 21:30:26 +01:00
Sebastian McKenzie
9cb5006136 fix broken imports and test newlines 2015-07-24 21:15:27 +01:00
Sebastian McKenzie
07e1ce8bf4 convert CLI imports to ES6 2015-07-24 21:10:11 +01:00
Sebastian McKenzie
3d416a6fbe move up regex Literal generation 2015-07-24 21:09:39 +01:00
Sebastian McKenzie
2d7a2b5e6d add sourceType option 2015-07-24 21:09:27 +01:00
Sebastian McKenzie
b20b6adf06 fix babel-plugin build hanging 2015-07-24 21:09:16 +01:00
Sebastian McKenzie
bac0b80953 don't console.log ignore config 2015-07-24 21:07:53 +01:00
Sebastian McKenzie
2a54d1385d update jscript plugin 2015-07-24 21:07:33 +01:00
Oliver Hoffmann
4fc2b5cec5 update to core-js 1.0.0 2015-07-24 11:39:19 +02:00
Sebastian McKenzie
35ac8bbe9b update babel-plugin-jscript 2015-07-24 03:10:12 +01:00
Sebastian McKenzie
54f852e466 generator: rewrite automatic parentheses insertion to be smarter, includes some buffer state that automatically triggers a parentheses to be pushed also has the positive side effect of cleaning up a lot of redundant code - fixes #2064 2015-07-24 03:10:06 +01:00
Sebastian McKenzie
c731d2d6dc update jscript tests 2015-07-23 18:48:38 +01:00
Sebastian McKenzie
c4c801ffcb Merge pull request #1907 from samccone/sjs/pipeline-opt
️ switch to reduce for pipeline
2015-07-23 18:42:59 +01:00
Sam Saccone
23527544fa 🎨 switch to reduce for pipeline 2015-07-23 13:41:55 -04:00
Sebastian McKenzie
b9dde49ab6 use Object.setPrototypeOf and fallback to __proto__ in inherits helper - fixes #2053 2015-07-22 17:28:58 +01:00
Sebastian McKenzie
3023afcff4 Merge branch 'master' of github.com:babel/babel
t push# especially if it merges an updated upstream into a topic branch.
2015-07-21 22:44:54 +01:00
Sebastian McKenzie
236a9a6285 Merge branch 'master' of github.com:babel/babel
t push# especially if it merges an updated upstream into a topic branch.
2015-07-21 22:44:54 +01:00
Sebastian McKenzie
b277f2c986 revert changes to use strict literal newline generation 2015-07-21 22:44:35 +01:00
Sebastian McKenzie
3f0ac54032 simplify CodeGenerator#print 2015-07-21 22:40:58 +01:00
Sebastian McKenzie
fd72abf450 Merge pull request #2046 from atonparker/master
fix tryCreateRegexp function scope
2015-07-21 22:38:30 +01:00
Chris Parker
6241742580 fix tryCreateRegexp function scope 2015-07-21 17:23:31 -04:00
Chris Parker
51cdae25cf fix tryCreateRegexp function scope 2015-07-21 17:23:31 -04:00
Sebastian McKenzie
1ff63329a3 fix directive newline insertion 2015-07-21 18:50:08 +01:00
Sebastian McKenzie
beb8061d3f better identification of strict directives - cc @jmm 2015-07-21 18:43:10 +01:00
Sebastian McKenzie
0fbc714315 add scripts folder to npmignore 2015-07-21 18:41:50 +01:00
Sebastian McKenzie
b0c90acff0 add 5.8.0-5.8.3 changelog 2015-07-21 18:41:43 +01:00
Sebastian McKenzie
ba7b5ce5c8 v5.8.3 2015-07-21 18:22:42 +01:00
Sebastian McKenzie
68d58af8b1 v5.8.3 2015-07-21 18:22:42 +01:00
Sebastian McKenzie
4e4202ef73 v5.8.2 2015-07-21 18:11:11 +01:00
Sebastian McKenzie
8e798cbc9c v5.8.2 2015-07-21 18:11:11 +01:00
Sebastian McKenzie
2eba8376d2 add force version environment variable 2015-07-21 18:08:58 +01:00
Sebastian McKenzie
0d2356ed8c v5.8.1 2015-07-21 18:00:22 +01:00
Sebastian McKenzie
78707e212c update test to reflect UIDs 2015-07-21 17:55:35 +01:00
Sebastian McKenzie
dd225b5b74 add handling for loops when doing rest parameter allocation optimisation 2015-07-21 17:51:20 +01:00
Sebastian McKenzie
f6e7b7716b add onComment shim to babel.parse API 2015-07-21 17:50:49 +01:00
Sebastian McKenzie
7fa684b120 don't reset raw of \x escape literals - cc @jmm 2015-07-21 14:53:05 +01:00
Sebastian McKenzie
437a201315 v5.8.0 2015-07-21 02:52:14 +01:00
Sebastian McKenzie
da60230801 add missing dependencies for older non-flat npm versions 2015-07-21 02:50:03 +01:00
Sebastian McKenzie
4545ade6ba v5.7.6 2015-07-21 02:44:54 +01:00
Sebastian McKenzie
ad4389b465 v5.7.5 2015-07-21 02:39:55 +01:00
Sebastian McKenzie
412208745b v5.7.5 2015-07-21 02:39:55 +01:00
Sebastian McKenzie
3c5b4f2d89 update flow literal annotations to have a rawValue 2015-07-21 02:37:43 +01:00
Sebastian McKenzie
30be1317e6 update flow literal annotations to have a rawValue 2015-07-21 02:37:43 +01:00
Sebastian McKenzie
73f0f26ae2 add missing semicolon 2015-07-21 02:31:33 +01:00
Sebastian McKenzie
ef5d8bb786 add a shitty onToken acorn option shim 2015-07-21 02:30:01 +01:00
Sebastian McKenzie
da94ea7fa5 Merge branch 'master' into development 2015-07-21 02:28:00 +01:00
Sebastian McKenzie
956fd8d770 Merge branch 'master' into development 2015-07-21 02:28:00 +01:00
Sebastian McKenzie
5507590dc2 fix unicode literal conversion check 2015-07-21 02:20:49 +01:00
Sebastian McKenzie
b6007ce4ea remove comments form test 2015-07-21 02:16:03 +01:00
Sebastian McKenzie
ee04db074d properly disallow type casts in reference lists 2015-07-21 02:01:48 +01:00
Sebastian McKenzie
0a5a00d6f8 properly disallow type casts in reference lists 2015-07-21 02:01:48 +01:00
Sebastian McKenzie
495b880372 only register an Identifier node as static if it's a constant 2015-07-21 01:14:38 +01:00
Sebastian McKenzie
b97dc4778b add Flow virtual type 2015-07-21 01:14:19 +01:00
Sebastian McKenzie
512707c7de update API test to use an async promise shim 2015-07-21 01:14:00 +01:00
Sebastian McKenzie
00fa5f2286 switch es6 parameters rest nested iife test to use external helpers 2015-07-21 01:13:48 +01:00
Sebastian McKenzie
7f34827a72 reimplement async function type parameters backfix - fixes #2028 2015-07-21 01:13:35 +01:00
Sebastian McKenzie
40f19586af reimplement async function type parameters backfix - fixes #2028 2015-07-21 01:13:35 +01:00
Sebastian McKenzie
0ca73d2474 add comment attachment to the parser and remove dead acorn options 2015-07-21 01:13:07 +01:00
Sebastian McKenzie
f0994f106e add comment attachment to the parser and remove dead acorn options 2015-07-21 01:13:07 +01:00
Sebastian McKenzie
538d24b2a3 Merge pull request #2040 from jmm/basic-pretransform-doc-test
Add basic description & existence test for `pretransform()`.
2015-07-20 19:03:10 +01:00
Jesse McCarthy
029146719e Add basic desc. & existence test for pretransform. 2015-07-20 13:38:21 -04:00
Sebastian McKenzie
47f790502e Merge pull request #1878 from kpdecker/tagged-template-object
Convert template objects to singletons
2015-07-20 12:18:07 +01:00
Sebastian McKenzie
d4917d74f0 Merge pull request #2035 from frankychung/flow-number-literal-type-annotations
Number literal type annotations for Flow
2015-07-20 11:41:07 +01:00
kpdecker
4eb1a45f02 Handle _blockHoist value of zero safely 2015-07-20 11:06:09 +03:00
Franky Chung
f3c7ef6707 Add number literal type annotations for flow 2015-07-20 11:35:46 +09:00
Franky Chung
0876209847 Add number literal type annotations for flow 2015-07-20 11:35:46 +09:00
Sebastian McKenzie
a523f60209 output type annotations of type instantiation parameters - fixes #2036 2015-07-20 00:20:40 +01:00
kpdecker
b2e3a73e2f Use generic name for templateObject
Rather than using variable names that could be quite long, just use indexed generic names that use runtime lookup for the string parameter mapping.
2015-07-19 10:39:38 +03:00
kpdecker
eed750206c Convert template objects to singletons
Create file-scoped template objects that are instantiated once and reused between different tagged template evaluations. This is a closer match to the spec behavior which demands reuse, but does not match the spec exactly with respect to scoping as it’s possible to have similar template objects defined in different file scopes within the same program. For now we are not able to cleanly handle this case as it would require a registry or similar lookup mechanism that is consistent across different combinations of builds and optimizers.

This has a 40x increase in six-speed throughput.

Partial fix for #971
2015-07-19 09:49:40 +03:00
Sebastian McKenzie
faa6ce1a08 Merge pull request #2030 from arthurvr/patch-2
Add `make test-cov` to `contributing.md`
2015-07-18 04:46:23 -07:00
Arthur Verschaeve
98a4d54212 Add make test-cov to contributing.md
Ref #1851
2015-07-18 10:59:20 +02:00
Sebastian McKenzie
9219b7f7bf don't return from within parseSubscripts when we parse an async arrow function - fixes #2027 2015-07-17 23:31:46 -07:00
Sebastian McKenzie
3a74f6d4cc don't return from within parseSubscripts when we parse an async arrow function - fixes #2027 2015-07-17 23:31:46 -07:00
Sebastian McKenzie
a7ad765438 remove weird promise compat method - fixes #2024 2015-07-17 11:09:20 +01:00
Sebastian McKenzie
6e539eb7e3 fix order of build-dist to include the latest version number 2015-07-17 01:04:13 +01:00
Sebastian McKenzie
44c82abf3a v5.7.4 2015-07-17 01:02:33 +01:00
Sebastian McKenzie
13e0c6b917 remove useless call from flow strip directives test 2015-07-17 01:01:22 +01:00
Sebastian McKenzie
4833dad4e2 fix comments containg @flow being completely removed from output rather than just the specific directive - fixes #2022 2015-07-17 00:58:08 +01:00
Sebastian McKenzie
641ee9d883 add 5.7.3 changelog 2015-07-17 00:57:03 +01:00
Sebastian McKenzie
32ad452b78 v5.7.3 2015-07-16 22:45:06 +01:00
Sebastian McKenzie
185fc3b10e add in dummy src file because i'm dumb and decided to do access private apis - closes #2020, fixes #2011 2015-07-16 22:43:43 +01:00
Sebastian McKenzie
c76536be90 fix test coverage 2015-07-16 15:46:31 +01:00
Sebastian McKenzie
e1c981a9de fix tags not being pushed for new babel versions - fixes #2019 2015-07-16 15:46:13 +01:00
Sebastian McKenzie
fd9373d9ee add 5.7.2 changelog 2015-07-15 20:38:19 +01:00
Sebastian McKenzie
49f18bb8ba v5.7.2 2015-07-15 20:35:57 +01:00
Sebastian McKenzie
676d602a8b v5.7.2 2015-07-15 20:35:57 +01:00
Sebastian McKenzie
a84242386d flow parser plugin: move up startPos and startLoc default assignments 2015-07-15 20:33:56 +01:00
Sebastian McKenzie
d2ce03e82d flow parser plugin: move up startPos and startLoc default assignments 2015-07-15 20:33:56 +01:00
Sebastian McKenzie
d661e15ce2 force push newline for line comments when in compact mode - fixes #2006 2015-07-15 20:23:24 +01:00
Sebastian McKenzie
1abaf66ac2 generator: set adjustMultilineComment to false when compact is true - fixes #2008 2015-07-15 20:18:27 +01:00
Sebastian McKenzie
043d007285 rewrite async function parsing, properly parse flow return types of arrow functions - fixes #1991 2015-07-15 20:08:10 +01:00
Sebastian McKenzie
afacd62738 rewrite async function parsing, properly parse flow return types of arrow functions - fixes #1991 2015-07-15 20:08:10 +01:00
Sebastian McKenzie
a8b8482326 add feature flag for es7.exponentiationOperator 2015-07-15 18:07:25 +01:00
Sebastian McKenzie
4b276b938b add feature flag for es7.exponentiationOperator 2015-07-15 18:07:25 +01:00
Sebastian McKenzie
2007469305 remove dead babylon code 2015-07-15 18:07:13 +01:00
Sebastian McKenzie
b520a33195 remove dead babylon code 2015-07-15 18:07:13 +01:00
Sebastian McKenzie
85cb123939 Merge branch 'master' into development 2015-07-15 17:10:58 +01:00
Sebastian McKenzie
dbf320f6f0 Merge branch 'master' into development 2015-07-15 17:10:58 +01:00
Sebastian McKenzie
1f851153fd add 5.7.1 changelog 2015-07-15 17:10:47 +01:00
Sebastian McKenzie
6bcf98a3d5 v5.7.1 2015-07-15 17:09:26 +01:00
Sebastian McKenzie
805a44d55d v5.7.1 2015-07-15 17:09:26 +01:00
Sebastian McKenzie
a051146ae2 add back NodePath#replaceWithSourceString method - fixes pangratz/ember-cli-htmlbars-inline-precompile/issues/18 2015-07-15 17:08:21 +01:00
Sebastian McKenzie
b21db8a37e finish removal of ecmaVersion option 2015-07-15 16:41:32 +01:00
Sebastian McKenzie
3acae3d625 finish removal of ecmaVersion option 2015-07-15 16:41:32 +01:00
Sebastian McKenzie
848fab910c Merge pull request #2004 from jmm/contrib
Update CONTRIBUTING.
2015-07-15 16:18:23 +01:00
Jesse McCarthy
0a4a0d8cd2 Update CONTRIBUTING.
* Add note about unbuildable versions.
* Remove links to removed sections.
2015-07-15 11:08:34 -04:00
Sebastian McKenzie
bd2fb6126b remove ecmaVersion <= 6 2015-07-15 15:34:47 +01:00
Sebastian McKenzie
472b079862 remove ecmaVersion <= 6 2015-07-15 15:34:47 +01:00
Sebastian McKenzie
21a11e5d2b hard code eslint path 2015-07-15 14:13:36 +01:00
Sebastian McKenzie
124e30face complete builder definitions - fixes #1982 2015-07-15 14:07:16 +01:00
Sebastian McKenzie
91e59cf2bb add TEST_GREP to scripts/test 2015-07-15 13:52:12 +01:00
Sebastian McKenzie
38553a6c42 switch node definitions to a DSL 2015-07-15 13:51:47 +01:00
Sebastian McKenzie
8d70ab5853 switch node definitions to a DSL 2015-07-15 13:51:47 +01:00
Sebastian McKenzie
a36496ee2d update CONTRIBUTING.md 2015-07-15 13:51:24 +01:00
Sebastian McKenzie
4656801673 add check for options existence before trying to look for deprecation supression property - fixes #1992 2015-07-15 12:15:15 +01:00
Sebastian McKenzie
e1eb79d570 add 5.7.0 changelog 2015-07-15 12:10:27 +01:00
Sebastian McKenzie
aef2be54dc v5.7.0 2015-07-15 11:53:46 +01:00
Sebastian McKenzie
9e81dd299d add postpublish script 2015-07-15 11:45:11 +01:00
Sebastian McKenzie
5b776b60e4 require shelljs from bootstrap file 2015-07-15 11:45:05 +01:00
Sebastian McKenzie
644daaed55 add git pull to build-website script 2015-07-15 11:44:57 +01:00
Sebastian McKenzie
9d514a3aa2 add postpublish support to scripts/publish 2015-07-15 11:44:43 +01:00
Sebastian McKenzie
afbd9a0870 fix babel-runtime dist require locations 2015-07-15 11:44:27 +01:00
Sebastian McKenzie
91cf6a823d v5.6.23 2015-07-15 11:23:07 +01:00
Sebastian McKenzie
61d246cb9a v5.6.23 2015-07-15 11:23:07 +01:00
Sebastian McKenzie
e677e49638 really fix spread inside the RHS of a destructuring assignment causing invalid unpack optimisation 2015-07-14 22:18:30 +01:00
Sebastian McKenzie
7fb3158be7 deopt on spread elements when performing array destructuring unpack optimisation 2015-07-14 22:08:26 +01:00
Sebastian McKenzie
45e1eb343b fix locations in build-dist babel-runtime script 2015-07-14 21:35:59 +01:00
Sebastian McKenzie
64875f3502 move down build-dist task in publish task 2015-07-14 21:34:18 +01:00
Sebastian McKenzie
0a9f43aac8 fix templates location 2015-07-14 21:33:29 +01:00
Sebastian McKenzie
91fb64eaf5 Merge pull request #1978 from babel/top-secret
5.7.0
2015-07-14 21:21:01 +01:00
Sebastian McKenzie
6e518d40bf fix babel-core dependency in babel-cli 2015-07-14 21:15:06 +01:00
Sebastian McKenzie
5e47530226 add linking debug to bootstrap script 2015-07-14 21:11:43 +01:00
Sebastian McKenzie
bfe92a4eea add comments: false to generation test 2015-07-14 21:10:35 +01:00
Sebastian McKenzie
66c29acb78 complete publish script 2015-07-14 21:09:27 +01:00
Sebastian McKenzie
e50babe916 add shouldPrintComment option and output comments when compact option is set to true - fixes #1810 2015-07-14 20:55:56 +01:00
Sebastian McKenzie
04e152ac77 fix use strict parsing 2015-07-14 17:14:32 +01:00
Sebastian McKenzie
eb8d7e679e fix use strict parsing 2015-07-14 17:14:32 +01:00
Sebastian McKenzie
e294b76a06 add extensions to babel-cli bin files 2015-07-14 17:14:10 +01:00
Sebastian McKenzie
0cbcadc2da add shelljs to root package.json 2015-07-14 16:56:20 +01:00
Sebastian McKenzie
a0097e2ec8 add npmignore to babylon 2015-07-14 16:48:43 +01:00
Sebastian McKenzie
8360001b96 add npmignore to babylon 2015-07-14 16:48:43 +01:00
Sebastian McKenzie
7c8f3ed696 rewrite bootstrap script to use shelljs as the bootstraping process is kinda weird now with multiple packages 2015-07-14 16:48:20 +01:00
Sebastian McKenzie
0c7c73435c add NODE_PATH export 2015-07-14 15:22:18 +01:00
Sebastian McKenzie
e9d0e55c39 sync tests with upstream acorn 2015-07-14 15:15:36 +01:00
Sebastian McKenzie
be09f12e42 sync tests with upstream acorn 2015-07-14 15:15:36 +01:00
Sebastian McKenzie
7c6de96ad7 elaborate on babylon readme 2015-07-14 15:14:57 +01:00
Sebastian McKenzie
d73938ee89 elaborate on babylon readme 2015-07-14 15:14:57 +01:00
Sebastian McKenzie
5dcd54f4bc add VERSION file to publish script add 2015-07-13 23:43:57 +01:00
Sebastian McKenzie
c13f722964 add back package.json 2015-07-13 23:43:35 +01:00
Sebastian McKenzie
ec6f919377 v5.6.21 2015-07-13 23:37:01 +01:00
Sebastian McKenzie
2f212cea0a v5.6.21 2015-07-13 23:37:01 +01:00
Sebastian McKenzie
a3a19d73b3 2.6.20 2015-07-13 21:09:45 +01:00
Sebastian McKenzie
dfbb6604e7 2.6.20 2015-07-13 21:09:45 +01:00
Sebastian McKenzie
e733235bea +x 2015-07-13 21:00:59 +01:00
Sebastian McKenzie
5f6350bada fix setup-git script name 2015-07-13 21:00:54 +01:00
Sebastian McKenzie
d28716cf93 v5.6.20 2015-07-13 20:50:20 +01:00
Sebastian McKenzie
da9493e1fa Revert "remove do expressions"
This reverts commit 420492388b.
2015-07-13 20:45:49 +01:00
Sebastian McKenzie
a286a86b6d Revert "remove do expressions"
This reverts commit 420492388b.
2015-07-13 20:45:49 +01:00
Sebastian McKenzie
2b32a2781e Revert "remove DoExpression generator"
This reverts commit 5cd8822888.
2015-07-13 20:45:43 +01:00
Sebastian McKenzie
86a49e2b1d v5.6.19 2015-07-13 16:41:15 +01:00
Sebastian McKenzie
5cd8822888 remove DoExpression generator 2015-07-13 16:39:30 +01:00
Sebastian McKenzie
1e77212efa remove do expressions 2015-07-13 16:37:08 +01:00
Sebastian McKenzie
420492388b remove do expressions 2015-07-13 16:37:08 +01:00
Sebastian McKenzie
6cc59a3ce7 t 2015-07-13 16:34:43 +01:00
Sebastian McKenzie
2d5d1ceb5c t 2015-07-13 16:34:43 +01:00
Sebastian McKenzie
6c5c216c40 add scripts 2015-07-12 12:51:20 +01:00
Sebastian McKenzie
1948946a4d add scripts 2015-07-12 12:51:20 +01:00
Sebastian McKenzie
0a7a01391c remove travis deploy 2015-07-12 12:36:01 +01:00
Sebastian McKenzie
7a268c95a5 remove dead files 2015-07-12 12:35:53 +01:00
Sebastian McKenzie
3d21b85d87 add +x bin files that reference the compiled ones 2015-07-12 12:35:49 +01:00
Sebastian McKenzie
d5be4bb5b9 v5.6.18 2015-07-12 00:39:50 +01:00
Sebastian McKenzie
d6dc29ec6a remove templates doc 2015-07-12 00:37:55 +01:00
Sebastian McKenzie
a1a1ad3d1c add missing semicolons 2015-07-12 00:36:21 +01:00
Sebastian McKenzie
ada45d5800 add missing semicolons 2015-07-12 00:36:21 +01:00
James Kyle
f3e77c7a0d Merge pull request #1983 from chicoxyzzy/code-docs-additions-by-chicoxyzzy
add some useful links
2015-07-11 15:09:29 -07:00
chico
b08012cf12 add some useful links 2015-07-12 01:05:50 +03:00
Sebastian McKenzie
16502488b9 Merge branch 'master' into top-secret
# Conflicts:
#	packages/babel/src/util.js
#	src/babel/tools/protect.js
#	src/babel/transformation/transformers/internal/explode.js
2015-07-11 23:00:28 +01:00
Sebastian McKenzie
ef275da1c2 Merge pull request #1897 from babel/code-docs
Code docs
2015-07-11 22:56:24 +01:00
James Kyle
cc6eb50f28 parenthesis -> parentheses 2015-07-11 14:48:40 -07:00
James Kyle
a260b6859f Clarify what the arrow function transformer does 2015-07-11 14:27:14 -07:00
James Kyle
eb182ccbe0 fix typo 2015-07-11 13:09:11 -07:00
Sebastian McKenzie
a08c21302d Merge branch 'master' into top-secret
# Conflicts:
#	packages/babylon/src/options.js
#	src/acorn/plugins/flow.js
#	src/acorn/src/util.js
2015-07-11 21:04:33 +01:00
Sebastian McKenzie
f9498d7a2d Merge branch 'master' into top-secret
# Conflicts:
#	packages/babylon/src/options.js
#	src/acorn/plugins/flow.js
#	src/acorn/src/util.js
2015-07-11 21:04:33 +01:00
Sebastian McKenzie
ff6620c8ea more architectural changes 2015-07-11 20:56:26 +01:00
Sebastian McKenzie
a226641631 more architectural changes 2015-07-11 20:56:26 +01:00
Sebastian McKenzie
afe5eb118c add .babelignore support to be more inline with other tools 2015-07-11 20:56:07 +01:00
James Kyle
fe1e99c799 Create generation/generators README 2015-07-11 12:53:46 -07:00
James Kyle
deeb75a5d1 Add descriptions to transformation/transformers/es6/destructuring 2015-07-11 12:53:46 -07:00
James Kyle
961d482269 Add content to tools README 2015-07-11 12:53:46 -07:00
James Kyle
1c8f0dcab4 Add content to helpers README 2015-07-11 12:53:46 -07:00
James Kyle
5dc39439ed Add content to generation README 2015-07-11 12:53:46 -07:00
James Kyle
58e029a064 Add content to api README 2015-07-11 12:53:46 -07:00
James Kyle
01ea72790d Add descriptions to types/flow 2015-07-11 12:53:45 -07:00
James Kyle
118ac2e62d Add descriptions to traversal/scope/index 2015-07-11 12:53:45 -07:00
James Kyle
3207a387a7 Add descriptions to transformation/transformers/es6/constants 2015-07-11 12:53:45 -07:00
James Kyle
90a5b96480 Add descriptions to transformation/transformers/es6/arrow-functions 2015-07-11 12:53:45 -07:00
James Kyle
74cf5ac552 Add descriptions to transformation/transformers/es5/properties.mutators 2015-07-11 12:53:45 -07:00
James Kyle
dce1a3548c Add descriptions to transformation/transformers/es3/property-literals 2015-07-11 12:53:45 -07:00
James Kyle
d67ba39d1c Add descriptions to transformation/transformers/es3/member-expression-literals 2015-07-11 12:53:45 -07:00
James Kyle
894c3fe481 Add descriptions to transformation/file/options/parsers 2015-07-11 12:53:29 -07:00
James Kyle
27cce1446c Add descriptions to transformation/file/options/index 2015-07-11 12:53:28 -07:00
James Kyle
7e64bcd85a Add descriptions to tools/protect 2015-07-11 12:53:28 -07:00
James Kyle
4a851130ee Add descriptions to helpers/parse 2015-07-11 12:53:28 -07:00
James Kyle
6a9b14563e Add descriptions to helpers/object 2015-07-11 12:53:28 -07:00
James Kyle
4f11c6a4be Add descriptions to helpers/normalize-ast 2015-07-11 12:53:28 -07:00
James Kyle
d7a669e96b Add descriptions to helpers/merge 2015-07-11 12:53:28 -07:00
James Kyle
4b6a5f4ea9 Add descriptions to helpers/code-frame 2015-07-11 12:53:28 -07:00
James Kyle
9c60c633d2 Add descriptions to generation/whitespace 2015-07-11 12:53:27 -07:00
James Kyle
3b428e45a3 Add descriptions to generation/source-map 2015-07-11 12:53:27 -07:00
James Kyle
d961e2d291 Add descriptions to generation/position 2015-07-11 12:53:27 -07:00
James Kyle
2d884c282a Add descriptions to generation/index 2015-07-11 12:53:27 -07:00
James Kyle
350a3b664f Add descriptions to generation/buffer 2015-07-11 12:53:27 -07:00
James Kyle
9e4ec19487 Add descriptions to generation/node/whitespace 2015-07-11 12:53:27 -07:00
James Kyle
d613975feb Add descriptions to generation/node/printer 2015-07-11 12:53:27 -07:00
James Kyle
77e9387c5f Add descriptions to generation/node/parenthesis 2015-07-11 12:53:26 -07:00
James Kyle
ac00de44a7 Add descriptions to generation/node/index 2015-07-11 12:53:26 -07:00
James Kyle
8e03a2b720 Add descriptions to generation/generators/types 2015-07-11 12:53:26 -07:00
James Kyle
4e660f7b3e Add descriptions to generation/generators/template-literals 2015-07-11 12:53:26 -07:00
James Kyle
63618f876c Add descriptions to generation/generators/statements 2015-07-11 12:53:26 -07:00
James Kyle
155f3407bc Add descriptions to generation/generators/modules 2015-07-11 12:53:26 -07:00
James Kyle
bf62042fe6 Add descriptions to generation/generators/methods 2015-07-11 12:53:26 -07:00
James Kyle
2a226b3a2b Add descriptions to generation/generators/jsx 2015-07-11 12:53:26 -07:00
James Kyle
f996d6bfa6 Add descriptions to generation/generators/flow 2015-07-11 12:53:25 -07:00
James Kyle
89b1c387a0 Add descriptions to generation/generators/expressions 2015-07-11 12:53:25 -07:00
James Kyle
dfea7368e1 Add descriptions to generation/generators/comprehensions 2015-07-11 12:53:25 -07:00
James Kyle
06867dd52b Add descriptions to generation/generators/classes 2015-07-11 12:53:25 -07:00
James Kyle
3f72a4b200 Add descriptions to generation/generators/base 2015-07-11 12:53:25 -07:00
James Kyle
ee286ed482 Add descriptions to api/node 2015-07-11 12:53:25 -07:00
James Kyle
8604c0c2cd Add descriptions to api/browser 2015-07-11 12:53:25 -07:00
James Kyle
b2476b3603 Add descriptions to api/register/node 2015-07-11 12:53:24 -07:00
James Kyle
c2ebe7f26d Add descriptions to api/register/cache 2015-07-11 12:53:24 -07:00
James Kyle
4809747304 Add placeholders 2015-07-11 12:53:23 -07:00
James Kyle
e572d25640 Add README files to be filled out 2015-07-11 12:43:56 -07:00
James Kyle
07e3d9a8df Add intro inside of src/ directory 2015-07-11 12:43:56 -07:00
Sebastian McKenzie
be44e608e7 allowing specifying of babelrc config via package.json - closes #1818 2015-07-11 16:21:08 +01:00
Sebastian McKenzie
423d8c510d Begin transition of Babel to a more scalable architecture, async flow to allow for RPC and better build system for multiple packages 2015-07-11 12:39:54 +01:00
Sebastian McKenzie
fedf894904 Begin transition of Babel to a more scalable architecture, async flow to allow for RPC and better build system for multiple packages 2015-07-11 12:39:54 +01:00
Sebastian McKenzie
7763c74563 Merge branch 'master' of github.com:babel/babel 2015-07-11 10:35:57 +01:00
Sebastian McKenzie
e45dc0fbaf Merge pull request #1974 from loganfsmyth/hoist-class-inherits
Hoist class inheritance call so it runs before prototype use.
2015-07-11 09:59:47 +01:00
Sebastian McKenzie
8539182452 Merge pull request #1976 from cpojer/import-typeof
Add support for `import typeof`, fixes #1975
2015-07-11 09:58:49 +01:00
cpojer
f757ca01a1 Add support for import typeof, fixes #1975 2015-07-11 01:54:25 -07:00
cpojer
18380d2aee Add support for import typeof, fixes #1975 2015-07-11 01:54:25 -07:00
Logan Smyth
19b1032474 Hoist class inheritance call so it runs before prototype use - fixes #1972 2015-07-10 19:51:53 -07:00
Sebastian McKenzie
f7761982cd fix logo url 2015-07-10 16:21:38 +01:00
Sebastian McKenzie
4b3b6970b4 add .js extensions 2015-07-10 16:16:41 +01:00
Sebastian McKenzie
6141c66a63 remove internal protection 2015-07-10 16:16:36 +01:00
Sebastian McKenzie
950d3d2280 Merge pull request #1969 from christophehurpeau/patch-1
option help add "separated by comma" for options whitelist, blacklist…
2015-07-10 15:29:36 +01:00
Christophe Hurpeau
12d7b33f62 option help add "separated by comma" for options whitelist, blacklist and optional 2015-07-10 16:29:07 +02:00
Sebastian McKenzie
f9c7d0d095 add validation to plugins 2015-07-10 02:59:50 +01:00
Sebastian McKenzie
efaa0608af removed unused variable 2015-07-09 21:28:53 +01:00
Sebastian McKenzie
b522bfe822 update babel/register to work with new option manager and add filename option type 2015-07-09 21:25:06 +01:00
Sebastian McKenzie
9efb02f60f rewrite options handling to be MUCH more maintainable and less like spaghetti 2015-07-09 21:11:51 +01:00
Sebastian McKenzie
9805c0387f reenable travis node 0.10 testing 2015-07-09 19:17:12 +01:00
Sebastian McKenzie
81019ec76d v5.6.17 2015-07-09 19:04:26 +01:00
Sebastian McKenzie
b0d0adda9b add 5.6.17 changelog 2015-07-09 19:03:32 +01:00
Sebastian McKenzie
d335535f04 Revert "Move into for block"
This reverts commit 1945f849c3.

# Conflicts:
#	src/babel/generation/index.js
2015-07-09 19:01:37 +01:00
Sebastian McKenzie
f738c95c8d Merge branch 'master' into development 2015-07-09 18:22:22 +01:00
Sebastian McKenzie
7fec1c98e5 Merge pull request #1962 from benjamn/development
Update regenerator to v0.8.34, and remove recast and ast-types from package.json.
2015-07-09 18:21:17 +01:00
Sebastian McKenzie
33ae022e4d add ClassProperty handling to t.isReferenced - fixes #1961 2015-07-09 18:19:20 +01:00
Ben Newman
eac9e9b372 Update regenerator to v0.8.34, and remove recast and ast-types.
This version of Regenerator pegs recast to v0.10.18, which pegs ast-types
to v0.8.2, which contains special support for all Babel AST types:
https://github.com/benjamn/ast-types/blob/master/def/babel.js

This version of Regenerator also exports the ast-types module object that
it uses (as regenerator.types), so that consumers like Babel can refer to
the exact same copy of ast-types when necessary, rather than requiring
ast-types themselves. Why that was risky: #1958.
2015-07-09 13:12:58 -04:00
Sebastian McKenzie
eb6b38d3a8 add 5.6.13-5.6.16 changelogs 2015-07-09 16:30:45 +01:00
Sebastian McKenzie
8111ab28d7 v5.6.16 2015-07-09 16:13:06 +01:00
Sebastian McKenzie
04a29f8344 remove accidental stackTraceLimit assignment 2015-07-09 16:12:06 +01:00
Sebastian McKenzie
ed25845152 remove accidental stackTraceLimit assignment 2015-07-09 16:12:06 +01:00
Sebastian McKenzie
457638e904 add type comments to t.valueToNode 2015-07-09 16:11:57 +01:00
Sebastian McKenzie
2e5255dbf5 peg recast version - fixes #1958 2015-07-09 16:11:46 +01:00
Brian Donovan
86095d9dac Merge pull request #1951 from zbraniecki/traverse-in-plugins-typo
Fix a typo in plugin-manager import of traverse
2015-07-08 13:13:19 -07:00
Zibi Braniecki
02dd785d02 Fix a typo in plugin-manager import of traverse 2015-07-08 13:06:59 -07:00
Sebastian McKenzie
205fab2ed8 split up badges 2015-07-08 14:58:31 +01:00
Sebastian McKenzie
d01b26951b channel -> community 2015-07-08 14:45:56 +01:00
Sebastian McKenzie
fc15c91b2a replace descriptor.writable assignment in createDecoraredObject helper - fixes #1949 2015-07-08 14:45:50 +01:00
Sebastian McKenzie
421b01865f add Generated/User/Directive virtual node types 2015-07-08 11:35:56 +01:00
Sebastian McKenzie
af7510adec fix some bugs in PathHoister - fixes babel-plugins/babel-plugin-react-constant-elements#1
- Don't hoist constant elements to the same function as their original paths function parent.
 - Push each violation paths ancestry to the breakOnScopePaths collection to avoid constant hoisting to nested paths.
2015-07-08 11:35:34 +01:00
Sebastian McKenzie
ec7c40fbf6 add quiet option to CLI - fixes #1931 2015-07-07 11:26:45 +01:00
Sebastian McKenzie
4a36a9fb31 check for functions in util.shouldIgnore - closes #1865, closes #1859 2015-07-07 11:23:31 +01:00
Sebastian McKenzie
4d25b0d96a Merge branch 'master' of github.com:babel/babel 2015-07-07 11:12:42 +01:00
Sebastian McKenzie
babc9c90b4 fix tail call recursion on functions with less arguments than parameters - fixes #1938 2015-07-07 11:11:58 +01:00
Sebastian McKenzie
288293ca11 Merge pull request #1936 from loganfsmyth/system-module-hoisting
Only special-case for..on declaration hoisting - fixes #1929
2015-07-07 10:54:26 +01:00
Sebastian McKenzie
a262e99abd strip flow directives in flow transformer - fixes #1934 2015-07-07 10:52:43 +01:00
Logan Smyth
b518394a3f Only special-case for..on/of declaration hoisting - fixes #1929 2015-07-06 21:06:11 -07:00
Sebastian McKenzie
337c51df5c fixes out of bounds check to default parameter template - #1845 - cc @RReverser 2015-07-06 21:25:33 +01:00
Sebastian McKenzie
0509fb148f add out of bounds check to default parameter template - addresses #1845 - cc @RReverser 2015-07-06 20:12:10 +01:00
Sebastian McKenzie
bb5f1120b7 Merge branch 'master' of github.com:babel/babel 2015-07-05 21:41:58 +01:00
Sebastian McKenzie
38d46012a7 Merge pull request #1926 from loganfsmyth/systemjs-modules-export
Optimize export-from in System.register - fixes #1722
2015-07-05 21:39:30 +01:00
Logan Smyth
cdb8e3aefa Optimize export-from in System.register - fixes #1722 2015-07-05 11:40:33 -07:00
Sebastian McKenzie
4a84cd785a Merge pull request #1915 from loganfsmyth/destructuring-default-hoisting
Ensure _blockHoist is set on function destructuring defaults
2015-07-05 19:24:01 +01:00
Logan Smyth
f47d17345c Ensure _blockHoist is set on function destructuring defaults - fixes #1908 2015-07-05 09:10:09 -07:00
Sebastian McKenzie
8746ca8d31 add Statement virtual type 2015-07-05 01:23:37 +02:00
Sebastian McKenzie
76e954bc36 add reference to issue #1920 2015-07-05 01:23:32 +02:00
Sebastian McKenzie
64903d0dcf Merge branch 'master' of github.com:babel/babel 2015-07-04 23:33:33 +02:00
Sebastian McKenzie
1fd0b1f741 delay this assignment when referencing this inside an arrow function pre-bare super in derived class constructors - fixes #1920 2015-07-04 23:32:11 +02:00
Sebastian McKenzie
cda2bfce38 enable do expression tests 2015-07-04 21:51:57 +02:00
Sebastian McKenzie
0e4bb5ee3f clean up verifyConstructor classes visitor and disallow super.* before super() in derived class constructors - fixes #1921 2015-07-04 21:38:22 +02:00
Sebastian McKenzie
e9793b1f16 Merge pull request #1916 from conradz/inline-single-child
Handle single child when using React inlining
2015-07-04 11:23:15 +02:00
Conrad Zimmerman
224db29c05 Handle single child when using React inlining
Changes optimisation.react.inlineElements to handle a single child as the
value of the `children` property instead of wrapping it with an array.
This matches the behavior of `React.createElement`.
2015-07-03 18:55:38 -04:00
Sebastian McKenzie
bd1bd38556 add undeclared type variable 2015-07-03 00:14:40 +02:00
Sebastian McKenzie
1f39114126 Merge branch 'master' into development 2015-07-03 00:07:53 +02:00
Sebastian McKenzie
4c0b8599f1 add optional context parameter to NodePath#get 2015-07-03 00:07:37 +02:00
Sebastian McKenzie
848909620c add more comments to path methods 2015-07-03 00:07:23 +02:00
Sebastian McKenzie
c40215497d Merge pull request #1900 from samccone/sjs/opt2
rework findCommonStringDelimiter
2015-07-02 23:54:52 +02:00
Sebastian McKenzie
6450f5263e Merge pull request #1901 from loganfsmyth/constructor-scope-fix
Properly regenerate scope for replaced nodes - fixes #1773
2015-07-02 23:54:28 +02:00
Sam Saccone
74c59c94ce 2015-07-02 16:57:12 -04:00
Logan Smyth
3f38a83600 Properly regenerate scope for replaced nodes - fixes #1773 2015-07-01 22:06:05 -07:00
Sam Saccone
1945f849c3 Move into for block
https://www.youtube.com/watch?v=FHDwRECFL8M
2015-07-01 20:36:24 -07:00
Sam Saccone
5b0b7ba226 🍴 Switch to ternary for return
https://www.youtube.com/watch?v=XAbY2cmEsS0
2015-07-01 20:36:17 -07:00
James Kyle
42de6bc716 Merge pull request #1894 from samccone/patch-4
🐳
2015-07-02 01:06:50 +01:00
James Kyle
fb66f347b9 Merge pull request #1895 from samccone/patch-5
remove 💀 comment lines
2015-07-02 01:05:51 +01:00
Brian Donovan
5e28bd4e68 Merge pull request #1893 from samccone/patch-1
🍕 Fix grammatical issue
2015-07-01 16:16:20 -07:00
Sam Saccone
9869566963 remove 💀 comment lines
Added in 
3561efdb86

if this is a style thing you want to keep around then my all means close away.
2015-07-01 15:59:05 -07:00
Sam Saccone
4a27b10e8a 👶 2015-07-01 15:56:11 -07:00
Sam Saccone
c3b5ed5b3d 💄 Fix grammatical issue 2015-07-01 15:51:56 -07:00
Sebastian McKenzie
afa4871a08 Merge pull request #1892 from samccone/patch-1
📝 better english
2015-07-02 00:48:57 +02:00
Sam Saccone
70c739250b 📝 better english 2015-07-01 15:48:00 -07:00
Sebastian McKenzie
722e706a8c Merge pull request #1891 from samccone/patch-1
️  this that this
2015-07-02 00:42:05 +02:00
Sam Saccone
f3973c8397 📝 clarify how it inherits this 2015-07-01 15:41:15 -07:00
Sebastian McKenzie
47c3792d34 Merge pull request #1890 from samccone/patch-1
️  Add link to ESTree
2015-07-02 00:39:23 +02:00
Sam Saccone
456accb4b3 📝 Add link to ESTree 2015-07-01 15:37:20 -07:00
Sebastian McKenzie
72771ed439 update escape regex test to use new lodash result 2015-06-30 23:56:47 +01:00
Sebastian McKenzie
7cb7ea4248 Merge pull request #1884 from arthurvr/resolve
Add `resolve` to `CONTRIBUTING.md`
2015-06-30 23:39:33 +01:00
Arthur Verschaeve
301df15921 Add resolve to CONTRIBUTING.md
Introduced in aaf4cbf06f
2015-06-30 23:56:30 +02:00
Sebastian McKenzie
15535406bd Merge pull request #1883 from arthurvr/patch-1
Remove `user-home` from `CONTRIBUTING.md`
2015-06-30 22:43:42 +01:00
Arthur Verschaeve
63f53e3773 Remove user-home from CONTRIBUTING.md
In favor of `user-or-tmp`

Ref 90b8826e73
2015-06-30 23:40:24 +02:00
Brian Donovan
03a979a6bd Merge pull request #1867 from arthurvr/deps
Add `path-exists` to `CONTRIBUTING.md`
2015-06-30 14:31:24 -07:00
Sebastian McKenzie
910622e66e fix linting errors 2015-06-30 15:17:26 +01:00
Sebastian McKenzie
c5a8702021 clean up derived classes, fixes super path referencing user constructor instead of our new function - #1877 2015-06-30 14:55:11 +01:00
Sebastian McKenzie
336c65fe2c restructure classes transformer, fix class name inference - #1877 2015-06-30 14:49:04 +01:00
Sebastian McKenzie
092d98fb27 add constructor to body in order that it was supplied in - fixes #1877 2015-06-30 10:10:52 +01:00
Sebastian McKenzie
e55ce575cd move up template literal simplification logic - fixes #1874 2015-06-29 23:36:06 +01:00
Sebastian McKenzie
d63ae5fce8 remove loose console.log 2015-06-29 22:59:23 +01:00
Sebastian McKenzie
541309c4bb fix collisions for getBindingIdentifiers 2015-06-29 22:04:17 +01:00
Sebastian McKenzie
2d289150d1 Merge pull request #1868 from benjamn/patch-2
Upgrade Regenerator to 0.8.32.
2015-06-29 20:47:05 +01:00
Ben Newman
b9f6169ed4 Upgrade Regenerator to 0.8.32.
This includes some major runtime performance improvements:
https://github.com/facebook/regenerator/pull/207
https://github.com/facebook/regenerator/pull/208

And also some bug fixes relating to async generator functions:
https://github.com/facebook/regenerator/commit/29d81b6929
https://github.com/facebook/regenerator/commit/7d2a052ddb
https://github.com/facebook/regenerator/commit/5b9dd1086d
2015-06-29 10:43:54 -04:00
Arthur Verschaeve
ce372281cd Add path-exists to CONTRIBUTING.md 2015-06-29 12:35:37 +02:00
Sebastian McKenzie
0044100e3d perform function name inference on functions in properties before they're properly visited - fixes #1860 2015-06-29 00:20:47 +01:00
Sebastian McKenzie
81edc4c6ab add make comment-issues skeleton 2015-06-28 00:59:24 +01:00
Sebastian McKenzie
3b1a9a0adb trim eval code in babel-node 2015-06-28 00:59:12 +01:00
Sebastian McKenzie
8ab90aacd3 add babel-core version to babel-cli version - closes #1861 2015-06-28 00:59:05 +01:00
Sebastian McKenzie
a1a46882fd v5.6.15 2015-06-27 00:07:24 +01:00
Sebastian McKenzie
12b4e6db40 v5.6.13 2015-06-27 00:06:40 +01:00
Sebastian McKenzie
7f06bb79c0 attempt to fix master fetching for automatic travis merge 2015-06-26 23:58:57 +01:00
Sebastian McKenzie
34218afdae clean up build website script 2015-06-26 23:41:19 +01:00
Sebastian McKenzie
b94118db5e output debug current branch/commit info 2015-06-26 23:32:45 +01:00
Sebastian McKenzie
54819b94e9 skip flow types when finding rest parameter references 2015-06-26 23:29:09 +01:00
Sebastian McKenzie
0da4ba4598 clean up inType tracking in flow parser plugin 2015-06-26 23:26:32 +01:00
Sebastian McKenzie
50ca6b1018 clean up inType tracking in flow parser plugin 2015-06-26 23:26:32 +01:00
Sebastian McKenzie
2d195c4843 add logging for publish cli 2015-06-26 20:30:24 +01:00
Sebastian McKenzie
2f0d0c94ef try alternate merge parameter 2015-06-26 20:30:16 +01:00
Sebastian McKenzie
5e3ea5b6e7 add update-ref master to merge-development-with-master script 2015-06-26 19:48:48 +01:00
Sebastian McKenzie
95128f98bc Merge branch 'master' into development 2015-06-26 16:59:49 +01:00
Sebastian McKenzie
c4d1d58167 +x 2015-06-26 16:59:43 +01:00
Sebastian McKenzie
7da1d9fadd wrap TRAVIS_COMMIT variable in curlies for consistency 2015-06-26 16:48:52 +01:00
Sebastian McKenzie
6ab57fd367 rebuild website on new version, automatically merge development branch with master - closes #1854, closes #1849 2015-06-26 16:46:52 +01:00
Sebastian McKenzie
d4edce6559 only publish babel-cli when the directory has had changes since the last version - fixes #1848 2015-06-26 16:21:37 +01:00
Sebastian McKenzie
9c8cb33a09 remove babel-core from babel-cli packag.ejson 2015-06-26 16:19:22 +01:00
Sebastian McKenzie
a2fb70bae3 fix deprecated return from visitor method api 2015-06-26 15:16:31 +01:00
Sebastian McKenzie
273a81fe1f fix up babel-eslint dependency 2015-06-26 15:15:19 +01:00
Sebastian McKenzie
72a0ac5e02 v5.6.14 2015-06-26 15:09:03 +01:00
Sebastian McKenzie
c5ace10536 update babel-eslint 2015-06-26 15:07:56 +01:00
Sebastian McKenzie
b833614b87 update travis with new npm api key 2015-06-26 14:10:05 +01:00
Sebastian McKenzie
ae067a08b7 switch to mocha dot reporter 2015-06-26 13:23:15 +01:00
Sebastian McKenzie
f56337541f change readme tagline 2015-06-26 13:23:08 +01:00
Sebastian McKenzie
1fe8447a1a add test release explanation to changelog 2015-06-26 12:25:40 +01:00
Sebastian McKenzie
13bbfa041d v5.6.13 2015-06-26 12:25:00 +01:00
Sebastian McKenzie
c43bbb9bf6 use npm to publis new version - fixes #1847 2015-06-26 12:24:01 +01:00
Sebastian McKenzie
1bca59a921 clean up readme - add back badges 2015-06-26 11:54:51 +01:00
Sebastian McKenzie
f80fdf7359 5.6.12 2015-06-26 11:41:34 +01:00
Sebastian McKenzie
aefd69d31e v5.6.12 2015-06-26 11:40:40 +01:00
Sebastian McKenzie
e328031b19 add 5.6.12 changelog 2015-06-26 11:39:47 +01:00
Sebastian McKenzie
571b6a4cd7 check parent node alongside path in shadow functions 2015-06-26 11:39:10 +01:00
Sebastian McKenzie
41cf942391 clean up shadow functions findParent logic - fixes #1846 2015-06-26 11:34:13 +01:00
Sebastian McKenzie
98f28b8e89 5.6.11 2015-06-26 02:40:00 +01:00
Sebastian McKenzie
8f88afc037 v5.6.11 2015-06-26 02:39:04 +01:00
Sebastian McKenzie
6359675a4f make shadowed function findParent target finder more reliable 2015-06-26 02:38:14 +01:00
Sebastian McKenzie
a265c3f25c add missing semi 2015-06-26 02:25:46 +01:00
Sebastian McKenzie
29eb99ee93 rejigger shadowd function findParent logic 2015-06-26 02:24:42 +01:00
Sebastian McKenzie
0c5c1ff989 remove unused variable 2015-06-26 02:22:10 +01:00
Sebastian McKenzie
499951123a add 5.6.11 changelog 2015-06-26 02:21:34 +01:00
Sebastian McKenzie
c0fd4c1f9e merge es6.parameters.rest and es6.parameters.default transformers
This is necessary in order to retain correct function arity and to have
completely correct semantics. Sometimes features are tied together so much
that they would require so much desugaring to retain the correct semantics
that they'd be equivalent to... the normal transpiled output.
2015-06-26 02:20:16 +01:00
Sebastian McKenzie
579e6fecee upgrade internal dev babel dependency to 5.6.10 2015-06-26 02:05:43 +01:00
Sebastian McKenzie
bb3665a3b6 5.6.10 2015-06-26 01:12:50 +01:00
Sebastian McKenzie
e6de688234 v5.6.10 2015-06-26 01:11:32 +01:00
Sebastian McKenzie
4c233e88ff add use strict 2015-06-26 01:09:47 +01:00
Sebastian McKenzie
ae2ba0b5a3 add 5.6.10 changelog 2015-06-26 01:08:36 +01:00
Sebastian McKenzie
e34d950793 require babel-core at the top of the file 2015-06-26 01:07:54 +01:00
Sebastian McKenzie
84c773a7ca add support for trailing commas in arrow function parameter lists - fixes #1841 2015-06-26 00:37:33 +01:00
Sebastian McKenzie
e4083fbbd7 add support for trailing commas in arrow function parameter lists - fixes #1841 2015-06-26 00:37:33 +01:00
Sebastian McKenzie
59ed7977ef 5.6.9 2015-06-25 23:59:12 +01:00
Sebastian McKenzie
dc441e9a8f v5.6.9 2015-06-25 23:58:07 +01:00
Sebastian McKenzie
2e21795f57 add index.js to fix internal api error 2015-06-25 23:57:16 +01:00
Sebastian McKenzie
5c988f7fc8 5.6.8 2015-06-25 23:35:34 +01:00
Sebastian McKenzie
493826973e v5.6.8 2015-06-25 23:34:30 +01:00
Sebastian McKenzie
1acc71aa4e fix api module id relative tests 2015-06-25 23:32:43 +01:00
Sebastian McKenzie
bbab5f72ec add 5.6.8 changelog 2015-06-25 23:31:07 +01:00
Sebastian McKenzie
58ff9e387a remove root internals protect 2015-06-25 23:30:43 +01:00
Sebastian McKenzie
5a0d099984 don't add protect to register either 2015-06-25 23:28:27 +01:00
Sebastian McKenzie
05c95e04f7 don't add protect to polyfill 2015-06-25 23:26:24 +01:00
Sebastian McKenzie
88430b4be2 forgive hotlinking to polyfill 2015-06-25 23:24:45 +01:00
Sebastian McKenzie
19adcfae4d add type import 2015-06-25 23:22:42 +01:00
Sebastian McKenzie
7c4fe984ce start linting babel-cli/bin - fixes #1836 2015-06-25 23:22:38 +01:00
Sebastian McKenzie
4476e8311c use relative tools/protect.js filenames 2015-06-25 23:20:18 +01:00
Sebastian McKenzie
2a3142273d add path-exists dependency to babel-cli 2015-06-25 23:20:08 +01:00
Sebastian McKenzie
bbcb889a49 Merge branch 'master' of github.com:babel/babel 2015-06-25 23:04:24 +01:00
Sebastian McKenzie
c87f85815b used filter rather than setting init properties to null in properties.computed transformer - fixes #1831 2015-06-25 23:04:17 +01:00
Sebastian McKenzie
48d0df17d0 Merge pull request #1832 from Mark-Simulacrum/path-exists
Use path-exists module instead of fs.exists.
2015-06-25 22:57:27 +01:00
Sebastian McKenzie
01b243347f add NodePath#baseTypeStrictlyMatches method 2015-06-25 22:55:46 +01:00
Sebastian McKenzie
45a5cbf72f use capitalised builder method 2015-06-25 22:55:35 +01:00
Sebastian McKenzie
05efae1c58 complete t.createTypeAnnotationBasedOnTypeof 2015-06-25 22:55:25 +01:00
Sebastian McKenzie
c08fff4b44 add node builder for normal AST node type 2015-06-25 22:55:12 +01:00
Sebastian McKenzie
13e910ea83 force spaces for binary expressions - fixes #1835 2015-06-25 22:55:00 +01:00
Mark-Simulacrum
b308602098 Use path-exists instead of fs.exists.
fs.exists is being deprecated, see: https://github.com/nodejs/io.js/issues/103.
2015-06-25 12:39:39 -06:00
Sebastian McKenzie
560a044d8f Merge pull request #1821 from kpdecker/destructure-performance
Avoid deopt in iterable destructure template
2015-06-25 15:23:53 +01:00
Sebastian McKenzie
619fbe4c3b Merge pull request #1830 from kpdecker/avoid-define-property
Avoid defineProperty when not needed
2015-06-25 15:23:39 +01:00
kpdecker
1d83ad6cce Avoid defineProperty when not needed
This lets us use the fast path for most object literal assignments and then utilizes the defineProperty path when there is a chance that we could hit the setter issue described in #357.

10x performance boosts seen for the six-speed test case, going from 200k operations/sec to 2M ops/sec.
2015-06-25 09:22:03 -05:00
kpdecker
5353ccd773 Move slice iterator helper out of primary call
Avoids overhead of instantiating the helper on each call to the slice to array helper.
2015-06-25 09:18:12 -05:00
Sebastian McKenzie
a8e23d2eb9 ignore templates folder in protect plugin 2015-06-25 14:33:38 +01:00
Sebastian McKenzie
95d830fde0 don't output comma separator for decorator list and output Property decorators - fixes #1811 2015-06-25 12:23:45 +01:00
Sebastian McKenzie
c8a5d7d970 Merge branch 'arthurvr-dep' 2015-06-25 12:12:21 +01:00
Sebastian McKenzie
43481eb2cc Merge branch 'dep' of https://github.com/arthurvr/babel into arthurvr-dep 2015-06-25 12:12:19 +01:00
Sebastian McKenzie
b8bb665691 Merge branch 'arthurvr-tests' 2015-06-25 12:12:05 +01:00
Sebastian McKenzie
e6846b2730 Merge branch 'tests' of https://github.com/arthurvr/babel into arthurvr-tests 2015-06-25 12:12:05 +01:00
Sebastian McKenzie
31c1286a3c protect internal files from hotlinking 2015-06-25 12:10:22 +01:00
Arthur Verschaeve
489f9e92b5 Add tests for util.resolve 2015-06-25 10:10:56 +02:00
Arthur Verschaeve
073809efac Remove leven dependency 2015-06-25 09:37:27 +02:00
Brian Donovan
c9b8e2f3ce Merge pull request #1822 from azu/patch-1
Add missing asterisk in CHANGELOG
2015-06-24 21:23:51 -07:00
azu
c6cb871355 Add missing asterisk in CHANGELOG 2015-06-25 13:17:23 +09:00
kpdecker
1b0e5b3ed1 Avoid deopt in iterable destructure template
The try/catch was forcing deoptimization under most engines. This roughly doubles throughput under V8 and 7x increases were seen under Firefox.

Performance numbers based on https://github.com/kpdecker/six-speed/tree/master/tests/destructuring
2015-06-24 22:42:13 -05:00
Sebastian McKenzie
0f70c76312 5.6.7 2015-06-25 04:18:49 +01:00
Sebastian McKenzie
e8c672bf4f v5.6.7 2015-06-25 04:17:52 +01:00
Sebastian McKenzie
7083ac61ff remove test.js 2015-06-25 04:16:06 +01:00
Sebastian McKenzie
d256809120 Merge branch 'master' of github.com:babel/babel
# Conflicts:
#	src/babel/traversal/path/replacement.js
2015-06-25 04:12:13 +01:00
Sebastian McKenzie
26a19f82d2 add 5.6.7 changelog 2015-06-25 04:11:40 +01:00
Sebastian McKenzie
128d3b5c91 add missing computed loose test - ref #1820 2015-06-25 04:11:32 +01:00
Sebastian McKenzie
c1a080d0ca supress duplicate deprecation messages 2015-06-25 04:11:13 +01:00
Sebastian McKenzie
0b1ce6c9a4 always coerce leading computed property initialisers into the init object - fixes #1820 2015-06-25 04:10:56 +01:00
Sebastian McKenzie
a6f04055c0 fix block scoping transformer 2015-06-25 04:10:32 +01:00
Sebastian McKenzie
c3219e8b88 deprecate returning source strings from visitor methods 2015-06-25 03:51:25 +01:00
Sebastian McKenzie
a35c863341 deprecate returning source strings from visitor methods 2015-06-25 03:50:10 +01:00
Sebastian McKenzie
6f862a4c45 actually push for left declaration to the returned block scoping body - fixes #1819 2015-06-25 03:48:29 +01:00
Sebastian McKenzie
cf38210fd2 5.6.6 2015-06-24 23:28:44 +01:00
Sebastian McKenzie
5c9d564339 v5.6.6 2015-06-24 23:27:44 +01:00
Sebastian McKenzie
030d5f7c6b add labels, and inX properties to lookahead getState 2015-06-24 23:26:59 +01:00
Sebastian McKenzie
031a61515b add labels, and inX properties to lookahead getState 2015-06-24 23:26:59 +01:00
Sebastian McKenzie
9e0cc028ed add inType assignment in flow parse declare method 2015-06-24 23:26:48 +01:00
Sebastian McKenzie
d3884fd53b add inType assignment in flow parse declare method 2015-06-24 23:26:48 +01:00
Sebastian McKenzie
c6eef3080e add 5.6.6 changelog 2015-06-24 23:26:35 +01:00
Sebastian McKenzie
25be0a974d fixing linting errors 2015-06-24 23:20:03 +01:00
Sebastian McKenzie
a7f669e154 fix isKeyword flow overload 2015-06-24 23:18:21 +01:00
Sebastian McKenzie
7ccd135e83 fix isKeyword flow overload 2015-06-24 23:18:21 +01:00
Sebastian McKenzie
9a39b131ea acorn resync 2015-06-24 23:15:27 +01:00
Sebastian McKenzie
4fc1bbeb60 acorn resync 2015-06-24 23:15:27 +01:00
Sebastian McKenzie
32a4d7172b optimise generator for compact mode 2015-06-24 23:15:22 +01:00
Sebastian McKenzie
f5540d19a4 parse void as an identifier when inside a type annotation to avoid setting void keyword token - cc @DmitrySoshnikov 2015-06-24 23:15:00 +01:00
Sebastian McKenzie
aa25903c05 parse void as an identifier when inside a type annotation to avoid setting void keyword token - cc @DmitrySoshnikov 2015-06-24 23:15:00 +01:00
Sebastian McKenzie
23ec1a455e upgrade babel-plugin-dead-code-elimination 2015-06-24 23:14:08 +01:00
Sebastian McKenzie
e6ac2d049b add 5.6.5 changelog 2015-06-24 13:50:53 +01:00
Sebastian McKenzie
084ae31816 5.6.5 2015-06-24 13:48:43 +01:00
Sebastian McKenzie
8e530afd78 v5.6.5 2015-06-24 13:47:54 +01:00
Sebastian McKenzie
6c66a82b37 Merge branch 'master' of github.com:babel/babel 2015-06-24 13:46:05 +01:00
Sebastian McKenzie
737abca3a9 use this.space() instead of manually pushing 2015-06-24 13:45:56 +01:00
Sebastian McKenzie
9db43ca7a9 clean up t.isReferenced 2015-06-24 13:45:48 +01:00
Sebastian McKenzie
25b0683316 add Path#couldBeBaseType 2015-06-24 13:45:32 +01:00
Sebastian McKenzie
a096f6b1c5 fix noOptimise state being incorrect when recursing into multiple nested functions - fixes #1815 2015-06-24 13:45:14 +01:00
Sebastian McKenzie
e41ab2ab0c Merge pull request #1807 from benjamn/patch-1
Update Regenerator dependency to 0.8.31.
2015-06-23 17:07:25 +01:00
Ben Newman
6a6764fa7b Update Regenerator dependency to 0.8.31.
Fixes #1805.
2015-06-23 12:06:48 -04:00
Sebastian McKenzie
a2358d6863 5.6.4 2015-06-22 20:39:14 +01:00
Sebastian McKenzie
612ef79d35 v5.6.4 2015-06-22 20:38:12 +01:00
Sebastian McKenzie
2dfa6ddf36 add 5.6.4 changelog 2015-06-22 20:37:00 +01:00
Sebastian McKenzie
2910d4f82c fix Program can only be replaced with another Program error 2015-06-22 20:36:34 +01:00
Sebastian McKenzie
4b6c954f5e add ParenthesizedExpression node type for plugins to generate 2015-06-22 20:36:12 +01:00
Sebastian McKenzie
b7e23e3410 5.6.3 2015-06-22 11:57:53 +01:00
Sebastian McKenzie
a19f10e124 v5.6.3 2015-06-22 11:56:46 +01:00
Sebastian McKenzie
8e1f134635 fix rest parameter array allocation loop being incorrectly aliased - fixes #1800 2015-06-22 11:54:57 +01:00
Sebastian McKenzie
aa151016f5 5.6.2 2015-06-22 00:10:56 +01:00
Sebastian McKenzie
ce3c6289a2 v5.6.2 2015-06-22 00:08:52 +01:00
Sebastian McKenzie
0364519869 remove unused import 2015-06-22 00:06:43 +01:00
Sebastian McKenzie
58cda35831 log spread element rest parameter as a candidate instead of replacing it in place - fixes #1796 2015-06-22 00:06:03 +01:00
Sebastian McKenzie
ebaa06f4a2 add ensureBlock path method 2015-06-21 23:59:14 +01:00
Sebastian McKenzie
4b0f624fb3 turn method literal keys into assignments in loose mode - fixes #1797 2015-06-21 23:59:06 +01:00
Sebastian McKenzie
aa0f3ac5d0 5.6.1 2015-06-21 00:07:07 +01:00
Sebastian McKenzie
725906a7dc v5.6.1 2015-06-21 00:05:13 +01:00
Sebastian McKenzie
13d5c94b8b update transformation tests 2015-06-21 00:03:29 +01:00
Sebastian McKenzie
85308a1e8c fix super spread in loose mode 2015-06-21 00:01:19 +01:00
Sebastian McKenzie
83bcaba1a5 downgrade to babel 5.5.7 2015-06-21 00:01:11 +01:00
Sebastian McKenzie
185648cb2c 5.6.0 2015-06-20 23:44:46 +01:00
Sebastian McKenzie
be355fc1c6 fix build-runtime script 2015-06-20 23:37:46 +01:00
Sebastian McKenzie
7795e11d58 v5.6.0 2015-06-20 23:35:51 +01:00
Sebastian McKenzie
8f74e8068c fix generation tests to reflect acorn update 2015-06-20 23:35:02 +01:00
Sebastian McKenzie
5b5d27c9b8 resync with upstream acorn 2015-06-20 23:28:49 +01:00
Sebastian McKenzie
4f08a77230 resync with upstream acorn 2015-06-20 23:28:49 +01:00
Sebastian McKenzie
4ac33d62af move spec.functionName transformer to builtin-basic - fixes #1743 2015-06-20 22:51:20 +01:00
Sebastian McKenzie
2710a914e8 add noop transform method to IgnoreFormatter 2015-06-20 22:48:45 +01:00
Sebastian McKenzie
8934e7f9da Merge branch 'master' of github.com:babel/babel 2015-06-20 22:48:00 +01:00
Sebastian McKenzie
b4f18e05fa Merge pull request #1776 from zertosh/matches-pattern-this
matchPattern fixes and "this" handling
2015-06-20 22:47:52 +01:00
Sebastian McKenzie
c07540a2c4 extend module IgnoreFormatter from DefaultFormatter - fixes #1763, closes #1771 2015-06-20 22:47:32 +01:00
Sebastian McKenzie
c409f63bbe Merge pull request #1772 from arthurvr/booleanify-tests
Add tests for util.booleanify
2015-06-20 22:22:08 +01:00
Sebastian McKenzie
d3c30b669f update babel-plugin-runtime 2015-06-20 22:21:44 +01:00
Sebastian McKenzie
d10856d16c don't terminate CLI when watching files fail compilation on init - fixes #1678 2015-06-20 22:14:21 +01:00
Sebastian McKenzie
fb08a519c8 register labels as bindings - fixes #1747 2015-06-20 22:10:29 +01:00
Sebastian McKenzie
6a8ecf2507 add uniq to filenames in babel-cli - fixes #1731 2015-06-20 22:04:33 +01:00
Sebastian McKenzie
100317e0c8 split react displayName addition into a plugin - fixes #1761 2015-06-20 22:01:40 +01:00
Sebastian McKenzie
a32f744341 disable module import receiver when in loose mode - fixes #1788 2015-06-20 21:49:31 +01:00
Sebastian McKenzie
c4feff3cb7 add more whitespace 2015-06-20 21:49:01 +01:00
Sebastian McKenzie
498297ce6b check for invalid binding identifiers when generating inferred method names - fixes #1794 2015-06-20 21:48:42 +01:00
Sebastian McKenzie
2412c1d502 remove bluebird 2015-06-20 21:48:18 +01:00
Sebastian McKenzie
d92e1a4fb8 Merge pull request #1793 from lydell/patch-1
Update to js-tokens@1.0.1
2015-06-20 13:28:27 +01:00
Simon Lydell
1d0d050413 Update to js-tokens@1.0.1 2015-06-20 09:03:26 +02:00
Sebastian McKenzie
a607ac0077 Merge pull request #1786 from callumacrae/update-regenerator
Update regenerator
2015-06-18 17:57:43 +01:00
Callum Macrae
41f5e7c077 removed ^ from regenerator 2015-06-18 17:57:04 +01:00
Callum Macrae
99604362ed update regenerator 2015-06-18 17:52:16 +01:00
Sebastian McKenzie
2c8e374eaf add back non-es5 number guard in literal code gen 2015-06-17 22:56:08 +01:00
Sebastian McKenzie
238c68f829 fix member expression generation on object integers 2015-06-17 22:54:45 +01:00
Ingvar Stepanyan
09b334ad21 Add guard against non-ES5 integer literals. 2015-06-17 21:11:20 +03:00
Sebastian McKenzie
d647ede94b fix up raw number literal 2015-06-17 17:58:03 +01:00
Sebastian McKenzie
6386b60b9a add comments to types generator 2015-06-17 16:53:23 +01:00
Sebastian McKenzie
25749a9933 clear properties to undefined in traverse.removeProperties 2015-06-17 16:53:08 +01:00
Ingvar Stepanyan
fd4c0dae95 Generate original number representation when value was not changed. 2015-06-17 18:20:35 +03:00
Andres Suarez
80d362c534 fix matchesPattern with deep member expressions 2015-06-16 23:37:32 -04:00
Andres Suarez
59820b9a84 matchesPattern recognizes "this" 2015-06-16 22:48:50 -04:00
Sebastian McKenzie
f6ff366edf add getEarliestCommonAncestorFrom jsdoc description 2015-06-17 02:40:15 +01:00
Sebastian McKenzie
c7cac7aaba add deply nested smart insertion of rest parameter allocation 2015-06-17 02:34:42 +01:00
Sebastian McKenzie
0647d374a3 add more comments 2015-06-17 02:09:38 +01:00
Sebastian McKenzie
25c2816a85 fix ancestry index loopup in Path#getEarliestCommonAncestorFrom 2015-06-17 02:07:35 +01:00
Sebastian McKenzie
b57a80ecae optimise rest parameters in spread element position and allocate rest array at the earliest common ancestor of all references - fixes #1768 2015-06-17 01:57:14 +01:00
Sebastian McKenzie
574d47a571 finish removal of esquery 2015-06-17 01:56:01 +01:00
Sebastian McKenzie
7c5d2b19b7 remove esquery 2015-06-17 01:38:49 +01:00
Arthur Verschaeve
c7669f44c1 Add tests for util.booleanify 2015-06-16 20:18:33 +02:00
Sebastian McKenzie
0ed5c5f480 add check for JSXMemberExpression to t.isReferenced 2015-06-16 02:29:59 +01:00
Sebastian McKenzie
94c34e0132 throw error when attemping to replace a Program root node with another node not of type Program - closes #1762 2015-06-16 01:53:53 +01:00
Sebastian McKenzie
92c4bbd003 remove unused import 2015-06-16 00:43:41 +01:00
Sebastian McKenzie
ec8e840841 upgrade babel-plugin-undeclared-variables-check 2015-06-16 00:42:30 +01:00
Sebastian McKenzie
1c3c64c12c add modulesDuplicateDeclarations message 2015-06-16 00:42:21 +01:00
Sebastian McKenzie
cae80d6e9b add scope to addImport importSpecifier call 2015-06-16 00:42:13 +01:00
Sebastian McKenzie
aaf29ddd82 move validation.undeclaredVariableCheck up 2015-06-16 00:42:03 +01:00
Sebastian McKenzie
fb485567b9 support module live bindings in arbitary positions not in Program statement position - fixes #1760 2015-06-16 00:41:53 +01:00
Sebastian McKenzie
050bcec617 add messages property to plugin context and add --copy-files flag to babel-plugin build 2015-06-15 18:55:03 +01:00
Sebastian McKenzie
6231015557 fix spelling mistake in CONTRIBUTING 2015-06-15 18:54:23 +01:00
Sebastian McKenzie
822eb47ee7 move more transformers into plugins 2015-06-15 18:54:14 +01:00
Sebastian McKenzie
91161ae9a1 Merge pull request #1758 from pygy/master
Add tests for IIFEs as default exports.
2015-06-15 18:36:27 +01:00
Pierre-Yves Gerardy
4c1b4b6490 Add tests for IIFEs as default exports. 2015-06-15 19:28:17 +02:00
Sebastian McKenzie
e792256087 add parse and traverse to plugin babel context 2015-06-15 16:36:56 +01:00
Sebastian McKenzie
19ad22f6e8 update tests to reflect new plugin api 2015-06-15 16:36:45 +01:00
Sebastian McKenzie
01818a50fa fix up babel-plugin CLI 2015-06-15 16:36:34 +01:00
Sebastian McKenzie
3247851019 yank out more transformers and put them into plugins 2015-06-15 16:35:41 +01:00
Sebastian McKenzie
939c00d33c Merge branch 'master' of github.com:babel/babel 2015-06-15 15:18:35 +01:00
Sebastian McKenzie
8b096ac705 start movement of core into plugins 2015-06-15 15:17:04 +01:00
Sebastian McKenzie
30c4a0cf06 Merge pull request #1726 from tikotzky/fix-require-hook-under-istanbul
Fix require hook under istanbul
2015-06-15 11:09:41 +01:00
Sebastian McKenzie
e08d400b36 Merge pull request #1733 from hzoo/i-1732
remove empty strings from beginning of template - fixes #1732
2015-06-15 10:46:28 +01:00
Sebastian McKenzie
7e080aa9d2 Merge pull request #1753 from loganfsmyth/optimize-call
Optimize NodePath#call a bit
2015-06-15 10:46:10 +01:00
Sebastian McKenzie
c0e5059634 Merge pull request #1752 from loganfsmyth/hidden-class-change
Initialize properties to avoid hidden class thrashing.
2015-06-15 10:45:30 +01:00
Logan Smyth
f8f5684faa Avoid concatenating callbacks and ensure that callback lists are arrays ahead of time. 2015-06-14 23:00:38 -07:00
Logan Smyth
2c3e9fbc07 Initialize properties to avoid hidden class thrashing. 2015-06-14 22:26:44 -07:00
Sebastian McKenzie
b9d066d953 add special case for null in get helper 2015-06-15 00:15:22 +01:00
Sebastian McKenzie
94e15b0750 remove unused variable 2015-06-14 23:52:09 +01:00
Sebastian McKenzie
3256c1d120 Merge branch 'master' of github.com:babel/babel 2015-06-14 23:44:30 +01:00
Sebastian McKenzie
eba9f0ffbd clean up default constructor in derived classes - fixes #1748 2015-06-14 23:44:21 +01:00
Sebastian McKenzie
52c3c143f9 add BindingIdentifier virtual type 2015-06-14 20:21:02 +01:00
Brian Donovan
b0f797205b Merge pull request #1744 from silfverstrom/bugg/typo-in-messages
Fixed very minor typo in messages.js.
2015-06-14 07:57:25 -07:00
Niklas Silfverström
dd52c6a687 Fixed very minor typo in messages.js. 2015-06-14 08:06:55 +02:00
Mordy Tikotzky
3cf773b528 fix register hook when not registering for .js extension. 2015-06-14 00:31:14 -04:00
Henry Zhu
98424f80af template-literals: remove unnecessary strings, only add "" to beginning if second node isn't a string - fixes #1732 2015-06-13 14:34:33 -04:00
Sebastian McKenzie
708879ff1b fix auxiliary comment option in makefile 2015-06-13 19:01:50 +01:00
Sebastian McKenzie
70042bb0a8 update internal babel version to latest 2015-06-13 18:57:22 +01:00
Sebastian McKenzie
0f7711a202 5.5.8 2015-06-13 18:54:52 +01:00
Sebastian McKenzie
27f039488e v5.5.8 2015-06-13 18:53:41 +01:00
Sebastian McKenzie
e3ce82e12f remove console.log 2015-06-13 18:50:51 +01:00
Sebastian McKenzie
4934ea56a0 change NodePath#inType to use arguments instead of types 2015-06-13 18:50:19 +01:00
Sebastian McKenzie
ce03457b19 add getOpposite path method 2015-06-13 18:50:05 +01:00
Sebastian McKenzie
1298c67949 rename getOwnBindingInfo to getOwnBinding 2015-06-13 18:49:59 +01:00
Sebastian McKenzie
668274edcb remove resolve-rc file 2015-06-13 18:49:37 +01:00
Sebastian McKenzie
0694a7dd06 5.5.7 2015-06-13 02:23:28 +01:00
Sebastian McKenzie
20d19735fc v5.5.7 2015-06-13 02:22:20 +01:00
Sebastian McKenzie
b5b6bf4ad5 add isDirective method, 2015-06-13 02:21:22 +01:00
Sebastian McKenzie
844c10cac0 fix reference to inferers 2015-06-13 02:20:04 +01:00
Sebastian McKenzie
43583e4e9d pick only current constant violation if it's of the same scope 2015-06-13 02:19:57 +01:00
Sebastian McKenzie
f5b921cda9 better errorWithNode that's consolidated across paths and files 2015-06-13 02:19:44 +01:00
Sebastian McKenzie
763892aa79 remove unused variable 2015-06-13 02:19:30 +01:00
Sebastian McKenzie
3e6eae4d1a Merge branch 'master' of github.com:babel/babel 2015-06-13 02:00:22 +01:00
Sebastian McKenzie
7c090c8580 Merge pull request #1740 from zertosh/cli-fixes
Really fix "--help"
2015-06-13 01:56:58 +01:00
Andres Suarez
a5f6c1c389 Really fix "--help" 2015-06-12 20:54:53 -04:00
Sebastian McKenzie
c159f2d982 Merge branch 'master' of github.com:babel/babel 2015-06-13 01:54:33 +01:00
Sebastian McKenzie
9205f10244 Merge pull request #1719 from jmm/internals-docs2
Internals documentation
2015-06-13 01:53:04 +01:00
Sebastian McKenzie
4cd7bcad59 Merge pull request #1727 from zertosh/cli-fixes
Fix "--help" distinguish optional transforms
2015-06-13 01:52:46 +01:00
Andres Suarez
7e9660efd3 Fix "--help" distinguish optional transforms 2015-06-12 20:51:52 -04:00
Sebastian McKenzie
2d66ce5224 Merge pull request #1724 from arthurvr/bool
Update `util.booleanify()` return type
2015-06-13 01:48:30 +01:00
Sebastian McKenzie
1257b2cf40 Merge pull request #1736 from grncdr/patch-1
Remove duplicate keys from alias-keys.json
2015-06-12 20:33:54 +01:00
Stephen Sugden
f21d935de5 Add aliases from JSX* tags to Expression 2015-06-12 12:24:24 -07:00
Stephen Sugden
2e20364793 Remove duplicate keys from alias-keys.json
Fixes #1734
2015-06-12 20:58:41 +02:00
Sebastian McKenzie
e47e8a187a Merge branch 'master' of github.com:babel/babel 2015-06-11 19:06:41 +01:00
Ingvar Stepanyan
26924d5944 Fix dependency reference of Symbol.hasInstance 2015-06-10 22:07:40 +03:00
Arthur Verschaeve
5eb1850a55 Update util.booleanify() return type
Ref 62f37c1e62
2015-06-10 16:54:43 +02:00
Sebastian McKenzie
333e287226 remove special minification.removeConsole ExpressionStatement handling 2015-06-10 13:14:44 +01:00
Ingvar Stepanyan
deaf03dd28 Fixes & optimizations to es6.spec.arrowFunctions. 2015-06-10 12:28:10 +03:00
Sebastian McKenzie
80a77bd6a2 fix linting error 2015-06-10 03:16:07 +01:00
Sebastian McKenzie
c9286a1de1 rewrite option handling - fixes #1636 2015-06-10 03:07:06 +01:00
Sebastian McKenzie
52f614dcdf add better path execution status algo 2015-06-10 01:36:36 +01:00
Sebastian McKenzie
600367ae25 add t.COMPARISON_BINARY_OPERATORS 2015-06-10 01:34:51 +01:00
Sebastian McKenzie
b761cba135 split auxiliary comment option into before and after - fixes #1721 2015-06-10 01:34:44 +01:00
Sebastian McKenzie
947d3e262d push newline after decorator when doing code gen - fixes #1713 2015-06-10 01:19:58 +01:00
Sebastian McKenzie
4061bea528 change execution order of module metadata visitor to resolve module source before building up metadata tree - fixes #1720 2015-06-10 01:15:11 +01:00
Sebastian McKenzie
de195e5bfc Merge branch 'master' of github.com:babel/babel 2015-06-10 01:10:41 +01:00
Sebastian McKenzie
3bcef86973 Merge pull request #1720 from chadhietala/failing-metadata-test
Metadata object does not take in account resolveModuleSource()
2015-06-10 01:10:09 +01:00
Sebastian McKenzie
fa670ac71e visually split up inference inferer methods 2015-06-09 22:52:21 +01:00
Sebastian McKenzie
572261f9ce add support for typecasts in path static evaluation 2015-06-09 22:52:00 +01:00
Chad Hietala
8a320d53a5 Metadata object does not take in account resolveModuleSource()
This adds a failing test to illustrate the metadata object not reflecting what is returned from resolveModuleSource(). I might also not understand resolveModuleSource's purpose. However, this was the hook mentioned here https://github.com/babel/babel/issues/1602.
2015-06-09 14:26:33 -07:00
Jesse McCarthy
0650eedeb6 Add reference to doc dir to CONTRIBUTING. 2015-06-09 15:37:01 -04:00
Jesse McCarthy
2282d066a2 Start doc dir for internals documentation. 2015-06-09 15:37:01 -04:00
Ingvar Stepanyan
15ae0b669b Added spec arrow transformer.
Enforces:
* `new arrowFn(...)` is disallowed;
* `arrowFn.prototype` does not exist.
2015-06-09 18:18:44 +03:00
Sebastian McKenzie
f4d7cc55c1 split inference logic into separate folder 2015-06-09 14:02:57 +01:00
Sebastian McKenzie
eaaa279aa5 add let binding collision todo 2015-06-09 04:08:44 +01:00
Sebastian McKenzie
0595e06e29 5.5.6 2015-06-09 04:08:36 +01:00
Sebastian McKenzie
9b27a170ae v5.5.6 2015-06-09 04:07:15 +01:00
Sebastian McKenzie
1db232da9e add 5.5.6 changelog 2015-06-09 04:06:06 +01:00
Sebastian McKenzie
4cc844f410 take into consideration assignment expressions in loop heads when replacing let references - fixes #1707 2015-06-09 04:04:14 +01:00
Sebastian McKenzie
024ae670cb fix traceur test blacklist 2015-06-09 03:48:22 +01:00
Sebastian McKenzie
429edda9c0 ignore StringIterator traceur test 2015-06-09 03:40:08 +01:00
Sebastian McKenzie
05b13b9ea3 fix mistyped parameter name of t.createTypeAnnotationBasedOnTypeof 2015-06-09 03:26:40 +01:00
Sebastian McKenzie
b7320ce400 add t.createTypeAnnotationBasedOnTypeof method 2015-06-09 03:23:28 +01:00
Sebastian McKenzie
0c37b7b973 add typeof conditional inference 2015-06-09 03:20:32 +01:00
Sebastian McKenzie
bb36dbd8d9 update to latest traceur and enable now passing tests 2015-06-09 03:20:02 +01:00
Sebastian McKenzie
2dd8c40618 heavily simplify constants transformer 2015-06-09 00:31:18 +01:00
Sebastian McKenzie
33128b0ccf remove unused declaration 2015-06-08 23:59:53 +01:00
Sebastian McKenzie
cf25424295 fix duplicate declaration 2015-06-08 23:49:00 +01:00
Sebastian McKenzie
7492074794 infer types of bindings inside of conditionals based on usage 2015-06-08 23:43:46 +01:00
Sebastian McKenzie
8ba270bde1 disallow line terminator after async contextual keyword - fixes #1711 2015-06-08 21:25:16 +01:00
Sebastian McKenzie
c4a491123e disallow line terminator after async contextual keyword - fixes #1711 2015-06-08 21:25:16 +01:00
Sebastian McKenzie
55ad88fe4e don't override types parameter 2015-06-08 14:59:19 +01:00
Sebastian McKenzie
7170dbced8 Merge branch 'master' of github.com:babel/babel 2015-06-08 14:53:54 +01:00
Sebastian McKenzie
b0971412a2 add inference for null, remove any type parameter from inferred arrays, add todo comment 2015-06-08 14:52:35 +01:00
Sebastian McKenzie
a6b374a681 save union type in _getTypeAnnotationBindingConstantViolations to prevent infinite recursion 2015-06-08 14:52:13 +01:00
Sebastian McKenzie
2d0355b3b9 merge previous bindings constantViolations and path onto new bindings constantViolations 2015-06-08 14:49:09 +01:00
Sebastian McKenzie
7fade101be move down module TypeAlias check 2015-06-08 14:47:58 +01:00
Sebastian McKenzie
0918da8569 Merge pull request #1708 from hawkrives/patch-2
Update README.md for the Slack channel
2015-06-08 12:35:08 +01:00
Hawken Rives
917db622c4 Update README.md
Switch out the gitter link for slack.
2015-06-08 20:33:09 +09:00
Sebastian McKenzie
f7ee6fbd20 move travis notifications from gitter to slack 2015-06-08 12:20:38 +01:00
Sebastian McKenzie
5899e9a0be don't consider type aliases to be a default declaration - fixes #1705 2015-06-08 12:20:30 +01:00
Sebastian McKenzie
d41cb11545 fix registerDeclaration for FlowDeclarations 2015-06-08 01:46:05 +01:00
Sebastian McKenzie
3ad909a4ae add 5.5.5 changelog 2015-06-08 01:45:56 +01:00
Sebastian McKenzie
4bafdf733c 5.5.5 2015-06-08 01:29:54 +01:00
Sebastian McKenzie
b825998c63 v5.5.5 2015-06-08 01:27:46 +01:00
Sebastian McKenzie
6b02ca47c3 add missing semicolon 2015-06-08 01:27:02 +01:00
Sebastian McKenzie
ea1b85bffa fix bug where templates were getting polluted with old traversal paths 2015-06-08 01:25:51 +01:00
Sebastian McKenzie
3cffe47eea fix NodePath#isGenericType method name 2015-06-08 01:00:01 +01:00
Sebastian McKenzie
e5d5a9fb27 remove unused variable 2015-06-08 00:33:41 +01:00
Sebastian McKenzie
ca97fa63a9 Merge branch 'master' of github.com:babel/babel 2015-06-08 00:30:05 +01:00
Sebastian McKenzie
f4cc27bc0e remove unused variable 2015-06-08 00:29:52 +01:00
Sebastian McKenzie
8cea575e2e change NodePath#findParent to only call callback with path instead of node 2015-06-08 00:29:46 +01:00
Sebastian McKenzie
c91baee4d5 add support for flow declarations in scope tracking 2015-06-08 00:04:17 +01:00
Sebastian McKenzie
8055ce29f7 add support for flow declarations in scope tracking 2015-06-07 23:57:19 +01:00
Sebastian McKenzie
4596ae48b8 remove acorn jsx tests as the jsx parser is no longer embedded 2015-06-07 23:57:11 +01:00
Sebastian McKenzie
6c268cdf21 split out path comment methods into a separate file 2015-06-07 23:49:29 +01:00
Sebastian McKenzie
fce977f1d7 update TraversalContext#shouldVisit to check for existence of visitor keys 2015-06-07 23:38:39 +01:00
Sebastian McKenzie
a298075949 check for loc value on comments before attempting to adjust it 2015-06-07 23:37:47 +01:00
Sebastian McKenzie
66599c3779 use scope paths hub instead of manually passing the hub to the scope 2015-06-07 23:37:33 +01:00
Sebastian McKenzie
60340244b1 when constructing a NodePath, inherit parent paths hub if one wasn't passed to us 2015-06-07 23:36:32 +01:00
Sebastian McKenzie
eb72ea3e5a rename path verification methods to introspection and add NodePath#getSource method 2015-06-07 23:36:12 +01:00
Sebastian McKenzie
ede6237b6f add NodePath#addComment method 2015-06-07 23:35:46 +01:00
Sebastian McKenzie
e91e10aae6 add FlowStatement and FlowDeclaration alias keys 2015-06-07 23:35:35 +01:00
Sebastian McKenzie
9c3cca0d25 rename NodePath#isTypeAnnotationGeneric to isTypeAnnotation 2015-06-07 23:35:09 +01:00
Sebastian McKenzie
8eee5367f3 add Noop node 2015-06-07 23:34:35 +01:00
Sebastian McKenzie
40d55a3d44 update makefile browser build filename 2015-06-07 20:24:21 +01:00
Sebastian McKenzie
75330304dc fix linting errors 2015-06-07 20:04:30 +01:00
Sebastian McKenzie
776c508418 add node build to Makefile 2015-06-07 19:41:28 +01:00
Sebastian McKenzie
e804741632 add module metadata - closes #1601 2015-06-07 19:41:20 +01:00
Sebastian McKenzie
3d3cb4be4f completely rework type inferrence, support coercing to union types and be more reliable in the inferrence and always be cautious 2015-06-07 19:39:53 +01:00
Sebastian McKenzie
64f4209119 recurse into type casts when trying to get it's expression - fixes #facebook/react-native#1526 2015-06-07 02:45:06 +01:00
Sebastian McKenzie
2ede226ef9 remove unused variables 2015-06-06 16:35:28 +01:00
Sebastian McKenzie
f5cf641c0a add support for async generators to type inferrence 2015-06-06 16:17:55 +01:00
Sebastian McKenzie
1abd3419f6 simplify NodePath.getScope 2015-06-06 16:17:43 +01:00
Sebastian McKenzie
75699db716 clean up options normalisation and add more comments 2015-06-06 16:17:30 +01:00
Sebastian McKenzie
7c3572f08c fix linting errors 2015-06-06 03:38:12 +01:00
Sebastian McKenzie
9dacde6d07 further implement the concept of a "Hub" that all traversal paths get access to, also add in some assertions to confirm path state when performing manipulation 2015-06-06 03:34:08 +01:00
Sebastian McKenzie
8c3aab9a26 add support for async functions to type inferrence 2015-06-06 03:33:32 +01:00
Sebastian McKenzie
ba4550c953 switch some node-parent based stuff to path-based 2015-06-06 03:33:22 +01:00
Sebastian McKenzie
d0ac65a934 add _paths in t.inherits 2015-06-06 03:32:35 +01:00
Sebastian McKenzie
a4c70bb029 this commit makes the following changes to the way paths are handled:
- store paths on parents instead of containers
 - implement one central hub that all traversal paths and scopes get access to in order to abstract out access to common functions
2015-06-06 03:32:22 +01:00
Sebastian McKenzie
795cf0c0b1 add ignore/only tests to ensure #1693 never happens again 2015-06-05 23:11:10 +01:00
Sebastian McKenzie
e64b90e322 5.5.4 2015-06-05 23:07:27 +01:00
Sebastian McKenzie
d69b0973e1 v5.5.4 2015-06-05 23:03:55 +01:00
Sebastian McKenzie
6296f49653 update minification.constantFolding transformer to deopt bindings that are reassigned in a different function scope 2015-06-05 23:01:31 +01:00
Sebastian McKenzie
9f2b739046 improve Scope#dump to print binding info 2015-06-05 23:00:50 +01:00
Sebastian McKenzie
da1d5e5577 simplify unary resolution and move operators to types 2015-06-05 23:00:06 +01:00
Sebastian McKenzie
7333b4e392 move staticPropBody class concat to after className check in es6.classes transformer 2015-06-05 22:44:03 +01:00
Sebastian McKenzie
b0442d0784 add back shouldIgnore check that went missing around 32f19aff99 - closes #1696, fixes #1693 2015-06-05 22:43:32 +01:00
Sebastian McKenzie
295e69f8f8 fix auxiliaryComment option name for istanbul interop - fixes #1695 2015-06-05 22:40:28 +01:00
Sebastian McKenzie
cfe844fa39 add boolean type to experimental option 2015-06-05 22:36:16 +01:00
Sebastian McKenzie
0f4ea2d2a6 use file.log.deprecate instead of throwing an error - fixes #1694 2015-06-05 22:35:46 +01:00
Sebastian McKenzie
4b85b05839 use actual parameter reference for non-last default parameters - fixes #1690 2015-06-05 14:08:18 +01:00
Sebastian McKenzie
2539d08dce 5.5.3 2015-06-05 14:07:34 +01:00
Sebastian McKenzie
c26fd7a819 fix regenerator version 2015-06-05 14:07:27 +01:00
Sebastian McKenzie
2053610429 v5.5.3 2015-06-05 12:20:22 +01:00
Sebastian McKenzie
cd4f83b299 fix linting errors 2015-06-05 12:19:32 +01:00
Sebastian McKenzie
ec29ba19a9 add 5.5.3 changelog 2015-06-05 12:18:43 +01:00
Sebastian McKenzie
9dc03e0978 traverse over ClassProperty path rather than node 2015-06-05 12:17:55 +01:00
Sebastian McKenzie
bc4258eca9 add type inferrence for template literals 2015-06-05 12:17:45 +01:00
Sebastian McKenzie
b0e58f9770 add completion statement test and enable experimental option on deadCodeElimination tests 2015-06-05 12:17:36 +01:00
Sebastian McKenzie
a1e2641c91 5.5.2 2015-06-05 12:17:18 +01:00
Sebastian McKenzie
9108422f99 v5.5.2 2015-06-05 12:03:38 +01:00
Sebastian McKenzie
9e8f4b25ca add missing semicolon 2015-06-05 12:02:30 +01:00
Sebastian McKenzie
1cecd24823 make experimental warning more scary 2015-06-05 12:01:52 +01:00
Sebastian McKenzie
97f6e1469b add 5.5.2 changelog 2015-06-05 12:01:44 +01:00
Sebastian McKenzie
ec46eaf224 add scary experimental warning for people who use obscure transformers that are still WIP 2015-06-05 11:55:09 +01:00
Sebastian McKenzie
a102692103 when using babel/register always use the cwd - fixes #1689 2015-06-05 11:54:52 +01:00
Sebastian McKenzie
0376ec8ff0 t.isPure -> this.isPure - fixes #1688 2015-06-05 11:33:25 +01:00
Sebastian McKenzie
5932a07610 5.5.1 2015-06-05 09:57:21 +01:00
Sebastian McKenzie
6110b0c0b3 v5.5.1 2015-06-05 09:56:27 +01:00
Sebastian McKenzie
365e221d95 fix deoptValue binding boolean - fixes #1687 2015-06-05 09:55:47 +01:00
Sebastian McKenzie
acbc4859c0 only remove ClassProperty in flow transformer when it has no value 2015-06-05 09:53:59 +01:00
Sebastian McKenzie
55750e05e7 Revert "enable es6.spec.symbols by default"
This reverts commit f3acedbf08.
2015-06-05 09:44:22 +01:00
Sebastian McKenzie
ba9c4db673 finish 5.5.1 changelog - ref #1686 2015-06-05 09:43:34 +01:00
Sebastian McKenzie
ba8a63a69e remove trailing json comma 2015-06-05 09:42:53 +01:00
Sebastian McKenzie
25581981b5 always remove ClassProperty nodes in flow transformer - fixes #1686 2015-06-05 09:42:46 +01:00
Sebastian McKenzie
98b6effeef update template literal parsing to properly handle newlines 2015-06-05 09:36:37 +01:00
Sebastian McKenzie
02a6feed73 update template literal parsing to properly handle newlines 2015-06-05 09:36:37 +01:00
Sebastian McKenzie
f3acedbf08 enable es6.spec.symbols by default 2015-06-05 08:43:41 +01:00
Sebastian McKenzie
35ab4ffaab 5.5.0 2015-06-05 08:12:17 +01:00
Sebastian McKenzie
ddfb7f2c11 v5.5.0 2015-06-05 08:11:10 +01:00
Sebastian McKenzie
e2ca03f92d fix linting errors 2015-06-05 08:10:22 +01:00
Sebastian McKenzie
c75a3c68e5 add 5.5.0 changelog 2015-06-05 08:08:20 +01:00
Sebastian McKenzie
5d617ea99b upgrade regenerator - fixes #1685 2015-06-05 07:56:33 +01:00
Sebastian McKenzie
58059a2c48 add deoptValue method to Binding that ignores all subsequent setValue calls 2015-06-05 07:52:57 +01:00
Sebastian McKenzie
4c2936773a update type inferrence to support unary operators 2015-06-05 07:47:22 +01:00
Sebastian McKenzie
c7c16ad9c1 add control flow support and deopt bindings on assignments that we can't understand 2015-06-05 07:46:32 +01:00
Sebastian McKenzie
7b676d608b allow NodePaths to be returned in node removal/replacement methods and coerce them to nodes 2015-06-05 07:46:10 +01:00
Sebastian McKenzie
48ecec1e2e move more transformers to builtin-pre group 2015-06-05 07:45:32 +01:00
Sebastian McKenzie
9dc72e71d4 add skipKey method to skip traversal of subsequent keys 2015-06-05 07:45:19 +01:00
Sebastian McKenzie
4a7a02b9af rename builtin-setup transformer group to builtin-pre 2015-06-05 07:44:45 +01:00
Sebastian McKenzie
7cb460d2f3 add eval optional transformer 2015-06-05 07:44:29 +01:00
Sebastian McKenzie
0a7dac8744 move flow to builtin-trailing group 2015-06-05 07:44:15 +01:00
Sebastian McKenzie
667d595a73 use type inferrence to work out whether to wrap template literals with the String constructor 2015-06-05 07:43:58 +01:00
Sebastian McKenzie
2d2d957be5 add back ComprehensionBlock binding identifier keys and remove body form ComprehensionBlock visitor keys 2015-06-04 22:50:17 +01:00
Sebastian McKenzie
5aef7afade fix remaining AssignmentExpression LHS ReferencedIdentifier bugs 2015-06-04 22:43:50 +01:00
Sebastian McKenzie
d5e7b5616c Merge branch 'master' of github.com:babel/babel 2015-06-04 22:23:42 +01:00
Sebastian McKenzie
9aa17a6cc2 don't consider JSXIdentifier HTML tags to be references - fixes #1683 2015-06-04 22:23:24 +01:00
Sebastian McKenzie
0f13097f59 add basic naive constant folding of assignment expressions 2015-06-04 22:08:38 +01:00
Sebastian McKenzie
355ffbdaf8 don't consider the LHS of an AssignmentExpression to be a reference 2015-06-04 22:07:44 +01:00
Sebastian McKenzie
45b0d63d72 copy parent class binding to class in the collection visitor 2015-06-04 22:07:19 +01:00
Sebastian McKenzie
c515271fbd Merge pull request #1677 from jmm/node_modules-robust3
Complete "Fix flawed require hook node_modules check" properly
2015-06-03 19:23:41 +01:00
Jesse McCarthy
6f3501876a Add test for require-hook node_modules check. 2015-06-03 09:04:59 -04:00
Jesse McCarthy
f8afc5fa17 Revert "Add test for require-hook node_modules check."
This reverts commit 1488d88c81.

Wrong branch was accidentally merged. There is a better test.
2015-06-03 09:04:59 -04:00
Sebastian McKenzie
4ecda93147 move deprecated minification.inlineExpressions to aliases 2015-06-03 10:05:56 +01:00
Sebastian McKenzie
f268049fdc check if es7.exportExtensions ie enabled in parser 2015-06-03 10:05:39 +01:00
Sebastian McKenzie
41847162b1 check if es7.exportExtensions ie enabled in parser 2015-06-03 10:05:39 +01:00
Sebastian McKenzie
0f7e010e3e remove isSpecifierDefault check for ExportDefaultSpecifier - fixes #1673 2015-06-03 10:05:19 +01:00
Sebastian McKenzie
8201ea0aa2 Merge branch 'master' of github.com:babel/babel
# Conflicts:
#	src/babel/api/register/node.js
2015-06-03 07:26:46 +01:00
Sebastian McKenzie
a7848c1822 Merge branch 'jmm-node_modules-robust' 2015-06-03 07:26:19 +01:00
Sebastian McKenzie
d4abaeeecf Merge branch 'node_modules-robust' of https://github.com/jmm/babel into jmm-node_modules-robust 2015-06-03 07:26:12 +01:00
Sebastian McKenzie
871a82df0a Merge pull request #1665 from Jabher/master
Making babel able to run in node_modules directory
2015-06-03 07:25:22 +01:00
Sebastian McKenzie
ffbf5b0b47 convert property key to computed before checking if it's a displayName property in the react transformer builder - closes #1671 2015-06-02 23:08:46 +01:00
Sebastian McKenzie
9dcceaeb40 move minification.deadCodeElimination back to the builtin-setup transformer group 2015-06-02 17:08:49 +01:00
Sebastian McKenzie
556e58a4ab register function declarations anyway as we may not have hit them 2015-06-02 17:08:31 +01:00
Sebastian McKenzie
b6c35743e6 add import types 2015-06-02 16:24:32 +01:00
Sebastian McKenzie
0abd34f7e6 Merge branch 'master' of github.com:babel/babel 2015-06-02 16:18:13 +01:00
Sebastian McKenzie
cafd7f8e39 add Infinity/NaN, string/number member expressions/calls and Math calls static evaluation 2015-06-02 16:18:08 +01:00
Sebastian McKenzie
43c0a0e65f remove all non-function statements after completion statements in blocks 2015-06-02 16:16:36 +01:00
Sebastian McKenzie
7b359f46fd rename minification.inlineExpressions to minification.constantFolding 2015-06-02 16:16:10 +01:00
Sebastian McKenzie
880827f6ce Merge pull request #1669 from wincent/mixed-type
Add "mixed" Flow type
2015-06-02 16:15:23 +01:00
Greg Hurrell
6f912edaab Add "mixed" Flow type
"mixed" is one of the base types listed here:

http://flowtype.org/docs/base-types.html

So this commit adds support for it.
2015-06-02 07:15:06 -07:00
Greg Hurrell
0c300058a3 Add "mixed" Flow type
"mixed" is one of the base types listed here:

http://flowtype.org/docs/base-types.html

So this commit adds support for it.
2015-06-02 07:15:06 -07:00
Sebastian McKenzie
d35be22f7d add support for resolving array expression elements 2015-06-02 00:32:18 +01:00
Sebastian McKenzie
ff8d90061f add "istanbul ignore next" auxiliary comment when using istanbul compat mode for babel/register 2015-06-02 00:32:07 +01:00
Vsevolod Rodionov
e66109f9d0 Making babel able to run in node_modules directory (while still ignoring node_modules packages)
In case if app is installed by npm install <git tarball url> which is very comfortable thing (postinstall hooks, automatic package installation and so on) babel is unable to run over packages, e.g.
```
 ~/node_modules/some_app$ node-babel app.js
  ```
 is crashing as babel do not want in node_modules directory.

 relative path gives ability to check whether lib is in node_modules _relative_ to current app, so that if app is ran in node_modules by itself it will not be captured.
2015-06-01 14:55:51 -07:00
Sebastian McKenzie
1934c16f0f don't use initializer property for decorators on concise methods in object literals 2015-06-01 22:32:04 +01:00
Sebastian McKenzie
012ac7d9ec remove accidental console.log introduced in 80a7f13460 2015-06-01 22:01:27 +01:00
Jesse McCarthy
efb3b04225 Make node_modules path check robust. 2015-06-01 16:54:56 -04:00
Jesse McCarthy
1488d88c81 Add test for require-hook node_modules check.
(Failing.)
2015-06-01 16:54:52 -04:00
Sebastian McKenzie
80a7f13460 register named method id as a reference to avoid collisions - fixes #1664 2015-06-01 21:53:34 +01:00
Sebastian McKenzie
8919fc22b1 only infer single identifier new expression callees 2015-06-01 21:52:54 +01:00
Sebastian McKenzie
b1273cb774 Merge pull request #1663 from pangratz/fix_for_referencesImport
Minor fix for `referencesImport`
2015-06-01 18:13:49 +01:00
pangratz
0843b8355e Minor fix for referencesImport 2015-06-01 19:09:33 +02:00
Sebastian McKenzie
6457677fb4 add support for NewExpression and reference plain node 2015-06-01 17:29:02 +01:00
Sebastian McKenzie
f8a860bf21 remove unused import 2015-06-01 14:32:58 +01:00
Sebastian McKenzie
f2bed33db8 add type inference for ConditionalExpression, SequenceExpression, AssignmentExpression and add support for base type aliases in isTypeAnnotationGeneric method 2015-06-01 14:25:06 +01:00
Sebastian McKenzie
7d2c6525d8 flesh out type inferrence some more, rename some of the NodePath methods to be less ambiguous, remove dead Binding type methods 2015-06-01 14:01:14 +01:00
Sebastian McKenzie
de652dc747 change getBindingIdentifier keys to be just a string instead of an array 2015-06-01 12:06:36 +01:00
Sebastian McKenzie
9f1053212b add EmptyStatement to t.toSequenceExpression 2015-06-01 12:06:16 +01:00
Sebastian McKenzie
76690a3deb renamed Path#isPreviousType to isType 2015-06-01 12:05:42 +01:00
Sebastian McKenzie
f6e7cf4a31 remove DoExpression statement parsing and clear labels and set inFunction to false when parsing DoExpression body - fixes #1658 2015-06-01 03:36:14 +01:00
Sebastian McKenzie
50f2f2fc98 remove DoExpression statement parsing and clear labels and set inFunction to false when parsing DoExpression body - fixes #1658 2015-06-01 03:36:14 +01:00
Sebastian McKenzie
5c27234d19 change TCO BlockStatement visitor back to enter 2015-06-01 00:17:44 +01:00
Sebastian McKenzie
6f5d16f397 remove TCOable check 2015-06-01 00:14:12 +01:00
Sebastian McKenzie
e42a43e3d1 remove unnecessary strict helper 2015-05-31 23:40:59 +01:00
Sebastian McKenzie
bfd307cd57 move some visitors out of deoptimising enter method 2015-05-31 23:40:42 +01:00
Sebastian McKenzie
beb5ee1333 remove useless generator test helpers 2015-05-31 21:26:22 +01:00
Sebastian McKenzie
cde871555d don't pass comments in tokens to estraverse 2015-05-31 21:26:12 +01:00
Sebastian McKenzie
51b0ffa7bf prepend Comment to comment node types 2015-05-31 20:25:26 +01:00
Sebastian McKenzie
255c819727 optimise ES6 tail call transformer to only try TOC on functions that include a call to themselves 2015-05-31 15:40:41 +01:00
Sebastian McKenzie
152ccb2ce8 check if ObjectExpression has any gets/sets before filtering 2015-05-31 15:40:07 +01:00
Sebastian McKenzie
bdb3adfeea revert parts of 07a992e 2015-05-31 09:47:27 +01:00
Sebastian McKenzie
236086bee5 ignore trailing commas when inferring newlines - fixes #1304 2015-05-31 09:46:05 +01:00
Sebastian McKenzie
1436753e6d fix linting errors 2015-05-31 09:24:12 +01:00
Sebastian McKenzie
eadf8ef799 fix syntax error in helpers/parse 2015-05-31 09:20:16 +01:00
Sebastian McKenzie
f1e20cf6ff remove useless comment 2015-05-31 09:16:34 +01:00
Sebastian McKenzie
82a0851526 push comments to token stream to avoid having to re-sort - #1486 2015-05-31 09:16:27 +01:00
Sebastian McKenzie
07a992e6d3 add support for tail calls when in completion record position - fixes #1572 2015-05-31 09:07:44 +01:00
Sebastian McKenzie
f642c2baa8 relax key aliases for plain methods - fixes #1649 2015-05-30 23:53:39 -04:00
Sebastian McKenzie
2f7743cafb optimise module metadata retrieval - #1486 2015-05-30 23:42:24 -04:00
Sebastian McKenzie
44112f2d87 remove unused variable 2015-05-30 23:18:50 -04:00
Sebastian McKenzie
99c4810770 add regeneratot transform to builtin-advanced group 2015-05-30 23:18:45 -04:00
Sebastian McKenzie
9f2ac15695 move jscript transformer to the builtin-trailing group and perform transform on exit - closes #1652, fixes #1651 2015-05-30 23:09:25 -04:00
Sebastian McKenzie
19c1ee157f simplify scope parent alias keys 2015-05-30 23:08:42 -04:00
Sebastian McKenzie
973270772b use ForX alias instead of manually listing all types 2015-05-30 23:08:28 -04:00
Sebastian McKenzie
7334326042 remove extra semicolon 2015-05-30 22:37:18 -04:00
Sebastian McKenzie
4043e8e8b9 fix destructuring transformer AssignmentExpression to properly handle completion records 2015-05-30 22:33:09 -04:00
Sebastian McKenzie
7fd403998c remove dead code 2015-05-30 22:32:48 -04:00
Sebastian McKenzie
1f7fcc2985 Merge branch 'master' of github.com:babel/babel 2015-05-30 22:13:59 -04:00
Sebastian McKenzie
ba19bd36a4 optimise scope tracking into a single pass - #1486 2015-05-30 22:07:03 -04:00
Sebastian McKenzie
e119681b1f return paths accordingly in insertBefore and insertAfter methods 2015-05-30 22:03:25 -04:00
Sebastian McKenzie
fbe22e53a9 add check for dynamic node and output error message accordingly 2015-05-30 22:02:56 -04:00
Sebastian McKenzie
79e826fcc8 attempt to optimise node printing by shifting it into a class 2015-05-30 22:02:29 -04:00
Sebastian McKenzie
cf940268b9 add noScope to template visitor 2015-05-30 22:02:15 -04:00
Sebastian McKenzie
96bb572307 use flow type shorthand for eaching over specifiers 2015-05-30 19:09:23 -04:00
Sebastian McKenzie
5dafe0b66a collapse t.getBindingIdentifiers comment 2015-05-30 19:08:14 -04:00
Sebastian McKenzie
29e24a4cbe don't evaluate non-referenced identifiers 2015-05-30 19:07:58 -04:00
Sebastian McKenzie
f979d55b71 remove special ExpressionStatement handling in destructuring transformer 2015-05-30 19:07:31 -04:00
Sebastian McKenzie
164b2116a3 switch expontentation evaluation to just use the operator 2015-05-30 19:05:31 -04:00
Dan Abramov
55e623a099 Merge pull request #1650 from jmm/contrib-build-version
Make note about buildable versions more prominent.
2015-05-30 11:29:59 +03:00
Jesse McCarthy
a60b4b1302 Make note about buildable versions more prominent. 2015-05-29 14:14:15 -04:00
Dan Abramov
bf23e59bbf Add a note about building older versions. Fixes #1643 2015-05-29 16:50:34 +03:00
Sebastian McKenzie
eb4cee89c5 add referencesImport path method - fixes #1423 2015-05-28 11:39:51 -04:00
Sebastian McKenzie
fb94a87a4d add support for cluster forking - fixes #1611 2015-05-28 10:36:29 -04:00
Sebastian McKenzie
9613c7fdb6 fix linting error 2015-05-28 10:30:09 -04:00
Sebastian McKenzie
d8c97fba15 check plugin.default and then just plugin to support ES6 modules - closes #1627 2015-05-28 10:25:50 -04:00
Sebastian McKenzie
0f663560d4 add --nolazy to babel-node - fixes #1639 2015-05-28 10:24:31 -04:00
Sebastian McKenzie
4901075960 deopt rest parameter member expression optimisation on child arrow functions - fixes #1631 2015-05-28 10:22:12 -04:00
Sebastian McKenzie
4aec242979 add some comments to some path methods and remove some dead code 2015-05-28 10:04:46 -04:00
Sebastian McKenzie
d1d95e0e49 check LHS of ForIn/ForOfStatement for constants - closes #1630 2015-05-28 10:04:32 -04:00
Sebastian McKenzie
d3c643b004 clean up path resolution and add in path resolution recursion detection - cc @RReverser 2015-05-25 19:08:08 +01:00
Sebastian McKenzie
98eb30c482 rename Path#remove to Path#dangerouslyRemove 2015-05-25 16:17:28 +01:00
Sebastian McKenzie
2d43ffb5b4 remove removal scope hooks 2015-05-25 15:57:22 +01:00
Sebastian McKenzie
a195701de2 remove dead code 2015-05-25 15:28:23 +01:00
Sebastian McKenzie
f639f4bea7 upgrade babel-eslint 2015-05-25 15:28:16 +01:00
Sebastian McKenzie
334cbb06c6 flesh out removal hooks more 2015-05-25 15:28:11 +01:00
Sebastian McKenzie
f4a3b2f01a add link to readme in contributing guide so people can't whinge and note in the README that issues without reproducible examples will be closed 2015-05-25 14:55:37 +01:00
Sebastian McKenzie
dbe6f1b9a9 merge remove parent context checks 2015-05-25 04:30:17 +01:00
Sebastian McKenzie
73ada57a17 don't inline classes and functions when they're in different scopes in the utility.deadCodeElimination transformer 2015-05-25 03:33:12 +01:00
Sebastian McKenzie
8e2b743f7e add support for resyncing container on changes 2015-05-25 03:32:25 +01:00
Sebastian McKenzie
a533042503 fix bad .gitignore paths resulting in some tests and path/lib files not being included... 2015-05-25 01:42:54 +01:00
Sebastian McKenzie
49953e3464 enable no-unused-vars in eslint 2015-05-25 01:32:06 +01:00
Sebastian McKenzie
0bf95d6aea even more split up of path methods 2015-05-25 01:01:21 +01:00
Sebastian McKenzie
7d88a1ca0b rename TraversalPath to NodePath and further split up methods into separate files 2015-05-25 00:43:46 +01:00
Sebastian McKenzie
ec74eb41cf reneable eslint and fix assorted linting errors 2015-05-25 00:42:59 +01:00
Sebastian McKenzie
3139482358 clean and fix up visitor merging 2015-05-24 18:15:46 +01:00
Sebastian McKenzie
32f19aff99 clean up file processing API 2015-05-24 18:15:34 +01:00
Sebastian McKenzie
23bead9226 Merge branch 'master' of github.com:babel/babel 2015-05-24 01:45:00 +01:00
Sebastian McKenzie
bd3812c255 handle SwitchStatements as a different type of path when pushing a declaration - fixes #1614 2015-05-24 01:43:04 +01:00
Sebastian McKenzie
e498185a76 Merge pull request #1610 from dekelcohen/master
Fixed Remove Debugger transformer to use DebuggerStatement
2015-05-22 23:36:47 +01:00
Dekel Cohen
167eda4750 Fixed Remove Debugger transformer to use DebuggerStatement 2015-05-23 01:13:23 +03:00
Sebastian McKenzie
3b52ddce6d 5.4.7 2015-05-21 19:00:16 +01:00
Sebastian McKenzie
0e771c5d38 v5.4.7 2015-05-21 18:59:30 +01:00
Sebastian McKenzie
2ec1544f2d add 5.4.7 changelog 2015-05-21 18:58:49 +01:00
Sebastian McKenzie
049ef430b2 5.4.6 2015-05-21 18:58:12 +01:00
Sebastian McKenzie
34eb2babdb don't consider JSXAttribute keys to be referenced identifiers - fixes #1596 2015-05-21 18:58:07 +01:00
Sebastian McKenzie
8706754550 v5.4.6 2015-05-21 18:46:22 +01:00
Sebastian McKenzie
c7b507e119 add 5.4.6 changelog 2015-05-21 18:45:31 +01:00
Sebastian McKenzie
221c632c05 deprecate custom module formatters 2015-05-21 18:44:02 +01:00
Sebastian McKenzie
7dbde208ef spec.functionName transformer: hasBinding(name) returns true for built-in globals, so we attempt to rename the binding but it doesn't exist so exits early, add a check that doesn't perform the renaming and instead uses the wrapper - fixes #1598 2015-05-21 18:43:55 +01:00
Sebastian McKenzie
52a2e3e17c return original input if glob returned nothing in babel-cli - fixes #1591 2015-05-21 10:57:37 +01:00
Sebastian McKenzie
fa22d7dca0 5.4.5 2015-05-21 01:52:03 +01:00
Sebastian McKenzie
9fcdebde08 v5.4.5 2015-05-21 01:44:29 +01:00
Sebastian McKenzie
92157161f0 fix prettyCall generation option 2015-05-21 01:43:02 +01:00
Sebastian McKenzie
82b5479436 add 5.4.5 changelog 2015-05-21 01:41:30 +01:00
Sebastian McKenzie
91a037af55 Merge pull request #1590 from Khan/fix_retainLines_with_jsx
tests for retainLines formatting
2015-05-21 01:39:33 +01:00
Kevin Barabash
067fccc2c9 tests for retainLines formatting 2015-05-20 18:36:47 -06:00
Sebastian McKenzie
348c0d2542 handle TCO for calls that exceed the functions parameter count - fixes #1589 2015-05-21 01:21:49 +01:00
Sebastian McKenzie
f2f6bbb02c clean up explosion of module declarations, remove and inherit comments when taking off the declaration - fixes #1583 2015-05-21 01:03:23 +01:00
Sebastian McKenzie
16f7b967b5 ignore CallExpression _prettyCall when retainLines is enabled - fixes #1585 2015-05-21 00:21:18 +01:00
Sebastian McKenzie
270a8be68d add JSXIdentifier as a valid ReferencedIdentifier - fixes #1584 2015-05-21 00:20:53 +01:00
Sebastian McKenzie
82254d9d9b force push space for await/async - fixes #1581 2015-05-20 12:45:04 +01:00
Sebastian McKenzie
759a265fb0 5.4.4 2015-05-20 10:52:28 +01:00
Sebastian McKenzie
ee46f45c90 v5.4.4 2015-05-20 10:50:35 +01:00
Sebastian McKenzie
c45ce61550 print assignment pattern shorthand with matching key nicely 2015-05-20 10:44:36 +01:00
Sebastian McKenzie
b36cf11ac8 add 5.4.4 changelog 2015-05-20 10:44:17 +01:00
Sebastian McKenzie
dca0f72e4d clarify default option descriptions - fixes #1577 2015-05-20 10:36:58 +01:00
Sebastian McKenzie
68a99ed1e9 fix es6.modules-system for head hoisting 2015-05-20 10:35:01 +01:00
Sebastian McKenzie
af4feb4d88 fix renaming of assignment expressions to fix pattern renaming in the es6.blockScoping transformer - fixes #1576 2015-05-20 10:34:50 +01:00
Sebastian McKenzie
de1e965fec fix placement of for loop in es6.modules-system hoisting test 2015-05-20 10:15:42 +01:00
Sebastian McKenzie
430c5df0e7 rename sourceMapName option to sourceMapTarget - closes #1568 2015-05-20 10:14:28 +01:00
Sebastian McKenzie
9b12f799f7 clean up system module formatter hoisting visitor and allow contextual replacement of variable declarations with expressions in for head positions - fixes #1570 2015-05-20 10:07:29 +01:00
Sebastian McKenzie
f3a9c6ee5d Merge pull request #1562 from clintwood/sourcemap-file
correct cli source map file: value, honor sourceRoot when using -o opion
2015-05-20 09:57:34 +01:00
Sebastian McKenzie
e0aceeafef Merge pull request #1570 from guybedford/system-hoist-bug
System format hoisting bug
2015-05-20 09:57:14 +01:00
Sebastian McKenzie
7643d86047 Merge branch 'master' of github.com:babel/babel 2015-05-20 09:57:03 +01:00
Sebastian McKenzie
98af01a73c update old 6to5 package.json description 2015-05-20 09:56:54 +01:00
Sebastian McKenzie
e280a810c3 add support for all completion record types when exploding an expression to statements 2015-05-20 09:56:45 +01:00
Sebastian McKenzie
7a59575d1e force space before class id when generating classes - fixes #1579 2015-05-20 09:56:19 +01:00
Sebastian McKenzie
b01d8448a0 Merge pull request #1558 from jquense/patch-2
Resolve "babel-plugin-" name before trying the plain name.
2015-05-19 01:28:02 +01:00
jquense
9b3c8569f7 Resolve 'babel-plugin-' name before the plain name
Otherwise you get situations like the following: `plugins: [
'object-assign']` resolves the module `object-assign` (an Object.assign
polyfill) instead of the intended babel plugin:
babel-plugin-object-assign.
2015-05-18 20:26:51 -04:00
Sebastian McKenzie
12104f822f add assignment pattern shorthand support to explode transformer - fixes #1566 2015-05-18 22:44:40 +01:00
Sebastian McKenzie
b4cd2df745 ignore this and arguments when performing TCO on shadowed functions - fixes #1564 2015-05-18 22:41:27 +01:00
guybedford
887ffed84c system hoist bug test case 2015-05-18 23:35:09 +02:00
Sebastian McKenzie
9be3d9c8e1 Merge branch 'master' of github.com:babel/babel 2015-05-18 10:33:12 +01:00
clintwood (Office)
9d3dff3b7a correct cli source map file: value, honor sourceRoot when using -o option 2015-05-18 10:11:20 +02:00
Sebastian McKenzie
55114ec631 update AMD module formatter to add import default remapping - #1150 2015-05-18 02:01:34 +01:00
Sebastian McKenzie
9c3d00d3c3 Merge pull request #1559 from sindresorhus/hometmp
use `home-or-tmp` module instead of `user-home`
2015-05-17 23:50:26 +01:00
Sindre Sorhus
90b8826e73 use home-or-tmp module instead of user-home
The main point about using this instead of just falling back in code is that it depends on an `os.tmpdir()` polyfill [0], which means the tmpdir handling is the same no matter node/iojs version. This is useful as the core `os.tmpdir()` function has changed a lot between node versions.

[0]: https://github.com/sindresorhus/os-tmpdir

---

`os.tmpdir()` diff between Node 0.10.38 and iojs 2.0.2

```diff
+const trailingSlashRe = isWindows ? /[^:]\\$/
+                                  : /.\/$/;
+
 exports.tmpdir = function() {
-  return process.env.TMPDIR ||
-         process.env.TMP ||
-         process.env.TEMP ||
-         (process.platform === 'win32' ? 'c:\\windows\\temp' : '/tmp');
+  var path;
+  if (isWindows) {
+    path = process.env.TEMP ||
+           process.env.TMP ||
+           (process.env.SystemRoot || process.env.windir) + '\\temp';
+  } else {
+    path = process.env.TMPDIR ||
+           process.env.TMP ||
+           process.env.TEMP ||
+           '/tmp';
+  }
+  if (trailingSlashRe.test(path))
+    path = path.slice(0, -1);
+  return path;
 };
```
2015-05-18 00:39:49 +02:00
Sebastian McKenzie
65f39bbf6f switch order of jsx/flow plugins to avoid precedence issues - fixes babel/babel-eslint#103 2015-05-17 22:00:38 +01:00
Sebastian McKenzie
e9eced846f 5.4.3 2015-05-16 02:00:20 +01:00
Sebastian McKenzie
a0befe349d v5.4.3 2015-05-16 01:58:52 +01:00
Sebastian McKenzie
04992effb3 improve lost node path tracking message 2015-05-16 01:54:35 +01:00
Sebastian McKenzie
9ae54d2a50 add 5.4.3 changelog 2015-05-16 01:54:25 +01:00
Sebastian McKenzie
fe72a40159 Revert "add back descriptor.initializer existence check"
This reverts commit 02dfd18023.
2015-05-16 01:50:31 +01:00
Sebastian McKenzie
ea510d09d0 fix module shadowing when using CommonJS-like module formatters - fixes #1544 2015-05-16 01:47:48 +01:00
Sebastian McKenzie
375689a1ff handle path contexts MUCH better, they're now only held during the traversal iteration and the previous context is released upon completion, also verify path keys and try and obtain a new one if invalid - fixes #1545 2015-05-16 01:37:55 +01:00
Sebastian McKenzie
9908e331b7 Merge pull request #1549 from Naddiseo/master
Added DCE tests for all the bugs I've reported so far.
2015-05-15 23:08:32 +01:00
Richard Eames
cd8655708d Added DCE tests for all the bugs I've reported so far. 2015-05-15 15:55:58 -06:00
Sebastian McKenzie
62b94f297a don't create a new binding for local class ids, just copy the parents - fixes #1547 2015-05-15 19:11:24 +01:00
Sebastian McKenzie
01d399ee3c check for existence of variable when checking if node is pure 2015-05-15 18:48:17 +01:00
Sebastian McKenzie
30e3908484 don't perform DCE on single references nested inside the binding initializer - fixes #1546 2015-05-15 18:48:05 +01:00
Sebastian McKenzie
ff12046009 move traverse replace test up 2015-05-15 18:35:15 +01:00
Sebastian McKenzie
1a058b4a6e Merge branch 'master' of github.com:babel/babel 2015-05-15 17:42:40 +01:00
Sebastian McKenzie
02dfd18023 add back descriptor.initializer existence check 2015-05-15 17:42:28 +01:00
Sebastian McKenzie
9ab7df5f47 remove wildcards from start of patterns 2015-05-15 17:42:10 +01:00
Sebastian McKenzie
7a5b140f92 minor generation style nits 2015-05-15 17:41:56 +01:00
Sebastian McKenzie
6f83111c55 Merge pull request #1542 from amasad/already-printed
Fix bug with paren printing in compact + line retained mode
2015-05-15 17:38:40 +01:00
Sebastian McKenzie
f3f60368da remove TraversalPath node getter/setter 2015-05-15 17:34:31 +01:00
Sebastian McKenzie
7a09640b20 add environment to register cache key 2015-05-15 17:34:06 +01:00
Amjad Masad
2916d1262b Don't print leftParen if already printed before the catchup 2015-05-14 23:57:35 -07:00
Amjad Masad
741abb73d2 Add failing test for printing with compact & retainLines 2015-05-14 23:57:05 -07:00
Sebastian McKenzie
2e46755260 5.4.2 2015-05-15 02:36:22 +01:00
Sebastian McKenzie
2cff9519e1 v5.4.2 2015-05-15 02:35:07 +01:00
Sebastian McKenzie
f9c2c6e988 Merge branch 'master' of github.com:babel/babel
# Conflicts:
#	CHANGELOG.md
2015-05-15 02:34:11 +01:00
Sebastian McKenzie
5ae3dc01f1 make path patterns used by only and ignore **very** liberal, this will ease a lot of pain in dealing with them 2015-05-15 02:33:40 +01:00
Sebastian McKenzie
af4fd69dd0 make path patterns used by only and ignore **very** liberal, this will ease a lot of pain in dealing with them 2015-05-15 02:33:22 +01:00
Sebastian McKenzie
4d4493f325 elaborate on shouldIgnore changes in 5.4.1 2015-05-15 02:03:02 +01:00
Sebastian McKenzie
e70d474b39 5.4.1 2015-05-15 02:01:42 +01:00
Sebastian McKenzie
1b45f64858 v5.4.1 2015-05-15 02:00:18 +01:00
Sebastian McKenzie
b89cf6768f fix shouldIgnore only matches switch 2015-05-15 01:57:10 +01:00
Sebastian McKenzie
36ad1108b4 fix loose mode loop being weirdly inserted 2015-05-15 01:56:34 +01:00
Sebastian McKenzie
4c04371ea4 remove loop label due to babel bug 2015-05-15 01:48:47 +01:00
Sebastian McKenzie
d3e385c554 one last try fixing the shouldIgnore only filter... 2015-05-15 01:46:36 +01:00
Sebastian McKenzie
6afcef9805 actually fix shouldIgnore algorithm this time, ugh 2015-05-15 01:44:57 +01:00
Sebastian McKenzie
ed861e230b fix shouldIgnore method for only 2015-05-15 01:41:49 +01:00
Sebastian McKenzie
e15ced2922 add 5.4.1 changelog 2015-05-15 01:37:48 +01:00
Sebastian McKenzie
93052e532f Merge branch 'master' of github.com:babel/babel 2015-05-15 01:35:43 +01:00
Sebastian McKenzie
198d51ddaa heavily improve shouldIgnore algorithm - fixes #1539 2015-05-15 01:34:58 +01:00
Sebastian McKenzie
8730b24def Merge pull request #1540 from browncolyn/master
Added slash as needed dependency
2015-05-15 01:30:50 +01:00
Colyn Brown
f09c0d5998 Added slash as needed dependency 2015-05-14 17:28:20 -07:00
Sebastian McKenzie
21e4481ab7 5.4.0 2015-05-15 00:32:36 +01:00
Sebastian McKenzie
2f61754a24 v5.4.0 2015-05-15 00:29:42 +01:00
Sebastian McKenzie
3910d18bc9 add 5.4.0 changelog 2015-05-15 00:28:47 +01:00
Sebastian McKenzie
583111ebfb expose file metadata object to transformers 2015-05-15 00:24:14 +01:00
Sebastian McKenzie
1b15481460 ignore "ignored files" when babel.transform has determined that it should be ignored, this is likely the result of an rc file resolution - fixes #1362 2015-05-15 00:24:03 +01:00
Sebastian McKenzie
fd9c98ff86 move strict transformer to builtin-setup group - fixes #1538 2015-05-15 00:18:42 +01:00
Sebastian McKenzie
41b5607ef3 fix env option tests 2015-05-15 00:11:28 +01:00
Sebastian McKenzie
ae77ea807f normalise source map file paths when using the CLI - fixes #1496 2015-05-15 00:05:11 +01:00
Sebastian McKenzie
ad44190c6b properly register for head variable declaration paths when performing scope tracking - fixes #1524 2015-05-14 23:53:04 +01:00
Sebastian McKenzie
024e4454a1 add env option - closes #1531 2015-05-14 23:47:56 +01:00
Sebastian McKenzie
14dddcda36 make PathHoister much more flexible, now ignores global references and will not deopt on reassignments and will instead hoist as high as it can, this also fixes #1529 since the order of operations has changed 2015-05-14 23:29:02 +01:00
Sebastian McKenzie
d4fb924b6a add tion comment to all function visitors 2015-05-14 22:37:15 +01:00
Sebastian McKenzie
b02c97af60 Merge pull request #1536 from benjamn/master
Invoke Regenerator on async/generator Function nodes, not whole AST.
2015-05-14 22:27:42 +01:00
Ben Newman
cc611cb71c Invoke Regenerator on async/generator Function nodes, not whole AST.
This should help (dramatically?) with
https://github.com/babel/babel/issues/1486#issuecomment-101491605,
although I'm not sure how to run the benchmarks myself.
2015-05-14 15:42:58 -05:00
Sebastian McKenzie
b8a01a9919 move traversal scope logic and binding into it's own folder, rename Scope#generateTemp to generateDeclaredUidIdentifier, rename Scope#generateUidBasedOnNode to Scope#generateUidIdentifierBasedOnNode 2015-05-14 19:12:26 +01:00
Sebastian McKenzie
55c99661be NFO 2015-05-14 18:07:36 +01:00
Sebastian McKenzie
1563b216df Merge branch 'master' of github.com:babel/babel 2015-05-14 17:56:33 +01:00
Sebastian McKenzie
a9d4b485d9 simplify getStaticContext in es7.functionBind transformer - thanks @RReverser! 2015-05-14 17:48:51 +01:00
Sebastian McKenzie
360daa6267 Merge pull request #1532 from dchambers/prefix-private-methods-with-underscore
Prefix private methods names with underscore.
2015-05-14 16:52:16 +01:00
Sebastian McKenzie
724bf52929 handle "static" contexts in es7.functionBind - #1518 2015-05-14 16:37:44 +01:00
Sebastian McKenzie
7407b37bd9 Merge pull request #1518 from babel/es7.functionBind
Add experimental support for ES7 function bind.
2015-05-14 16:22:21 +01:00
Ingvar Stepanyan
da765cc4c1 Flip the negation in if-else. 2015-05-14 18:05:55 +03:00
dchambers
4f862eee6e Prefix private methods names with underscore. 2015-05-14 13:19:41 +01:00
Ingvar Stepanyan
4001a28983 Fix some parsing edge cases for :: operator. 2015-05-14 12:47:51 +03:00
Ingvar Stepanyan
e05d7cf49a Fix some parsing edge cases for :: operator. 2015-05-14 12:47:51 +03:00
Ingvar Stepanyan
fd8e94a90f Preserve original execution order in :: operator. 2015-05-14 12:39:05 +03:00
Sebastian McKenzie
a6cf28c5b5 Merge pull request #1525 from nkt/exponentiation-operator-inline
Added missing exponential operator inlining
2015-05-13 23:09:57 +01:00
Nikita Gusakov
6b07b13a8e Added missing exponential operator inlining 2015-05-14 01:08:02 +03:00
Sebastian McKenzie
561c4dcc25 5.3.3 2015-05-13 22:09:37 +01:00
Sebastian McKenzie
b516ea596a v5.3.3 2015-05-13 22:08:32 +01:00
Sebastian McKenzie
248758eee3 fix version number 2015-05-13 22:07:33 +01:00
Sebastian McKenzie
a808602ae0 v3.5.3 2015-05-13 22:07:00 +01:00
Sebastian McKenzie
40e3436e95 add 3.5.3 changelog 2015-05-13 22:05:07 +01:00
Sebastian McKenzie
f704770b26 uncomment out return traversal path skipping - fixes #1523 2015-05-13 22:03:50 +01:00
Sebastian McKenzie
330665f150 ignore modules alongside param bindings in minification.deadCodeElimination transformer - fixes #1523 2015-05-13 21:49:28 +01:00
Sebastian McKenzie
af41899d74 5.3.2 2015-05-13 19:58:21 +01:00
Sebastian McKenzie
d12f4d0bc8 v5.3.2 2015-05-13 19:57:20 +01:00
Sebastian McKenzie
97680e9dfd properly hoist all var patterns when wrapping bodies in the es6.blockScoping transformer - fixes #1521 2015-05-13 19:55:40 +01:00
Sebastian McKenzie
51341ca6c3 fix and add missing module specifier reference detection - fixes #1520 2015-05-13 19:23:47 +01:00
Sebastian McKenzie
ab54bfa50e Merge pull request #1519 from zpao/package-licenses
Add license fields to packages
2015-05-13 18:36:25 +01:00
Paul O’Shannessy
60aa933fb6 Add license fields to packages 2015-05-13 10:21:42 -07:00
Ingvar Stepanyan
1a299b2bcc Small fixes to es7.functionBind and generation tests added. 2015-05-13 18:20:33 +03:00
Ingvar Stepanyan
b026927775 Add experimental support for ES7 function bind. (issue #1287) 2015-05-13 17:58:21 +03:00
Ingvar Stepanyan
37f662d790 Add experimental support for ES7 function bind. (issue #1287) 2015-05-13 17:58:21 +03:00
Sebastian McKenzie
b0317f9bab don't consider "globals" to cause incompatible scope hoist 2015-05-13 12:33:08 +01:00
Sebastian McKenzie
be2dfaf081 register variable declarator in scope when pushing 2015-05-13 09:11:09 +01:00
Sebastian McKenzie
2c8437ae92 ignore initializerless variable declaration when trying to inline single use variables - fixes #1516 2015-05-13 08:46:41 +01:00
Sebastian McKenzie
2a0bcfd086 add support for evaluating unary ~ 2015-05-13 08:45:16 +01:00
Sebastian McKenzie
2cf41afac3 move expression inlining to exit rather than enter in minification.inlineExpressions transformer 2015-05-13 08:45:06 +01:00
Sebastian McKenzie
e318f5f3be use ReferencedIdentifier virtual type in minification.deadCodeElimination transformer 2015-05-13 08:44:33 +01:00
Sebastian McKenzie
939decb86c stop entire unnecessary traversal for regenerator 2015-05-13 08:44:18 +01:00
Sebastian McKenzie
1baa0df948 clean up array inferrence for #1515 2015-05-13 08:44:03 +01:00
Sebastian McKenzie
e8956a8c44 upgrade dev dependency babel to 5.3.1 2015-05-13 08:43:25 +01:00
Sebastian McKenzie
2f0fdbbc26 5.3.1 2015-05-13 03:21:54 +01:00
Sebastian McKenzie
5f931525bc v5.3.1 2015-05-13 03:20:33 +01:00
Sebastian McKenzie
b86545a320 update 5.3.1 changelog 2015-05-13 03:19:39 +01:00
Sebastian McKenzie
06e75c42bf update module call remap tests 2015-05-13 03:18:55 +01:00
Sebastian McKenzie
05dd65244d add 5.3.1 changelog 2015-05-13 03:16:43 +01:00
Sebastian McKenzie
c4ebfeb0fa fix explosion of modules and colliding identifiers 2015-05-13 03:16:03 +01:00
Sebastian McKenzie
1aa0bbfac9 add TraversalPath#equals 2015-05-13 03:13:27 +01:00
Sebastian McKenzie
58f1e6cbc6 remove incorrect es6.tailCall visitor comment 2015-05-13 03:13:20 +01:00
Sebastian McKenzie
83e0be3038 make import calls sequence expressions - fixes #1514 2015-05-13 03:13:10 +01:00
Sebastian McKenzie
5fc242e4ec upgrade bable dev dependency to 5.3.0 2015-05-13 03:12:32 +01:00
Sebastian McKenzie
dc101adad3 more es6.tailCall transformer cleanup 2015-05-13 01:13:08 +01:00
Sebastian McKenzie
faade72787 optimise and clean up es6.tailCall transformer 2015-05-13 01:11:26 +01:00
Sebastian McKenzie
2a78ae9889 5.3.0 2015-05-13 01:07:11 +01:00
Sebastian McKenzie
251a31a0fc sync with upstream acorn 2015-05-12 23:21:30 +01:00
Amjad Masad
f387715293 Allow trailing commas in methods 2015-05-12 13:20:36 -07:00
Sebastian McKenzie
0ae1943466 register as inside a type when parsing type aliases to avoid ambiguous jsx parsing - fixes #1378 2015-05-11 23:44:22 +01:00
Sebastian McKenzie
fe739b97dd fix acorn hacky lookahead with token contexts - fixes #1349 2015-05-11 23:20:51 +01:00
Amjad Masad
49077e2e03 New expressions is allowed to have trailing commas in es7 proposal 2015-05-08 19:12:53 -07:00
Christopher Monsanto
4ed4baac99 disallow async constructors -- fixes #1454 2015-05-06 02:50:11 -04:00
Sebastian McKenzie
8039772007 remove embedded jsx plugin and use acorn-jsx 2015-05-04 04:33:46 +01:00
Christopher Monsanto
c263a25b54 support commas as obj property separators in flow 2015-05-01 00:09:26 -04:00
Sebastian McKenzie
1a53d5ca46 upgrade to babel 5 2015-04-28 14:55:28 +01:00
Sebastian McKenzie
562dba872d fix spread properties in assignment position - fixes #1315 2015-04-21 16:24:34 +01:00
Sebastian McKenzie
5f1c3c3b8d remove unnecessary csp makePredicate - fixes #1267 2015-04-15 15:13:12 -07:00
Sebastian McKenzie
8ee54e0756 Mark function token as able to start an expression 2015-04-14 08:18:06 -07:00
Sebastian McKenzie
28589d459d make illegal LHS pattern error messages more user friendly 2015-04-13 16:40:13 -07:00
Sebastian McKenzie
075ff67aca make parenthesized array patterns illegal - cc @michaelficarra 2015-04-13 16:16:57 -07:00
Sebastian McKenzie
25a3bbce91 only make parenthesized object patterns illegal - fixes #1254, ref jshint/jshint#2269 2015-04-13 15:44:54 -07:00
Sebastian McKenzie
eed185c4dc remove useless kind on import declarations 2015-04-13 14:55:46 -07:00
Sebastian McKenzie
e15f8a79d6 make parsing of decorators stateless - fixes shuhei/babel-angular2-app#4 2015-04-13 08:26:51 -07:00
Sebastian McKenzie
7944e3b1fa Merge pull request #1215 from AluisioASG/es7-trailing-function-commas
ES7 trailing function commas
2015-04-12 19:17:02 -07:00
Sebastian McKenzie
85f2e79f95 add support for object literal decorators - fixes #1154 2015-04-11 16:30:55 -07:00
Sebastian McKenzie
82384f4761 parse await expression as a unary instead of an assignment - fixes #1225 2015-04-10 15:23:11 -07:00
Sebastian McKenzie
4f41b7c5e5 set canBeArrow to true when parsing async functions 2015-04-10 13:51:30 -07:00
Sebastian McKenzie
d0bf19681a update to latest acorn 2015-04-10 13:44:50 -07:00
Sebastian McKenzie
3b0b31ef9e don't emit tokens when doing a lookahead 2015-04-09 06:44:16 -07:00
Sebastian McKenzie
ab40459198 fix order of parameter type annotation parsing - fixes #1168 2015-04-06 06:19:13 -07:00
Aluísio Augusto Silva Gonçalves
58284c5002 [ES7] Trailing comma in function parameter list
Currenly a stage 1 proposal.
See https://github.com/jeffmo/es-trailing-function-commas.
2015-04-06 09:10:44 -03:00
Sebastian McKenzie
a2a8ebbe95 fix missing this in acorn parseExprAtom 2015-04-05 03:26:41 +10:00
Sebastian McKenzie
9a3e36055d fix es7 export extensions compound list 2015-04-01 23:21:16 +11:00
Sebastian McKenzie
2fffffe780 fix paramless async calls 2015-04-01 13:57:59 +11:00
Sebastian McKenzie
4280c2d846 fix incorrect interpreation of export default shorthand, update to new ast definitions - #1091 2015-03-30 06:08:37 +11:00
Sebastian McKenzie
f794e360f0 add support for export extensions https://github.com/leebyron/ecmascript-more-export-from - closes #1091 2015-03-30 03:38:14 +11:00
Sebastian McKenzie
d93a315df4 fix class decorator methods 2015-03-29 19:30:34 +11:00
Sebastian McKenzie
54fa079bf4 fixes #1114
- The visitor keys for `ObjectTypeAnnotation`s were incorrect so those nodes weren't being traversed so comments weren't attached for them.
 - The type parser wasn't eating the semicolons for the nodes so the `end` location of each of the type properties wasn't accurate which threw off the code generation newline algorithm.
 - Type properties hadn't been given the `UserWhitespacable` alias.
2015-03-29 16:44:36 +11:00
Sebastian McKenzie
aeb0cfcbbe remove es7.classProperties check from parser 2015-03-28 03:59:01 +11:00
Sebastian McKenzie
ddd173a4b3 restructure testing infrastructure to be more modular 2015-03-28 01:21:48 +11:00
Sebastian McKenzie
5f6a216809 add support for decorators before class exports 2015-03-28 00:22:38 +11:00
Sebastian McKenzie
f5f77d4720 better parsing of decorators - support class expressions 2015-03-26 00:58:38 +11:00
Sebastian McKenzie
e52af24999 add class property initializers, add more TraversalPath flexibility with additional node injection method 2015-03-24 03:34:34 +11:00
Sebastian McKenzie
6d87a99d1d make method definitions with expression bodies illegal - fixes #1066 2015-03-23 20:24:32 +11:00
Sebastian McKenzie
2cbbd86552 remove acorn compiled source 2015-03-22 04:09:18 +11:00
Sebastian McKenzie
37072737b9 add support for class decorators 2015-03-22 04:07:38 +11:00
Sebastian McKenzie
6128fd9687 add do expressions 2015-03-22 04:06:15 +11:00
Logan Smyth
01b39d67f0 Merge acorn 1.0.0 (formerly 'update to modular acorn' in original history). 2016-03-14 22:47:51 -07:00
Sebastian McKenzie
0d143f005f update to latest acorn, better array shortcuts, don't add code frame to error message 2016-03-14 22:40:33 -07:00
Sebastian McKenzie
f830892ab8 fix modules generation logic and remove dead node types 2016-03-14 22:40:24 -07:00
Sebastian McKenzie
7c84db45fd more estree updates - finish flow parsing 2016-03-14 22:40:16 -07:00
Sebastian McKenzie
57af08bea8 move acorn into vendor 2016-03-14 22:39:57 -07:00
Logan Smyth
16e8224ce6 Merge acorn 0.12.1 and acorn-babel (formerly "embed acorn" in the original git history). 2016-03-14 22:39:24 -07:00
Marijn Haverbeke
44c0231c09 Don't require a semicolon after 'export default [function|class] ...'
Issue #225
2015-03-20 22:40:51 +01:00
Marijn Haverbeke
1fc1d32e1f Add some notes on plugins to the README 2015-03-20 21:29:50 +01:00
Marijn Haverbeke
35d0b80976 Properly export acorn.plugins 2015-03-20 21:12:26 +01:00
Marijn Haverbeke
a1022f38e1 Fix trying to run .sh file with node in prepublish script 2015-03-20 21:05:14 +01:00
Marijn Haverbeke
5d7f4d7a23 Update README 2015-03-20 21:01:05 +01:00
Marijn Haverbeke
659f2c9091 Teach the walker about Super and MetaProperty 2015-03-20 17:51:50 +01:00
Marijn Haverbeke
2ed8f8f2b8 Fix infinite loop introduced by 685b51e 2015-03-20 17:49:51 +01:00
Marijn Haverbeke
013e48439f Update tools/generate-identifier-regex.js
So that it can also spit out the astral maps.
2015-03-20 17:47:46 +01:00
Marijn Haverbeke
685b51e0ae Make the loose parser's parseIdent actually returns an identifier with a name 2015-03-20 17:36:47 +01:00
Marijn Haverbeke
0fee7a395e Fix the way 'npm test' loads the library 2015-03-20 17:35:51 +01:00
Ingvar Stepanyan
864268abb6 Add support for meta-properties.
estree/estree#32
2015-03-20 17:35:37 +01:00
Ingvar Stepanyan
921e45ab2b SuperExpression -> Super 2015-03-20 17:23:01 +01:00
Marijn Haverbeke
e88a5431db Allow init-less destructing bindings in for/in and for/of 2015-03-20 17:19:35 +01:00
Marijn Haverbeke
35c417d02b Remove remnants of docco-based homepage 2015-03-20 17:05:23 +01:00
Marijn Haverbeke
f538706db3 Code style -- less semicolons, more let variables 2015-03-20 17:00:32 +01:00
Marijn Haverbeke
6dd254d999 Tie everything together in the new build system 2015-03-20 16:36:24 +01:00
Marijn Haverbeke
cf613ce287 Split up the loose parser, set up a build script 2015-03-20 14:41:55 +01:00
Marijn Haverbeke
dd89c6e112 Make loose parser work with minor interface changes introduced by modularization 2015-03-20 12:04:33 +01:00
Marijn Haverbeke
a1fe3a1859 Finish splitting up main parser 2015-03-20 11:47:31 +01:00
Marijn Haverbeke
7b05e660b4 Move location-related code into location.js 2015-03-19 16:28:28 +01:00
Marijn Haverbeke
fec42cb596 Move tokenizer into modules 2015-03-19 16:17:43 +01:00
Marijn Haverbeke
93b919c1a0 Split out identifier-related code 2015-03-19 15:49:58 +01:00
Marijn Haverbeke
9808459940 Start on ES6 port 2015-03-19 15:40:12 +01:00
Mathias Bynens
575421b3c2 Make readRegexp more tolerant 2015-03-19 14:48:43 +01:00
Marijn Haverbeke
9673146cc1 Verify that property name can be bound to in short-hand object pattern properties
Issue #221
2015-03-19 14:05:16 +01:00
Marijn Haverbeke
a45172e044 Unify checkLVal and checkFunctionParam 2015-03-19 13:42:26 +01:00
Marijn Haverbeke
0a755156a8 Ignore backslash-escapes in identifiers in ES6 mode 2015-03-19 13:11:17 +01:00
Marijn Haverbeke
5d5b8eb3c8 Don't crash when converting missing array elements to assignable
Closes #220
2015-03-19 12:58:34 +01:00
Marijn Haverbeke
b6e8310848 Require an initalization value when let/var/const-declaring a complex pattern
Closes #222
2015-03-19 12:46:36 +01:00
Marijn Haverbeke
a75a685610 Add a startsExpr property to token types, use it to properly parse yield
Issue #219
2015-03-19 12:34:41 +01:00
Ingvar Stepanyan
0473c368e6 [es6][estree] Add support for sourceType: script|module modes.
+ Fix list of keywords and reserved words in ES6.
2015-03-18 13:42:49 +02:00
Ingvar Stepanyan
024a98431d [estree] Add SuperExpression.
(we're almost there)
2015-03-17 23:01:42 +02:00
Ingvar Stepanyan
876e774bfe [estree] Align method kinds.
[loose] Split parseObj and parseClass.
2015-03-17 22:36:34 +02:00
Marijn Haverbeke
19ef4ef69c Require semicolon after 'import * from ...' 2015-03-17 12:30:12 +01:00
Sebastian McKenzie
f651807069 v0.11.1-38 2015-03-13 13:22:32 +11:00
Sebastian McKenzie
d08d63b01d support bounded polymorphism in flow facebook/esprima#103 2015-03-13 13:22:09 +11:00
Marijn Haverbeke
57bc9b1b0a Move parsing of yield into parseMaybeAssign
Issue #219
2015-03-12 23:11:33 +01:00
Marijn Haverbeke
16a342082a Allow trailing commas in array patterns
Closes #975
2015-03-12 22:39:00 +01:00
Marijn Haverbeke
811d19ab76 Allow any number of digits when killing \u{} sequences in regexps 2015-03-12 22:26:31 +01:00
Marijn Haverbeke
4735ef53ef Replace the forbidReserved option with an allowReserved option
For consistency with similar options
2015-03-12 22:02:41 +01:00
Marijn Haverbeke
ba750b253b Replace strictSemicolons and allowTrailingCommas with onInsertedSemicolon and onTrailingComma 2015-03-12 22:02:41 +01:00
Marijn Haverbeke
9fb3a4f5ce Move as much as possible code in test driver out of try block 2015-03-12 22:01:33 +01:00
Ingvar Stepanyan
34050d3917 Support for for (const ...).
Fixes #213.

Also changes API to pass token type to `parseVar` to reduce string comparison ops.
2015-03-10 11:36:15 +02:00
Ingvar Stepanyan
ff60ee4fdb [estree] Align export ... representations. 2015-03-10 10:37:00 +02:00
Ingvar Stepanyan
722bc65e79 [estree] Align Import specifiers. 2015-03-10 02:27:24 +02:00
Marijn Haverbeke
12558821c5 Use an object argument in the TokenType constuctor 2015-03-06 10:37:35 +01:00
Marijn Haverbeke
4e0a7fac71 Linting changes 2015-03-06 10:36:17 +01:00
Marijn Haverbeke
8459481e65 Represent a tokenizer as an instance of the parser
This completely changes the interface, and removes most of the complexity
in the old tokenizer interface (jump-to-position was removed, since it is
all kinds of unreliable given the new tokenizer context system).
2015-03-05 17:30:48 +01:00
Marijn Haverbeke
0df2affdfe Move loose parser to object style
Drop dependency on tokenizer interface
2015-03-05 17:22:06 +01:00
Marijn Haverbeke
3365478645 Add a plugin mechanism to allow JSX parser to be a module
And export a few more things
2015-03-05 16:00:34 +01:00
Marijn Haverbeke
06f3b3c224 Attach context update algorithm to token types
For, theoretically, easier extendability
2015-03-05 15:59:12 +01:00
Marijn Haverbeke
6bd1013f2c Use uniform object type for node types
Speeds things up by about 9% on io.js 1.3
2015-03-05 15:59:12 +01:00
Marijn Haverbeke
141905f9fd Consume whitespace before, rather than after, reading a token
Simplifies several things
2015-03-05 15:59:12 +01:00
Marijn Haverbeke
bc48c02a18 Move the parser state into an object
Makes almost everything in acorn.js a method of this object.

Performance is not significantly affected on a modern V8. Makes the
code reentrant and allows us to more easily expose more methods
externally in the future.

On the other hand, the proliferation of `this.` is unfortunate.
2015-03-05 15:59:12 +01:00
Marijn Haverbeke
33307e789a Update tools/generate-identifier-regex.js
So that it can also spit out the astral maps.
2015-03-05 15:55:38 +01:00
Marijn Haverbeke
d76ea4b3be Make the tokenizer aware of multi-byte characters in ES6 mode
Add a data structure to recognize astral identifier chars. Parse whole
code points when looking for identifiers.

Issue #215
2015-03-05 15:55:38 +01:00
Marijn Haverbeke
891d5d07dd Allow braced \u escapes in identifiers
We still can't properly recognize code points as ES6-style
identifier chars.

Issue #214
2015-03-04 15:37:26 +01:00
Marijn Haverbeke
59dc29f3f0 In ES6-mode, don't treat keywords with escaped characters as regular identifiers
See https://mathiasbynens.be/notes/javascript-identifiers-es6
2015-03-04 15:29:15 +01:00
Marijn Haverbeke
cbd8aa8f06 Bump version number post-0.12 2015-03-02 11:31:27 +01:00
Marijn Haverbeke
99f1989f72 Mark release 0.12 2015-03-02 11:31:11 +01:00
Marijn Haverbeke
8c98acf5d6 Make sure all ignored files are ignored in npmigore 2015-03-02 11:30:47 +01:00
Sebastian McKenzie
ec131eaecc v0.11.1-37 2015-02-28 22:34:32 +11:00
Sebastian McKenzie
854e892cda fix type annotation property on arrow function params returnType to typeAnnotation 2015-02-28 22:33:03 +11:00
Sebastian McKenzie
65e1646dbf v0.11.1-35 2015-02-26 08:32:08 +11:00
Sebastian McKenzie
1424c35d13 correctly handle SpreadProperty - fixes babel/babel#897 2015-02-26 08:31:49 +11:00
Marijn Haverbeke
2a0ccb1030 Wording change in readme funding link 2015-02-23 11:49:44 +01:00
Andres Suarez
2b6f24ea86 Add .npmignore 2015-02-23 11:36:37 +01:00
Sebastian McKenzie
631b78e07d v0.11.1-34 2015-02-22 22:42:07 +11:00
Sebastian McKenzie
e9a6f83c00 rewrite async function parsing - fixes #27 2015-02-22 14:05:22 +11:00
Sebastian McKenzie
5a0861c1b9 remove dead _dotQuestion code 2015-02-22 12:33:09 +11:00
Marijn Haverbeke
b6b1bc2bae [README] Add NPM and funding links 2015-02-19 11:51:27 +01:00
Sebastian McKenzie
f8eba046b3 v0.11.1-33 2015-02-18 10:25:29 +11:00
Sebastian McKenzie
82e3819f38 fix PrivateDeclaration/SpreadProperty strict mode 2015-02-18 10:25:17 +11:00
Marijn Haverbeke
de544da8f3 [walker] Understand ParenthesizedExpression nodes
Closes #210
2015-02-17 15:09:18 +01:00
Marijn Haverbeke
9a617a59e4 [loose parser] Don't tokenize ellipsis when ecmaVersion < 6
Issue marijnh/tern#493
2015-02-17 14:41:33 +01:00
Sebastian McKenzie
f4c39613f5 v0.11.1-32 2015-02-15 17:46:52 +11:00
Sebastian McKenzie
36381d1785 rename to acorn-babel 2015-02-15 17:46:45 +11:00
Sebastian McKenzie
032d66d79f v0.11.1-31 2015-02-14 12:53:40 +11:00
Sebastian McKenzie
fe0b679104 add support for flow type casts and import/export types - facebook/react#3143 2015-02-14 12:52:42 +11:00
Sebastian McKenzie
12768c40d9 update to latest esprima-fb flow tests 2015-02-14 12:52:08 +11:00
Sebastian McKenzie
383fcec1f0 v0.11.1-30 2015-02-13 15:04:54 +11:00
Sebastian McKenzie
04c64c4592 remove this shorthand playground tests 2015-02-13 15:04:33 +11:00
Sebastian McKenzie
91b79e9178 Merge branch 'thetalecrafter-multiline' 2015-02-13 15:03:20 +11:00
Sebastian McKenzie
987694bb23 Merge branch 'multiline' of https://github.com/thetalecrafter/acorn-jsx into thetalecrafter-multiline
Conflicts:
	acorn.js
	acorn_loose.js
	package.json
2015-02-13 15:03:03 +11:00
Andy VanWagoner
9f73a10f61 Allow multiline JSX string attributes. 2015-02-12 20:47:00 -07:00
Sebastian McKenzie
a6a156e039 v0.11.1-29 2015-02-11 10:58:33 +11:00
Sebastian McKenzie
ac2dfced36 add support for class initializer properties - 6to5/6to5#619 2015-02-11 10:57:54 +11:00
Sebastian McKenzie
04cf3f3f9d v0.11.1-28 2015-02-08 20:40:13 +11:00
Sebastian McKenzie
57fccb55ff remove this shorthand - closes 6to5/6to5#717 2015-02-08 20:39:48 +11:00
Sebastian McKenzie
7458d57e4f v0.11.1-27 2015-02-08 16:18:13 +11:00
Sebastian McKenzie
1aa8c6a37c fix function parsing due to faulty merge 2015-02-08 16:17:53 +11:00
Sebastian McKenzie
e268c4eefb v0.11.1-26 2015-02-08 16:10:06 +11:00
Sebastian McKenzie
7ec50ebd57 Merge https://github.com/marijnh/acorn
Conflicts:
	acorn.js
	acorn_loose.js
2015-02-08 16:09:46 +11:00
Sebastian McKenzie
ce7abeab18 fix strictMode option 2015-02-08 16:06:32 +11:00
Ingvar Stepanyan
7264bc0178 Fix found V8 deopt.
Increases perf from 230K to 360K lines/sec on std bench on my machine.
2015-02-05 00:02:21 +02:00
Ingvar Stepanyan
c034550215 Disallow line break between arrow function params and =>. 2015-02-04 12:57:18 +02:00
Sebastian McKenzie
06c4334808 use all property instead of delegate on await expressions - facebook/regenerator#171 2015-01-29 13:24:22 +11:00
Sebastian McKenzie
695f7ce648 ignore ds_store 2015-01-29 13:05:15 +11:00
Ingvar Stepanyan
3cbad64c1e Update version. 2015-01-27 18:26:03 +02:00
Ingvar Stepanyan
e0bcfca03f Add JSX support to loose parser. 2015-01-27 18:25:49 +02:00
Ingvar Stepanyan
95479ab6aa Optimize JSX text reading. 2015-01-27 16:51:45 +02:00
Ingvar Stepanyan
55ae051c81 Update version after merge. 2015-01-27 16:28:12 +02:00
Ingvar Stepanyan
2f40d7e30e Merge branch 'upstream' into jsx2 2015-01-27 16:27:59 +02:00
Ingvar Stepanyan
6eb177582d Fix export default declarations.
Closes #184.
2015-01-27 16:21:41 +02:00
Ingvar Stepanyan
e4a97ab877 Finalized destructuring support in loose parser; fixed startNodeAt. 2015-01-27 15:53:16 +02:00
Ingvar Stepanyan
6660a21b79 Disallow MemberExpression in bindings; clarify function namings. 2015-01-27 15:23:09 +02:00
Ingvar Stepanyan
3d5964ceed Fix locations for AssignmentPatterns. 2015-01-27 15:10:25 +02:00
Sebastian McKenzie
256ae1a011 v0.11.1-25 2015-01-26 20:30:35 +11:00
Sebastian McKenzie
e14e6473ff fix flow type param parsing position - fixes #24 2015-01-26 20:30:21 +11:00
Sebastian McKenzie
189d2c3fa9 v0.11.1-24 2015-01-26 16:58:58 +11:00
Sebastian McKenzie
301f639f73 fix incorrect parseExpression arguments - not sure where this came from 2015-01-26 16:58:41 +11:00
Sebastian McKenzie
37ca3c3d29 v0.11.1-23 2015-01-26 12:02:42 +11:00
Sebastian McKenzie
2fb5a3c46e reference exports.Node so we can replace it if necessary 2015-01-26 01:25:41 +11:00
Sebastian McKenzie
45bb4b00f0 0.11.1-22 2015-01-26 00:12:29 +11:00
Sebastian McKenzie
1221112610 add canInsertSemicolon check to async function parsing 2015-01-26 00:12:01 +11:00
Sebastian McKenzie
766e42d140 clean up async function declaration parsing 2015-01-25 23:44:17 +11:00
Sebastian McKenzie
c297f5a57f fix parseAssignableListItem function name misspelling 2015-01-25 22:06:58 +11:00
Sebastian McKenzie
0530e7c28d 0.11.1-21 2015-01-25 17:22:49 +11:00
Sebastian McKenzie
2c3d2ec875 simplify parse assignable list types 2015-01-25 17:22:37 +11:00
Sebastian McKenzie
1937e93e58 update flow rest param tests 2015-01-25 17:22:26 +11:00
Sebastian McKenzie
7ea883a3b5 Merge https://github.com/RReverser/acorn-jsx
Conflicts:
	acorn.js
	package.json
2015-01-25 17:08:37 +11:00
Sebastian McKenzie
e397a0c4d3 support flow types in arrow function params, add support for async function declarations 2015-01-25 17:06:13 +11:00
Sebastian McKenzie
c5197e1cad Merge https://github.com/marijnh/acorn
Conflicts:
	acorn.js
	acorn_loose.js
2015-01-25 11:50:02 +11:00
Ingvar Stepanyan
012f7dbddd Introduce helpers for contextual keywords. 2015-01-25 10:36:06 +11:00
Sebastian McKenzie
97dd99d171 Remove useless noLess 2015-01-25 10:03:51 +11:00
Ingvar Stepanyan
401e6c4f30 Update version. 2015-01-25 00:33:14 +02:00
Ingvar Stepanyan
719ecbd203 Improve JSX braces context handling. 2015-01-25 00:33:03 +02:00
Ingvar Stepanyan
e93b69d595 Add regression test for #15. 2015-01-25 00:27:06 +02:00
Ingvar Stepanyan
c445d073e2 Merge branch 'upstream' into jsx2
Conflicts:
	acorn.js
2015-01-25 00:20:02 +02:00
Sebastian McKenzie
78215a17cd Merge https://github.com/marijnh/acorn
Conflicts:
	acorn.js
	package.json
2015-01-24 22:49:06 +11:00
Ingvar Stepanyan
5d96bbd781 Simplify & fix rest argument validity checks. 2015-01-24 13:38:14 +02:00
Ingvar Stepanyan
cdd444eff1 Speed-up reading words, strings and templates.
Now identifiers and strings even with escaped chars are read
in optimized way by reading entire chunks delimited by escape
chars (and not bailing to deopt mode on first one).
2015-01-24 12:42:19 +02:00
Ingvar Stepanyan
65d09eac6e Implement shorthand property assignment in ambiguous contexts.
Issue #181.
2015-01-24 12:40:24 +02:00
Ingvar Stepanyan
f0569147e6 Avoid extra call and arg in parseExpression for single-expression case. 2015-01-23 21:48:33 +02:00
Ingvar Stepanyan
41ad304955 Introduce helpers for contextual keywords. 2015-01-23 21:36:16 +02:00
Ingvar Stepanyan
08b34933d7 Added acorn_csp to .gitignore and fixed generation under Windows. 2015-01-23 15:39:49 +02:00
Ingvar Stepanyan
2e9180f041 Add ES6 patterns to util/walk.js 2015-01-23 15:33:28 +02:00
Ingvar Stepanyan
917de714b1 Switch from Function.{rest,defaults} to AssignmentPattern and RestElement.
Closes #182.
2015-01-23 15:29:37 +02:00
Sebastian McKenzie
90513be27c 0.11.1-20 2015-01-23 23:45:53 +11:00
Sebastian McKenzie
f031700b67 Merge https://github.com/marijnh/acorn
Conflicts:
	acorn.js
2015-01-23 23:16:59 +11:00
Sebastian McKenzie
cb76f3f7ba Merge https://github.com/marijnh/acorn
Conflicts:
	acorn.js
2015-01-23 23:16:08 +11:00
Ingvar Stepanyan
38609ae26d Closes #205. 2015-01-23 14:14:02 +02:00
Ingvar Stepanyan
cb94a0851c Add regex comparison to test driver. 2015-01-23 13:50:01 +02:00
Ingvar Stepanyan
e6f1e1027e Fix dividing function expression.
Fixes #204.
2015-01-23 13:17:03 +02:00
Sebastian McKenzie
78923eae15 add back missing class type parsing 2015-01-23 21:38:13 +11:00
Sebastian McKenzie
ac4fdac04a add flow tests 2015-01-23 21:37:26 +11:00
Sebastian McKenzie
957d2b4c44 Merge https://github.com/marijnh/acorn 2015-01-23 21:02:23 +11:00
Ingvar Stepanyan
39d752dc6b Make top-level equal to block statement context.
Fixes #203.
2015-01-23 11:48:39 +02:00
Sebastian McKenzie
c1da7ac939 Merge branch 'master' of github.com:6to5/acorn-6to5 2015-01-23 08:07:51 +11:00
Sebastian McKenzie
04e6d02d1e 0.11.1-19 2015-01-23 08:07:39 +11:00
Sebastian McKenzie
af7630b963 Merge https://github.com/RReverser/acorn-jsx
Conflicts:
	.gitignore
	README.md
	acorn.js
	package.json
	test/run.js
	test/tests-harmony.js
	test/tests-jsx.js
2015-01-23 08:07:09 +11:00
Ingvar Stepanyan
2e55540bbe Fix {start,end}Loc -> loc.{start,end} in acorn_loose; remove forceRegexp. 2015-01-22 18:53:45 +02:00
Ingvar Stepanyan
555c7898c8 Remove Token::{startLoc,endLoc} so they don't appear in next release. 2015-01-22 18:21:38 +02:00
Ingvar Stepanyan
de23a869ae Add acorn_csp.js to .gitignore. 2015-01-22 17:26:18 +02:00
Ingvar Stepanyan
5e1f60dbae Update repository metadata and readme. 2015-01-22 17:25:50 +02:00
Ingvar Stepanyan
a7d5734a59 Fix spread attribute parsing after merge. 2015-01-22 17:13:56 +02:00
Ingvar Stepanyan
0d4f1f6ce9 Update version. 2015-01-22 16:39:30 +02:00
Ingvar Stepanyan
252bb46f70 Merge branch 'upstream' into jsx2 2015-01-22 16:11:28 +02:00
Ingvar Stepanyan
caa5da6ce1 Improve spread element parsing (fix allowed contexts and error locations). 2015-01-21 23:51:40 +02:00
Ingvar Stepanyan
d1f28b75aa Merge branch 'upstream' into jsx2 2015-01-21 03:01:27 +00:00
Ingvar Stepanyan
29910d2b2d XJS -> JSX as per facebook/esprima#83. 2015-01-21 03:00:12 +00:00
Ingvar Stepanyan
cae13fd75a Small simplifications after merge. 2015-01-21 02:58:02 +00:00
Marijn Haverbeke
94b5efcd3e Disallow declaration statements in block-less context
Closes #202
2015-01-20 12:55:21 +01:00
Forbes Lindesay
33a7c9fc24 Support import and export declarations in acorn/util/walk 2015-01-20 12:28:20 +01:00
Marijn Haverbeke
a1d2561cfa Restore patch 9f7cb55264 to original shape
And make loose parser handle stray class semicolons

Issue #190
2015-01-20 12:02:30 +01:00
Sebastian McKenzie
9f7cb55264 Add stray semicolons as class elements 2015-01-20 11:56:33 +01:00
Ingvar Stepanyan
d64efe1be4 Merge branch 'upstream' into jsx2
Conflicts:
	acorn.js
2015-01-19 14:12:24 +00:00
Sebastian McKenzie
dce9e241db Merge pull request #23 from hawkrives/patch-1
Update .npmignore to ignore big, not-used-in-NPM directories
2015-01-19 08:28:19 +11:00
Hawken Rives
9564ce9fd4 Update .npmignore
Ignore `test` (2.7MB) and `docs` (651KB)
2015-01-18 09:42:10 -06:00
Sebastian McKenzie
b82d5f0290 Merge branch 'master' of github.com:6to5/acorn-6to5 2015-01-18 19:24:30 +11:00
Sebastian McKenzie
89d8eff5ad v0.11.1-18 2015-01-18 19:20:51 +11:00
Sebastian McKenzie
587ab0d07c Merge pull request #22 from tricknotes/fix-repo-name
Fix repository name
2015-01-18 19:17:52 +11:00
Ryunosuke SATO
d24b59ca42 Fix repository name
Now `acorn-6to5` is owned by 6to5 organization.
2015-01-18 17:17:14 +09:00
Sebastian McKenzie
d425759ca7 Merge pull request #21 from charliesome/fix-associativity-parsing-again
Fix associativity parsing, hopefully for good this time
2015-01-18 19:15:44 +11:00
Sebastian McKenzie
d6dec48335 Merge pull request #20 from tricknotes/keep-acorn_scp
Keep acorn_csp.js for npm module
2015-01-18 19:14:48 +11:00
Charlie Somerville
8296fe1415 fix associativity parsing, hopefully for good this time 2015-01-18 19:14:19 +11:00
Ryunosuke SATO
a2f1b75243 Keep acorn_csp.js for npm module
The published version v0.11.1-17 doesn't include acorn_csp.js.
`.npmignore` is required to keep it on NPM module.
2015-01-18 17:12:05 +09:00
Sebastian McKenzie
5f9f588386 fix flow function param type parsing - allow optional notation as well as type declaration - fixes 6to5/6to5#524 2015-01-18 18:33:42 +11:00
Sebastian McKenzie
2debaf0f5e v0.11.1-17 2015-01-18 12:14:49 +11:00
Sebastian McKenzie
7c3a487355 fix exponentiation tests 2015-01-18 12:13:38 +11:00
Sebastian McKenzie
a0a20f9fb2 fix styling in right associative 2015-01-18 10:38:13 +11:00
Sebastian McKenzie
a189dbdcef Merge pull request #19 from charliesome/fix-right-associative-parse
Fix right associative parse precedence
2015-01-18 10:36:12 +11:00
Charlie Somerville
30e9978ffb pass minPrec when right recursing rather than prec - 1 2015-01-18 10:34:34 +11:00
Marijn Haverbeke
dac747dfa9 Add a test for issue #201 2015-01-17 22:26:34 +01:00
Marijn Haverbeke
3e513fc6a8 Kill finishNodeAt in acorn_loose as well
Issue #200
2015-01-17 22:22:26 +01:00
Ingvar Stepanyan
6dee98d1b9 Adapt ES6 template handling to new tokenizer.
Avoid need for:
* extra `templates` array in favor of new `tokContext`;
* special location handling for first & last template elements;
* separate `_templateContinued` token in favor of same `_template`.

Adds:
* token types for backQuote and dollarBraceL instead of skipping them
so they can be handled (i.e. highlighted differently).
2015-01-17 22:21:22 +01:00
Sebastian McKenzie
bdb8e57283 add extra exponentiation operator test 2015-01-18 00:55:12 +11:00
Sebastian McKenzie
572b98b6b9 Merge pull request #18 from charliesome/pow-associativity
Fix ** operator associativity
2015-01-18 00:46:24 +11:00
Charlie Somerville
b51118c3fc use right recursion for right associative operators 2015-01-18 00:44:17 +11:00
Charlie Somerville
5f42326f34 set the rightAssociative flag on _exponent 2015-01-18 00:44:14 +11:00
Sebastian McKenzie
f558bd7db4 remove acorn csp from repo 2015-01-18 00:28:13 +11:00
Sebastian McKenzie
1322501276 add make build task 2015-01-18 00:25:01 +11:00
Sebastian McKenzie
58f84e595f add more exponentation operator tests 2015-01-18 00:24:48 +11:00
Sebastian McKenzie
dc197cecf7 add acorn_csp.js to gitignore 2015-01-18 00:24:28 +11:00
Sebastian McKenzie
8aa74ab845 Merge pull request #17 from jridgewell/mallot
Support Mallet operator
2015-01-17 21:58:48 +11:00
Justin Ridgewell
856571e948 Support Mallet operator
The mallet will check to see if the variable is falsey, and if
it is, override it. It's almost the same as `a = a || b`.

Re: 6to5/6to5#516
2015-01-16 18:28:25 -05:00
Sebastian McKenzie
196ab15f80 Merge pull request #16 from kossnocorp/acorn-6to5/fix_test
Turn on playground for `"obj ?= 2"`
2015-01-17 10:08:53 +11:00
Sasha Koss
ff769780ea Turn on playground for "obj ?= 2"
Without it fail with different issue, doesn’t connected to real case:
`Got error message: Unexpected token (1:5)`.
2015-01-16 20:09:07 +05:30
Ingvar Stepanyan
f6c45ac59f Re-read only number or string after "use strict".
Fixes double-entering same tokContext for various parentheses.
2015-01-14 23:10:10 +02:00
Sebastian McKenzie
f3299fa88d v0.11.1-16 2015-01-15 02:44:52 +11:00
Sebastian McKenzie
886d84c18c limit memoisation assignment operator to playground mode 2015-01-15 02:44:15 +11:00
Ingvar Stepanyan
d34aea63ab Update tests. 2015-01-14 12:36:25 +02:00
Ingvar Stepanyan
e7beee177d Remove deprecated ComprehensionBlock.of property.
Comprehensions were moved to ES7 anyway, so there is no sense
in keeping intermediate no-more-supported syntax.
2015-01-14 12:35:00 +02:00
Ingvar Stepanyan
7e85da74cb shouldSkipSpace is no more needed in finishToken. 2015-01-14 12:31:59 +02:00
Ingvar Stepanyan
ad9411d2ae Made tokenize() compliant with ES6 iterables for easier processing. 2015-01-14 12:29:20 +02:00
Ingvar Stepanyan
802c4cd8cb Initial rewrite of JSX parser onto new tokenizer (all tests passing). 2015-01-14 12:18:08 +02:00
Marijn Haverbeke
0f55a53a7d [loose parser] Fetch token before comment when tokenizer raises unterminated comment error
Closes #197
2015-01-13 22:18:55 +01:00
Forbes Lindesay
cee56dab67 Add --ecma7 option to CLI 2015-01-13 22:08:50 +01:00
Sebastian McKenzie
741fcefa31 Merge pull request #14 from kossnocorp/fix_tests
Fix broken test
2015-01-13 23:46:37 +11:00
Sasha Koss
3ae0f24344 Fix broken test
Starting from
https://github.com/6to5/acorn-6to5/commit/40350cafb8d2c66cad7864e04792e9
046734c633 this shorthand also part of call expression
2015-01-13 18:15:16 +05:30
Sebastian McKenzie
1ed9daf827 v0.11.1-14 2015-01-13 22:42:44 +11:00
Sebastian McKenzie
0f10fbb440 fix makefile indentation 2015-01-13 22:42:01 +11:00
Sebastian McKenzie
482b94563e add csp version as default - fixes #13 2015-01-13 22:39:00 +11:00
Marijn Haverbeke
1b8069e48c Restore onToken functionality for loose parser 2015-01-13 09:53:42 +01:00
Ingvar Stepanyan
d1f95ece42 Revert "Disallow parentheses in lvalue except as in computed keys or default values."
This reverts commit 85087f2a09.
Fixes #193.
2015-01-12 20:31:38 +02:00
Sebastian McKenzie
735c7614ed bump version 2015-01-12 11:44:56 +11:00
Sebastian McKenzie
bde6ef2e0c Merge https://github.com/RReverser/acorn-jsx
Conflicts:
	package.json
	test/tests-jsx.js
2015-01-12 09:59:21 +11:00
Ingvar Stepanyan
eb37a57fb0 Fix for '</' constructs.
Fixes #12.
2015-01-11 23:36:41 +02:00
Ingvar Stepanyan
bc2e01aa03 Allow static as method name in class (fixes #192).
Add uncommitted tests for #191.
2015-01-09 15:31:01 +02:00
Ingvar Stepanyan
3d9048a692 Allow pattern in catch param (fixes #191). 2015-01-09 02:50:32 +02:00
Ingvar Stepanyan
85087f2a09 Disallow parentheses in lvalue except as in computed keys or default values. 2015-01-08 23:00:22 +02:00
Sebastian McKenzie
8ca1be061e fix destructering defaults in params 2015-01-09 05:58:57 +11:00
Sebastian McKenzie
9d4ab350f5 bump version 2015-01-09 05:54:50 +11:00
Sebastian McKenzie
5c0d9a0e61 Parse assignment patterns in-place in certain contexts.
* Parsing assignables without extra transform step when possible (speed-up).
* Added support for shorthand defaults in such certain contexts (issue #181).

Conflicts:
	acorn.js
	acorn_loose.js
2015-01-09 05:54:16 +11:00
Ingvar Stepanyan
4d4a76588c Parse assignment patterns in-place in certain contexts.
* Parsing assignables without extra transform step when possible (speed-up).
* Added support for shorthand defaults in such certain contexts (issue #181).
2015-01-08 20:19:48 +02:00
Marijn Haverbeke
db59bd0296 Remove outdated note about loose parser not supporting ES6 2015-01-06 11:15:34 +01:00
Marijn Haverbeke
0897901f1f Slight cleanup of '/' disambiguation
Issue #189
2015-01-06 11:03:50 +01:00
Marijn Haverbeke
b6b085ac8e Make tokenizer independent of parser (with regards to '/' disambiguation)
Issue #189
2015-01-06 10:58:52 +01:00
Sebastian McKenzie
8c25cb0d80 add higher priority to exponent operator, better async contextual functions 2015-01-06 10:42:57 +11:00
Nick Fitzgerald
af0debc849 Add support for running just the tokenizer to the bin/acorn script. 2015-01-04 22:38:24 +01:00
Marijn Haverbeke
459a169262 Make tests pass again for loose parser
Issue #181
2015-01-04 22:34:42 +01:00
Marijn Haverbeke
7c6a8b7c76 Use parseExprSubscripts instead of parseExpression when parsing superclass
Issue #187
2015-01-04 22:30:50 +01:00
Marijn Haverbeke
045d8c02f5 Revert "Require superclass expressions to be lvals"
This reverts commit 0b59fc198b.

Issue #187
2015-01-04 22:28:16 +01:00
Marijn Haverbeke
e271168cf6 Make onToken only fire for actual final tokens
Issue #189
2015-01-04 22:27:03 +01:00
Sebastian McKenzie
29a4dcc975 Merge https://github.com/marijnh/acorn
Conflicts:
	acorn.js
2015-01-04 22:03:02 +11:00
Ingvar Stepanyan
431a44bc74 Add support for destructuring defaults (not for shorthand props yet).
Related to #181.
2015-01-04 12:15:24 +02:00
Sebastian McKenzie
f2c78674af better class element semicolons 2015-01-04 21:14:18 +11:00
Sebastian McKenzie
1eeb505bf4 no line terminator after contextual async keyword 2015-01-04 20:35:51 +11:00
Sebastian McKenzie
8dad17b675 remove console.trace 2015-01-04 19:49:10 +11:00
Sebastian McKenzie
cec7b1ba3f better acorn async statement parsing 2015-01-04 19:37:38 +11:00
Sebastian McKenzie
55b3e96d95 add support for semicolons as class elements 2015-01-04 18:20:08 +11:00
Sebastian McKenzie
9c3c569ac6 remove checkLVal from class heritage 2015-01-04 08:12:23 +11:00
Sebastian McKenzie
017d76c720 set location info on ThisExpression node in this shorthand - fixes 6to5/6to5#367 2015-01-03 06:09:37 +11:00
Sebastian McKenzie
c8fc778ffb add ecmaVersion check to async function statements 2015-01-02 05:02:59 +11:00
Sebastian McKenzie
56bc618d33 actually parse async functions as statements 2015-01-02 04:21:56 +11:00
Sebastian McKenzie
b5c8ee2120 bump version 2014-12-31 11:50:54 +11:00
Sebastian McKenzie
a727a121ae Merge https://github.com/marijnh/acorn
Conflicts:
	acorn.js
2014-12-31 11:50:15 +11:00
Sebastian McKenzie
9e6e19eca8 parse this shorthand as an ident with subscripts instead of a regular expression 2014-12-31 11:48:25 +11:00
Marijn Haverbeke
0b59fc198b Require superclass expressions to be lvals
And remove a test that violates this.

Closes #185
2014-12-30 12:54:25 +01:00
Ingvar Stepanyan
0084ac14ae Fixed #186. 2014-12-30 13:42:37 +02:00
Sebastian McKenzie
d727f97497 fix export default declarations 2014-12-27 20:07:59 +11:00
Sebastian McKenzie
3e676a0183 Merge branch 'master' of github.com:6to5/acorn-6to5 2014-12-27 20:02:23 +11:00
Sebastian McKenzie
ff4228c09d Merge branch 'master' of https://github.com/marijnh/acorn
Conflicts:
	README.md
	acorn.js
	package.json
2014-12-27 20:02:15 +11:00
Sebastian McKenzie
29a33f5ae9 Merge branch 'export-default-declarations' of https://github.com/sebmck/acorn 2014-12-27 19:55:15 +11:00
Sebastian McKenzie
0bea7c9d51 Fix export default functions and classes being parsed as expressions instead of declarations 2014-12-27 19:54:23 +11:00
Marijn Haverbeke
5512e26ac0 Note allowHashBang option in README
Issue #180
2014-12-18 10:19:22 +01:00
Ingvar Stepanyan
adec9f4b8e Provide better error on member expression in binding's left side. 2014-12-17 20:37:00 +02:00
Ingvar Stepanyan
e37c07248e Added optional support for hashbang directives.
Fixes #180.
2014-12-17 19:58:38 +02:00
Marijn Haverbeke
8e84aa02f4 Bump version number post-0.11 2014-12-17 11:54:40 +01:00
Marijn Haverbeke
78e1d7ada6 Mark version 0.11.0 2014-12-17 11:54:09 +01:00
Marijn Haverbeke
97f4e9a026 [loose parser] Make unclosed objects / lists span to the start of the next node
That way, whitespace at their end is considered part of them,
and Tern can recognize when the cursor is inside of them.
2014-12-17 11:53:20 +01:00
Sebastian McKenzie
804481aad8 Merge pull request #11 from fkling/export_async
Support async functions in export declarations
2014-12-16 17:43:21 +11:00
Felix Kling
59c9f473ae Support async functions in export declarations
6to5 is able to transpile `export async function foo(){}` but acorn-6to5 is
unable to parse it.
2014-12-15 22:33:47 -08:00
Marijn Haverbeke
75b58c07d4 [loose parser] Improve autoclosing of expression lists 2014-12-15 17:32:38 +01:00
Sebastian McKenzie
16b7d59ae5 allow async generator functions - closes #10 - thanks @fkling 2014-12-15 09:39:24 +11:00
Sebastian McKenzie
e3b63530b1 bump version 2014-12-14 14:52:25 +11:00
Sebastian McKenzie
e0b6302649 add support for private declarations 2014-12-14 13:19:22 +11:00
Sebastian McKenzie
c30abbb52b Merge branch 'flow-types' of https://github.com/RReverser/acorn-jsx
Conflicts:
	acorn.js
	package.json
2014-12-13 12:45:28 +11:00
Sebastian McKenzie
46977807b7 fix isX variables not being reset on parseObj 2014-12-13 12:33:07 +11:00
Sebastian McKenzie
3a59b5a151 better async contextual identifiers 2014-12-13 12:06:42 +11:00
Sebastian McKenzie
24115acee0 Add flow type support 2014-12-13 05:01:29 +11:00
Ingvar Stepanyan
f188613e09 Add support for unknown entities (treat as ampersand + regular text).
Fixes #10.
2014-12-12 18:46:58 +02:00
Sebastian McKenzie
8bef320d58 change bind member operator to a hash - fixes #6 2014-12-13 00:47:13 +11:00
Sebastian McKenzie
71bb9d6123 contextual async/await keywords - closes 6to5/6to5#157 2014-12-13 00:37:40 +11:00
Marijn Haverbeke
6915519498 Give TemplateElements a narrower range
Issue #169
2014-12-11 17:44:45 +01:00
Marijn Haverbeke
c671bcfaf7 Bump version number post-0.10 2014-12-11 14:52:32 +01:00
Marijn Haverbeke
0a812b6020 Mark release 0.10.0 2014-12-11 14:51:45 +01:00
Marijn Haverbeke
c989857aa5 Add allowImportExportEverywhere option
Closes #174
2014-12-11 14:48:03 +01:00
Marijn Haverbeke
91e5ac0fdd Make loose parser parse template strings 2014-12-11 14:30:24 +01:00
Marijn Haverbeke
2cb3dbcb41 Change token structure of template literals
Fix various template parsing issues, makes tokenizer useable from outside
the parser.

Closes #169
Closes #173
2014-12-11 14:20:01 +01:00
Sebastian McKenzie
53d98f1175 Make semicolon optional in do-while in >=ES6 2014-12-10 13:14:25 +01:00
Sebastian McKenzie
6623756312 bump version 2014-12-10 21:49:55 +11:00
Sebastian McKenzie
1b760db578 Merge branch 'master' of https://github.com/RReverser/acorn 2014-12-10 20:32:56 +11:00
Sebastian McKenzie
4d985230cc Merge branch 'do-optional-semicolon' of https://github.com/sebmck/acorn 2014-12-10 19:07:39 +11:00
Sebastian McKenzie
c87a7a7095 Revert "Merge branch 'do-optional-semicolon' of https://github.com/sebmck/acorn"
This reverts commit c526814896711439b89f613fe0412aad4c1730a8, reversing
changes made to e7fea263dac65061941a4cee25c7a84c4e50c8bf.
2014-12-10 19:07:27 +11:00
Sebastian McKenzie
841ab6802f Make semicolon optional in do-while in >=ES6 2014-12-10 18:59:24 +11:00
Sebastian McKenzie
03891a7f8c Merge branch 'do-optional-semicolon' of https://github.com/sebmck/acorn 2014-12-10 15:24:44 +11:00
Sebastian McKenzie
7dbddd566c Merge branch 'master' of https://github.com/marijnh/acorn
Conflicts:
	acorn.js
2014-12-10 15:24:36 +11:00
Sebastian McKenzie
876eed9c04 Add dot question token 2014-12-10 15:21:19 +11:00
Sebastian McKenzie
49119b7714 Make semicolon optional in do-while 2014-12-10 15:19:45 +11:00
Marijn Haverbeke
e252acbe67 Upgrade jQuery used as test input
Closes #175
2014-12-09 15:36:50 +01:00
Ingvar Stepanyan
96bc831306 Fix #173. 2014-12-07 19:55:31 +02:00
Sebastian McKenzie
404058f9da Add object memo getters, this expressions and improve tenary syntax in playground 2014-12-06 20:43:32 +11:00
Sebastian McKenzie
ac197399bb Add @ token 2014-12-05 14:46:56 +11:00
Sebastian McKenzie
7a0fb32064 Add playground conditionals check 2014-12-05 14:46:51 +11:00
Marijn Haverbeke
e98176d5e9 Fix bug in update_authors.sh 2014-12-04 21:48:10 +01:00
Sebastian McKenzie
0bf7938142 Merge branch 'master' of https://github.com/RReverser/acorn-jsx
Conflicts:
	acorn.js
	package.json
2014-11-30 11:09:25 +11:00
Ingvar Stepanyan
879d40989a Fix #9 by removing invalid logic introduced with #1. 2014-11-28 16:51:50 +02:00
Sebastian McKenzie
d14f446177 rename PretzelMap to BindFunctionExpression 2014-11-26 17:23:11 +11:00
Sebastian McKenzie
2ec2a4b5af add pretzel maps 2014-11-26 16:16:47 +11:00
Sebastian McKenzie
9e204a7fee add playground 2014-11-25 23:48:48 +11:00
Ingvar Stepanyan
33d5082043 Parse import Thing ... in the same way as import {default as Thing} ....
Adjusts with Reflect.parse output and simplifies handling of "default" case
in external tools by providing regular named ImportSpecifier.
2014-11-23 14:06:13 +02:00
Sebastian McKenzie
f9c642e2c5 add support for ES7 exponentiation operator 2014-11-23 22:56:24 +11:00
Sebastian McKenzie
f8ee0c3066 bump version 2014-11-23 21:45:56 +11:00
Sebastian McKenzie
25c45a1e8e add support for es7 object/spread and move acorn-6to5 tests to a separate file 2014-11-23 21:00:15 +11:00
Sebastian McKenzie
9b38a4826b add support for abstract references 2014-11-23 17:43:46 +11:00
Sebastian McKenzie
6b4f40f556 Merge branch 'master' of https://github.com/RReverser/acorn-jsx
Conflicts:
	package.json
2014-11-23 11:30:14 +11:00
Ingvar Stepanyan
7a3683de2b Fix space not being skipped after object literal inside expression container.
Fixes #7.
2014-11-22 11:51:28 +02:00
Sebastian McKenzie
f3f49cee80 Fix #5 regression text 2014-11-20 21:38:16 +11:00
Sebastian McKenzie
16b298f38c 0.9.1-3 2014-11-20 21:26:45 +11:00
Sebastian McKenzie
5ad85c5612 Merge https://github.com/RReverser/acorn-jsx
Conflicts:
	package.json
	test/run.js
2014-11-20 21:26:40 +11:00
Sebastian McKenzie
b3ddc683a4 0.9.1-2 2014-11-20 21:25:43 +11:00
Ingvar Stepanyan
731984ebc7 Update version. 2014-11-20 12:23:49 +02:00
Ingvar Stepanyan
29c028acf9 Temporarily disable JSX parser. 2014-11-20 12:22:53 +02:00
Ingvar Stepanyan
46c95f5aee Merge pull request #6 from sebmck/patch-1
Fix spread attributes within elements inside expression containers.
2014-11-20 12:22:15 +02:00
Sebastian McKenzie
20a5d62ac6 Add regression test for #5 2014-11-20 21:07:03 +11:00
Sebastian McKenzie
d3e987896c Fix spread attributes within elements inside expression containers 2014-11-20 19:46:47 +11:00
Ingvar Stepanyan
51bc64a558 Update tests for #158 2014-11-19 20:23:38 +01:00
Ingvar Stepanyan
ba73b0e17e Disallow parenthesis in patterns
Fixes #155
2014-11-19 20:23:37 +01:00
Ingvar Stepanyan
4496ca411a Fixed import declaration for default+batch case.
Also removed deprecated `kind` property.
Fixes #161.
2014-11-19 14:05:34 +01:00
Sebastian McKenzie
5e119c22d6 Revert "Better async/await support"
This reverts commit 89437cfd7f8bb380490fb574fd91a128a120f5b4.
2014-11-19 13:20:59 +11:00
Sebastian McKenzie
f35dad0980 Revert "fix up async/await"
This reverts commit f18f264a330258da521027cc4edd5852e26f8add.
2014-11-19 13:20:47 +11:00
Sebastian McKenzie
b0bf126c22 fix up async/await 2014-11-19 12:49:41 +11:00
Sebastian McKenzie
d09acb7d3b disable loose test runner 2014-11-19 12:49:33 +11:00
Sebastian McKenzie
7393455b2e Merge pull request #2 from Naddiseo/async_await
Better async/await support
2014-11-19 12:00:10 +11:00
Richard Eames
68acfb7cc5 Better async/await support 2014-11-18 13:08:24 -07:00
Sebastian McKenzie
61810eef8d Merge https://github.com/RReverser/acorn-jsx
Conflicts:
	acorn.js
	package.json
2014-11-15 11:34:27 +11:00
Ingvar Stepanyan
82f88c459d Fix ignored whitespaces before children elements.
Similar to 790afe (template literals).
Fixes #4.
2014-11-15 02:30:12 +02:00
Ingvar Stepanyan
8ef9ecc34d Update version. 2014-11-13 19:25:25 +02:00
Ingvar Stepanyan
42d21f5064 Merge branch 'upstream' into jsx
Conflicts:
	acorn.js
	test/run.js
2014-11-13 19:25:00 +02:00
Sebastian McKenzie
b3c4ca26fa Merge branch 'async-await' of https://github.com/sebmck/acorn 2014-11-13 13:17:10 +11:00
Sebastian McKenzie
2506be7b1a Add support for exporting async functions 2014-11-13 13:16:49 +11:00
Sebastian McKenzie
e58be3b8bb Merge branch 'master' of https://github.com/marijnh/acorn
Conflicts:
	acorn.js
	test/run.js
2014-11-13 12:48:14 +11:00
Rich Harris
f48a921e24 allow export { default } from "foo" 2014-11-12 17:42:55 +01:00
Marijn Haverbeke
98691e5b80 Properly initialize top node start position 2014-11-12 17:31:45 +01:00
Marijn Haverbeke
249e6961f8 Make tests pass for loose parser
Define Program node extent to be the whole program, make
both parser and the tests conform to this.

Fix a bunch of bugs in the loose parser's handling of corner
cases.

Issue #151
2014-11-12 17:05:19 +01:00
Ingvar Stepanyan
bc64d3c5f4 Add support for nested groups in log (Chrome console + browser). 2014-11-12 16:19:16 +01:00
Ingvar Stepanyan
96ccdb05fa Web-driver support for loose parser + small fixes.
* Added support for acorn_loose and grouped log to web-driver.
* Removed unused copy-pasted `parseTemplate` from loose parser.
* Throw non-SyntaxError errors immediately (as those are generic).
2014-11-12 16:19:16 +01:00
Ingvar Stepanyan
6bf8311061 Loose: fix #33. 2014-11-12 16:19:16 +01:00
Ingvar Stepanyan
2419de74dc Loose: Fix regex after tokenizer changes in #144. 2014-11-12 16:19:16 +01:00
Ingvar Stepanyan
fc2e96fa01 Loose: respect optional semicolons in break/continue/class/import/export. 2014-11-12 16:19:16 +01:00
Ingvar Stepanyan
d4565fed53 Loose: ES6 import, export.
Removed "kind" from tests for ES6 import/export as it's
left only for backward compatibility.
2014-11-12 16:19:15 +01:00
Ingvar Stepanyan
4647f966eb Loose: don't silently skip missed elements in expr list. 2014-11-12 16:19:15 +01:00
Ingvar Stepanyan
aa96edf769 Loose: support for-of without var. 2014-11-12 16:19:15 +01:00
Ingvar Stepanyan
1589a959fa Loose: yield support. 2014-11-12 16:19:15 +01:00
Ingvar Stepanyan
80f8d527ff Loose: Skip ES7 tests as we are targeting ES6 now. 2014-11-12 16:19:15 +01:00
Ingvar Stepanyan
bdce88c184 Loose: for-of statement. 2014-11-12 16:19:15 +01:00
Ingvar Stepanyan
992fc0503d Loose: arrow functions. 2014-11-12 16:19:15 +01:00
Ingvar Stepanyan
ede10a079c Loose: class support. 2014-11-12 16:19:15 +01:00
Ingvar Stepanyan
c6b6ef389e Loose: Remove own tabSize initialization in favor of defaultOptions. 2014-11-12 16:19:15 +01:00
Ingvar Stepanyan
9cdc6809ce Loose: fix pattern+defaults case in function params. 2014-11-12 16:19:15 +01:00
Ingvar Stepanyan
b46b53e149 Loose: implement object methods; expose processed options from acorn. 2014-11-12 16:19:15 +01:00
Ingvar Stepanyan
143066184c Emit full stack trace for unknown exceptions. 2014-11-12 16:19:15 +01:00
Ingvar Stepanyan
dda90580df Loose: Added support for shorthand properties. 2014-11-12 16:19:15 +01:00
Ingvar Stepanyan
963a26e46f Loose: Added support for let and const.
Fixes #146.
2014-11-12 16:19:15 +01:00
Ingvar Stepanyan
4879af22d1 Loose: Added support for assignment patterns to expression and variables. 2014-11-12 16:19:15 +01:00
Ingvar Stepanyan
c5145cedb2 Fix no-options case for acorn. 2014-11-12 16:19:14 +01:00
Ingvar Stepanyan
eba8a5646c Loose: added support for holes in arrays (but disallows trailing comma). 2014-11-12 16:19:14 +01:00
Ingvar Stepanyan
a14a5c8192 Loose: Added support for rest parameters.
Includes correction of mistype ".." vs "...".
2014-11-12 16:19:14 +01:00
Ingvar Stepanyan
b47696eecf Avoid UnaryExpression-specific properties in SpreadElement (just in case). 2014-11-12 16:19:14 +01:00
Ingvar Stepanyan
72df78cc88 Avoid separate handling of SpreadElement in favor of UnaryExpression parser. 2014-11-12 16:19:14 +01:00
Ingvar Stepanyan
ac8bdc608d Allow specifying expected comments/tokens arrays with onComment/onToken.
Allows to avoid both custom `testAssert` and adding extra arguments in `test`.
2014-11-12 16:19:14 +01:00
Ingvar Stepanyan
6d64834352 Removed manual onComment test in favor of new argument. 2014-11-12 16:19:14 +01:00
Ingvar Stepanyan
0abe4b64a8 Collect test stats separately for each mode. 2014-11-12 16:19:14 +01:00
Ingvar Stepanyan
b7367a2a8c Make setOptions non-destructive for original object. 2014-11-12 16:19:14 +01:00
Ingvar Stepanyan
11ecb20e9e Loose: ES6 function params support. 2014-11-12 16:19:14 +01:00
Ingvar Stepanyan
c26fd33826 Clone test options object since calling parse is destructive for it. 2014-11-12 16:19:14 +01:00
Ingvar Stepanyan
61d2067b2b Loose: Added ParenthesizedExpression. 2014-11-12 16:19:13 +01:00
Ingvar Stepanyan
7db211d56a Added loose parser support to test runner (currently failing for 208/1680). 2014-11-12 16:19:13 +01:00
Ingvar Stepanyan
d424874cf8 Editorconfig: enforce Unix line endings and extra new line in the end of file. 2014-11-12 16:19:13 +01:00
Ingvar Stepanyan
86f8c56d2b Added .editorconfig. 2014-11-12 16:19:13 +01:00
Ingvar Stepanyan
074db16fb7 Indentation fix. 2014-11-12 16:19:13 +01:00
Ingvar Stepanyan
d745bd7e32 Make test runner more generic. 2014-11-12 16:19:13 +01:00
Sebastian McKenzie
c5ca7ee32c Add remaining esprima-fb async/await tests 2014-11-12 20:41:55 +11:00
Sebastian McKenzie
81f3b99251 Merge branch 'async-await' of https://github.com/sebmck/acorn
Conflicts:
	acorn.js
2014-11-11 09:46:46 +11:00
Sebastian McKenzie
273dda04f1 Revert "Merge branch 'async-await' of https://github.com/sebmck/acorn"
This reverts commit 904d46ae736214d50da3a5c2b616204f0e0ae7d1, reversing
changes made to 49e421660af161af0e75c2fa066ea356d6650e69.
2014-11-11 09:43:15 +11:00
Sebastian McKenzie
211b3a6fdf Implement ES7 Async/Await 2014-11-11 09:29:56 +11:00
Sebastian McKenzie
ea1119c72c Merge branch 'patch-1' of https://github.com/RReverser/acorn 2014-11-11 09:20:05 +11:00
Sebastian McKenzie
59990722e4 Merge branch 'async-await' of https://github.com/sebmck/acorn
Conflicts:
	acorn.js
2014-11-11 09:18:57 +11:00
Sebastian McKenzie
ac42c108f4 Implement ES7 Async/Await 2014-11-11 09:13:42 +11:00
Ingvar Stepanyan
1f1a476930 Update tests for #158 2014-11-09 16:02:12 +02:00
Sebastian McKenzie
9f8ab713de Merge branch 'patch-1' of https://github.com/RReverser/acorn 2014-11-10 00:11:46 +11:00
Sebastian McKenzie
97c06f2699 Revert "Merge branch 'check-lval-paren-expressions' of https://github.com/sebmck/acorn"
This reverts commit c8d701914832367e3cc6f570f8da9e6096d26eef, reversing
changes made to 0f40710d6a6c846d613764f314e9fb38c247e471.
2014-11-10 00:10:54 +11:00
Ingvar Stepanyan
d231f10c36 Disallow parenthesis in patterns
Fixes #155
2014-11-09 15:08:59 +02:00
Sebastian McKenzie
41f7959d9c fix package.json identation 2014-11-09 16:11:16 +11:00
Sebastian McKenzie
fc046bab54 remove build status from readme 2014-11-09 16:09:22 +11:00
Sebastian McKenzie
c90022e97f fix sebmck@gmail.com email 2014-11-09 16:09:16 +11:00
Sebastian McKenzie
39e0b51d17 Merge branch 'check-lval-paren-expressions' of https://github.com/sebmck/acorn 2014-11-09 13:07:41 +11:00
Sebastian McKenzie
521ab6c11d Support ParanthesizedExpressions in checkLval 2014-11-09 13:07:00 +11:00
Sebastian McKenzie
a18f3d1003 Add support for computed static mutator class methods 2014-11-04 11:08:36 +01:00
Sebastian McKenzie
f82896a919 Merge branch 'computed-static-mutator-class-methods' of https://github.com/sebmck/acorn 2014-11-04 11:41:49 +11:00
Sebastian McKenzie
4f0c37eb68 Add support for computed static mutator class methods 2014-11-04 11:40:49 +11:00
Sebastian McKenzie
7f57741824 fix options.strictMode reference 2014-11-03 22:39:26 +11:00
Sebastian McKenzie
16063dd8b3 add strictMode option 2014-11-02 14:18:40 +11:00
Sebastian McKenzie
21900ae2b0 add acorn-jsx shoutout to readme 2014-11-01 23:18:01 +11:00
Sebastian McKenzie
d6771b1cef update package.json 2014-11-01 23:17:32 +11:00
Sebastian McKenzie
62670e74cb remove readme 2014-11-01 23:17:25 +11:00
Sebastian McKenzie
71832ee45d Merge branch 'master' of https://github.com/marijnh/acorn 2014-10-29 21:02:48 +11:00
Sebastian McKenzie
fb0fb90911 Merge branch 'fix-semicolons-modules' of https://github.com/sebmck/acorn
Conflicts:
	acorn.js
2014-10-29 21:02:26 +11:00
Sebastian McKenzie
9d3580b23a make ImportDeclaration and ExportDeclaration semicolons more spec-compliant 2014-10-29 10:46:39 +01:00
Sebastian McKenzie
1be5b3c823 make ImportDeclaration and ExportDeclaration semicolons more spec-compliant 2014-10-29 20:35:37 +11:00
Marijn Haverbeke
8a799c6077 Remove redundant range info from tests 2014-10-27 10:59:16 +01:00
Ingvar Stepanyan
f26b656ea5 Remove property name clash check in ES6 as per Draft Rev 26.
See https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-06/jun-6.md#conclusionresolution-3 for details.

Conflicts:
	test/tests-harmony.js
2014-10-27 10:56:06 +01:00
Marijn Haverbeke
5d1db2e993 Only apply kludge from f48503cd31 when unicode regexps are not supported 2014-10-27 10:54:46 +01:00
Sebastian McKenzie
f48503cd31 add unicode flag support to regex 2014-10-27 10:51:23 +01:00
Ingvar Stepanyan
fd79ac5879 Move comprehension support under ecmaVersion: 7 as per spec. 2014-10-27 10:34:53 +01:00
Sebastian McKenzie
0cc9322bca Merge branch 'add-unicode-regex-support' of https://github.com/sebmck/acorn
Conflicts:
	acorn.js
2014-10-25 12:52:21 +11:00
Sebastian McKenzie
6eeb101185 add regex tests 2014-10-25 09:02:34 +11:00
Sebastian McKenzie
397d87fd11 add additional regex property to regex literals containing pattern and flags 2014-10-25 09:02:24 +11:00
Ingvar Stepanyan
156fee8b4d Update version. 2014-10-22 14:09:05 +03:00
Ingvar Stepanyan
d27a568002 Merge pull request #3 from sebmck/master
Merge with latest acorn.
2014-10-22 14:07:03 +03:00
Sebastian McKenzie
7a4715c2de Merge branch 'master' of https://github.com/marijnh/acorn
Conflicts:
	acorn.js
	package.json
2014-10-22 21:30:58 +11:00
Marijn Haverbeke
5ff7e59a0a Remove bogus support for \U escapes
Issue #147
2014-10-21 16:39:48 +02:00
Marijn Haverbeke
437ce2d9be [loose parser] Ignore shebang lines
Closes marijnh/tern#408
2014-10-21 12:35:06 +02:00
Mike Rennie
ad69446c0a Make parse_dammit honour the 'ranges' option
Closes #140
2014-10-21 12:14:18 +02:00
Marijn Haverbeke
51e0b81eea Note lack of es6 support in parse_dammit in the README 2014-10-21 10:24:57 +02:00
Sebastian McKenzie
0258dafa8a add unicode flag support to regex 2014-10-19 18:01:34 +11:00
Max Schaefer
d525c45644 Add option for representing parenthesized expressions in the AST. 2014-10-13 12:19:39 +02:00
Max Schaefer
e9c7209f8b Guard against missing elements in array patterns when checking function parameters. 2014-10-13 12:17:29 +02:00
Marijn Haverbeke
bdee9e8195 Make locations in loose parser consistent with those in regular parser
Issue #136
2014-10-08 12:35:57 +02:00
Marijn Haverbeke
3603f7d0b1 Adjust start positions of parenthesized expressions to not include parentheses
Issue #136
2014-10-08 11:52:49 +02:00
Marijn Haverbeke
1c9e0a9272 Bump version number post 0.9 2014-10-01 23:21:56 +02:00
Marijn Haverbeke
01a89cfec1 Mark release 0.9.0 2014-10-01 23:21:25 +02:00
r-e-d
f3e759cd03 Strict mode incorrectly reset after function 2014-09-30 11:45:20 +02:00
Max Schaefer
015a0e90bc Only accept for-of loops in ECMA6 mode. 2014-09-29 11:27:14 +02:00
Ingvar Stepanyan
daedc6fcb3 Fixes #129 and spaces in template quasi literals.
* Added hack to correctly handle skipped spaces after= template expressions.
* Added `null` default values for regular functions.
* Added regression tests for both.
2014-09-26 17:04:22 +02:00
Ingvar Stepanyan
203384f7c2 Fixes marijnh/acorn#127. 2014-09-23 22:58:44 +02:00
Marijn Haverbeke
6ea4139be1 Add note about deprecated scopeVisitor object
See issue #126
2014-09-22 17:08:50 +02:00
Marijn Haverbeke
49680b1c60 [loose parser] Take brace-line indentation into account for objlit closing heuristic 2014-09-22 15:15:12 +02:00
Marijn Haverbeke
39fa62e90f [loose parser] Be slightly more agressive about heuristically closing object literals 2014-09-22 15:03:54 +02:00
Marijn Haverbeke
12cbfed34f [loose parser] Don't omit unfinished object literal properties 2014-09-22 14:46:41 +02:00
Ingvar Stepanyan
96024e6950 Updated docs. 2014-09-17 20:55:59 +03:00
Ingvar Stepanyan
9c17926e3f Version update.
Simplified shouldSkipSpace condition, fixed indentation.
2014-09-17 20:54:41 +03:00
Ingvar Stepanyan
4b4c63f924 Merge pull request #1 from NekR/master
Fix in child XJS MemberExpression.
2014-09-17 20:42:02 +03:00
Marijn Haverbeke
d0497ab212 Add parseExpressionAt function to the API 2014-09-15 21:03:07 +02:00
Marijn Haverbeke
ac31b0314c Bump version number post-0.8 2014-09-12 16:57:40 +02:00
Marijn Haverbeke
456f74e34f Mark version 0.8.0 2014-09-12 16:57:17 +02:00
Marijn Haverbeke
d98a432673 Really remove html from git repository
(The hook was still in place last time.)
2014-09-12 16:55:42 +02:00
Marijn Haverbeke
0322beb0aa Add a prepublish step to package.json 2014-09-12 16:54:28 +02:00
Marijn Haverbeke
4d4daa07e0 Don't keep the docco output in the repository anymore 2014-09-12 15:50:34 +02:00
Marijn Haverbeke
91911bcfcd Add bin/without_eval utility 2014-09-12 14:08:31 +02:00
Arthur Stolyar
78a6caf673 Add test for inXJSChild MemberExpression 2014-09-09 02:12:39 +03:00
Arthur Stolyar
d3cece14fd Fix spaceSkip after inXJSChildExpression 2014-09-09 01:56:30 +03:00
Arthur Stolyar
ae9fae6c76 Fix in child XJS MemberExpression 2014-09-09 01:06:52 +03:00
Ingvar Stepanyan
533d1d62ec Updated docs. 2014-09-09 00:06:06 +03:00
Ingvar Stepanyan
fe805f396e Update version. 2014-09-08 23:58:44 +03:00
Ingvar Stepanyan
3086621905 Merge branch 'master' into jsx. 2014-09-08 23:58:19 +03:00
Ingvar Stepanyan
10553cbced Make token format compatible with Esprima and Mozilla-styled locations.
* Tokens are now instances of single exported constructor Token.
* Token objects are compatible with Esprima (only `type` format is different).
* Added token.loc in format of node.loc (Mozilla).
* Deprecated token.startLoc & token.endLoc.
* Updated comment generation example.

Also added ability to pass arrays in `onToken`/`onComment` where
tokens/comments will be collected in Esprima's format so you can
simply pass those arrays to `escodegen.attachComments`.

Updated docs and comment attachment example.
2014-09-08 12:20:08 +02:00
Ingvar Stepanyan
5c89414c5a Final polishing after rebase. 2014-09-05 17:23:03 +03:00
Ingvar Stepanyan
2fbf640e60 Update README.md 2014-09-05 17:15:29 +03:00
Ingvar Stepanyan
35c8f104bd Spread attribute support and small optimizations.
Conflicts:
	acorn.js
	docs/acorn.html
	package.json
	test/tests.js
2014-09-05 17:01:42 +03:00
Max Schaefer
a246bf83d0 Do not throw syntax error if strict mode function has same name as one of its parameters. 2014-09-05 15:59:57 +02:00
Ingvar Stepanyan
fe6cafa141 Upgrade esprima to esprima-fb and update docs.
Conflicts:
	test/compare/esprima.js
2014-09-05 16:54:56 +03:00
Ingvar Stepanyan
817120b370 Small test refactoring. 2014-09-05 16:54:29 +03:00
Ingvar Stepanyan
95a1231c6d Metadata & docs updates.
Conflicts:
	.gitignore
	README.md
	acorn.js
	index.html
	package.json
2014-09-05 16:54:29 +03:00
Max Schaefer
7da3b6f1fd Fix start position for HTML comments and add tests. 2014-09-05 15:53:36 +02:00
Ingvar Stepanyan
daf9e82ab5 Final fixes for spaces.
Conflicts:
	acorn.js
2014-09-05 16:50:23 +03:00
Ingvar Stepanyan
7560ba4c94 Fixed in-tag spaces in hacky way (to be refactored).
Conflicts:
	acorn.js
2014-09-05 16:49:07 +03:00
Ingvar Stepanyan
292942c1d8 Small refactoring related to handling XJSText.
Conflicts:
	acorn.js
2014-09-05 16:48:50 +03:00
Ingvar Stepanyan
4ed5087bea Revert space counting after the opening tag in favor of better fix since this one introduces extra parsing error.
Conflicts:
	acorn.js
2014-09-05 16:48:40 +03:00
Ingvar Stepanyan
77e05c4edc Fixed XJSEmptyExpression location tracking. 2014-09-05 16:47:57 +03:00
Ingvar Stepanyan
f53f89a0ae Fixed test with parenthesis. 2014-09-05 16:47:57 +03:00
Ingvar Stepanyan
3253f56602 Fixed skipping spaces at the beginning of JSX contents.
Conflicts:
	acorn.js
2014-09-05 16:47:57 +03:00
Ingvar Stepanyan
2c3740c159 Fixed nesting elements in attributes. 2014-09-05 16:43:17 +03:00
Ingvar Stepanyan
5d2ace2f58 Added JSX text and string literal parsing. 2014-09-05 16:43:17 +03:00
Ingvar Stepanyan
22e8f7b90e Added basic attribute and element nesting support. 2014-09-05 16:43:16 +03:00
Ingvar Stepanyan
6091a0cf55 Added JSX-specific identifier parsing.
Conflicts:
	acorn.js
2014-09-05 16:43:16 +03:00
Ingvar Stepanyan
b4c5d1f2e9 Added support for namespaces and member expressions in tag names. 2014-09-05 16:42:29 +03:00
Ingvar Stepanyan
283d47c038 Started porting JSX support from esprima-fb.
Conflicts:
	acorn.js
	test/tests.js
2014-09-05 16:42:29 +03:00
Marijn Haverbeke
6c854ad221 [loose parser] Be more careful about calling resetTo
It will try to eat whitespace, and can thus raise an unterminated comment exception

Issue #375
2014-09-05 15:31:15 +02:00
Marijn Haverbeke
40f1c67161 Remove trailing whitespace from acorn.js 2014-08-21 18:12:04 +02:00
Max Schaefer
1ca2115294 Remove unused local variables. 2014-08-21 18:10:48 +02:00
Marijn Haverbeke
e58f401b82 Bump version number post 0.7 2014-08-14 13:25:01 +02:00
Marijn Haverbeke
fe767e4cd8 Mark version 0.7.0 2014-08-14 13:24:24 +02:00
Marijn Haverbeke
69cadaa1e9 Add basic ES6 support in util/walk.js 2014-08-14 13:23:03 +02:00
Ingvar Stepanyan
372e1d42f3 Split ES6 Template logic from main functionality. 2014-08-14 12:48:50 +02:00
Marijn Haverbeke
d1a5db36cc Fix sentence broken by 11dc953bc6 2014-08-14 12:48:12 +02:00
Ingvar Stepanyan
11dc953bc6 Fix docs about sourceFile/directSourceFile. 2014-08-14 12:47:26 +02:00
Ingvar Stepanyan
ef045b9718 Remove copyToken from acorn_loose (not needed anymore). 2014-07-31 14:33:40 +03:00
Ingvar Stepanyan
1bf8c1420f Added example for comments attachment.
* Fixed `onToken` & `tokenize` to return `startLoc` & `endLoc`
in token object only when `options.locations` is `true`.
* Fixed `onToken` tests.
* Added example for generating comments with escodegen.
2014-07-31 14:01:39 +03:00
Ingvar Stepanyan
be11e04383 Added onToken support. 2014-07-31 14:01:39 +03:00
Ingvar Stepanyan
278ac258df Moved inTemplate initializer to appropriate place. 2014-07-31 14:01:38 +03:00
Marijn Haverbeke
73a890d6be More nuanced attribution in comment 2014-07-29 15:18:59 +02:00
Marijn Haverbeke
292f8ece64 Re-run update_authors.sh to get proper project name in AUTHORS 2014-07-29 15:14:02 +02:00
Marijn Haverbeke
aac1807838 Include Harmony tests in test/index.html 2014-07-29 14:43:20 +02:00
Ingvar Stepanyan
3393460ebb Fix Travis URL for future merge. 2014-07-29 14:41:50 +02:00
Ingvar Stepanyan
de48f8434d Fixes for ES3 compatibility. 2014-07-29 14:41:50 +02:00
Ingvar Stepanyan
f0579c3e56 Renamed _multiplyModulo to _modulo as it's left as the only purpose of this token. 2014-07-29 14:41:50 +02:00
Ingvar Stepanyan
4663f6ae95 Update README.md 2014-07-29 14:41:49 +02:00
Ingvar Stepanyan
ff9c3550a4 Allow computed class method names (as per ariya/esprima#271). 2014-07-29 14:41:49 +02:00
Ingvar Stepanyan
acbef8557f Treat line ending after yield keyword as end of YieldExpression
(as per http://people.mozilla.org/~jorendorff/es6-draft.html#sec-generator-function-definitions-runtime-semantics-evaluation).
2014-07-29 14:41:45 +02:00
Ingvar Stepanyan
9d552efe45 Added Generator Comprehension support. 2014-07-29 14:41:44 +02:00
Ingvar Stepanyan
1c548e7848 Add missing Traceur source to repo. 2014-07-29 14:41:44 +02:00
Ingvar Stepanyan
e9635f450e Delete harmonytest.js 2014-07-29 14:41:44 +02:00
Ingvar Stepanyan
afefac56bf Added test to represent "import x, { ... } from 'module'" case. 2014-07-29 14:41:44 +02:00
Ingvar Stepanyan
9d5e0e7973 Increased benchmark time to 5 seconds per parser to get more realistic numbers. 2014-07-29 14:41:44 +02:00
Ingvar Stepanyan
711d21ec5a Simplified name clash test. 2014-07-29 14:41:44 +02:00
Ingvar Stepanyan
8d30ad6196 Added separate token for star ('*') as it may have special meaning.
Fixed name clash check.
Moved check functions to single place.
2014-07-29 14:41:38 +02:00
Ingvar Stepanyan
8b19246615 Replaced UglifyJS2 with Traceur for fair comparison of ES6-enabled parsers. 2014-07-29 14:41:38 +02:00
Ingvar Stepanyan
7aab3539ce Cleaning up + performance improvement by using hash objects for name clash checks. 2014-07-29 14:41:38 +02:00
Ingvar Stepanyan
67615ffd41 Simplified newline check in strings. 2014-07-29 14:41:38 +02:00
Ingvar Stepanyan
1955e94925 Removed keywords that are not actual keywords
as per https://people.mozilla.org/~jorendorff/es6-draft.html#sec-keywords in favor of "magic" identifiers.
2014-07-29 14:41:33 +02:00
Ingvar Stepanyan
82b9f30fc9 Allow some keywords to be treated as identifier names; update ecmaVersion in benchmark. 2014-07-29 14:41:32 +02:00
Ingvar Stepanyan
eb7ccea743 Stricter tokVal -> tokType comparisons. 2014-07-29 14:41:32 +02:00
Ingvar Stepanyan
a061f1f0a6 Updated README and bin utility to be aware of ES6 support. 2014-07-29 14:41:32 +02:00
Ingvar Stepanyan
3ee9e288a2 Forbid spread element in sequence expressions. 2014-07-29 14:41:32 +02:00
Ingvar Stepanyan
8f96965d36 Added yield support (completed generators). 2014-07-29 14:41:32 +02:00
Ingvar Stepanyan
b8a3300a21 Added function * support (part of generators feature). 2014-07-29 14:41:32 +02:00
Ingvar Stepanyan
4f24e13fd5 Added template string support. 2014-07-29 14:41:32 +02:00
Ingvar Stepanyan
a8cf37fc46 Test fixes for imports. 2014-07-29 14:41:32 +02:00
Ingvar Stepanyan
26818e1f36 Removed module-related tests and implemented corresponding alternatives support.
`module ModuleName { ... }` was removed from spec in favor of separate files.
`module LocalName from '...'` is being replaced with `import * as LocalName from '...'` as per http://jsmodules.io/ and https://twitter.com/domenic/status/492735387140243456 (c) @domenic.
2014-07-29 14:41:29 +02:00
Ingvar Stepanyan
b38c15a94b Added export declaration support.
See http://people.mozilla.org/~jorendorff/es6-draft.html#sec-exports, ariya/esprima#216, square/es6-module-transpiler#63 for latest decisions on `export default 42` vs `export default = 42` (first wins, so returning AST as it was in older Esprima Harmony and used by https://github.com/square/es6-module-transpiler/).
2014-07-29 14:41:24 +02:00
Ingvar Stepanyan
f2dfeff977 Added test for BindingPattern inside ArrayComprehension
(fails in esprima - https://code.google.com/p/esprima/issues/detail?id=570).
2014-07-29 14:41:18 +02:00
Ingvar Stepanyan
bcc97e2d52 Array Comprehensions as per latest ES6 drafts. 2014-07-29 14:41:18 +02:00
Ingvar Stepanyan
dd37866fdb Added backward-compatible test that object properties have type of "Property".
(Better fix for Constellation/estraverse#4, Constellation/escodegen#80 and similar bugs)
2014-07-29 14:41:10 +02:00
Ingvar Stepanyan
648f3159cc Added for (..of..) support and guard against for (let var=.. in|of ..) loops. 2014-07-29 14:41:09 +02:00
Ingvar Stepanyan
8b0be7cec9 Improved destruction assignment guards. 2014-07-29 14:41:09 +02:00
Ingvar Stepanyan
0f56e32512 Object shorthand properties; small fixes to ES6 function parameters. 2014-07-29 14:41:09 +02:00
Ingvar Stepanyan
50a82135c4 Recursive destructuring assignment with function arguments name clash checks. 2014-07-29 14:41:09 +02:00
Ingvar Stepanyan
66e6bcd10f Assignable patterns. 2014-07-29 14:41:09 +02:00
Ingvar Stepanyan
9b697af803 Destructuring assignments. 2014-07-29 14:41:09 +02:00
Ingvar Stepanyan
5ab6837208 Workaround for joyent/node#3584. 2014-07-29 14:41:09 +02:00
Ingvar Stepanyan
7c34bb34ce Exit should wait for stdout (joyent/node#1669). 2014-07-29 14:41:09 +02:00
Ingvar Stepanyan
3779ed41a4 Added exit code 1 for failed test session. 2014-07-29 14:41:09 +02:00
Ingvar Stepanyan
f7fe322490 Better parentheses check for arrow expression argument list. 2014-07-29 14:41:09 +02:00
Ingvar Stepanyan
1f801001cf ArrowExpression rest parameter support, brackets check and test fixes. 2014-07-29 14:41:09 +02:00
Ingvar Stepanyan
5d50be1447 Removed dirty hack in favor of fixed expected locations for arrow and method functions (node's location should include arguments). 2014-07-29 14:41:09 +02:00
Ingvar Stepanyan
19696af666 Added computed properties support. 2014-07-29 14:41:09 +02:00
Ingvar Stepanyan
1d3810dcdb Turned on Travis CI. 2014-07-29 14:41:09 +02:00
Ingvar Stepanyan
44a4f8c016 Added ES6 classes support. 2014-07-29 14:41:09 +02:00
Ingvar Stepanyan
eadda16c42 Added SpreadElement support.
testFail message fixes for object methods.
2014-07-29 14:41:09 +02:00
Ingvar Stepanyan
67bca2d549 Added object method support. 2014-07-29 14:41:09 +02:00
Ingvar Stepanyan
48f6ea8e63 Force LF endings in code. 2014-07-29 14:41:08 +02:00
Ingvar Stepanyan
a5cf393134 Fixed testFail messages for character escape sequences. 2014-07-29 14:41:08 +02:00
Ingvar Stepanyan
2db14fbb08 Checking argument names clash in strict mode for arrow functions.
Some more testFail message fixes.
2014-07-29 14:41:08 +02:00
Ingvar Stepanyan
47c4196d41 Some testFail message fixes. 2014-07-29 14:41:08 +02:00
Ingvar Stepanyan
16b9ba5db0 Fixed parsing x => 1, 2 like expressions. 2014-07-29 14:41:08 +02:00
Ingvar Stepanyan
757545a612 Basic ES6 Arrow Expressions support.
Added Property type to ObjectExpression properties.
Reserved ES6 properties in Property type.
2014-07-29 14:41:08 +02:00
Ingvar Stepanyan
12ac95732d Added ES6-specific Function properties. 2014-07-29 14:41:08 +02:00
Ingvar Stepanyan
839338b270 Added octal and binary number support; added ES6 version checks. 2014-07-29 14:41:08 +02:00
Ingvar Stepanyan
a31bad6773 ES6 Unicode Code Point Escape Sequence support. 2014-07-29 14:41:08 +02:00
Ingvar Stepanyan
47587e6e9b Turned on location tracking for harmony tests. 2014-07-29 14:41:08 +02:00
Ingvar Stepanyan
88e355a6ae Converted esprima's harmony tests. 2014-07-29 14:41:08 +02:00
Ingvar Stepanyan
937350dd84 Updated esprima and added harmonytest.js from ariya/esprima@2bb17ef9a4. 2014-07-29 14:41:08 +02:00
Marijn Haverbeke
7ac7d8fa5e Add an AUTHORS list 2014-07-29 14:33:33 +02:00
Marijn Haverbeke
14bd14088a Remove bogus copy-pasted chunk from LICENSE 2014-07-29 12:37:36 +02:00
Johannes Herr
3d35d067a8 Removed some dead code in parseThrowStatement 2014-07-24 15:51:00 +02:00
Marijn Haverbeke
3d444e8eca Update docco output for df9eda514a 2014-07-15 18:35:09 +02:00
Mathias Bynens
df9eda514a Add a script that generates the regular expressions for identifiers 2014-07-15 18:33:01 +02:00
Marijn Haverbeke
caeaf37c31 Fix another bogus piece of code from 31e77b975e 2014-06-17 11:08:12 +02:00
Marijn Haverbeke
c1b2742ee7 Bump version number post 0.6 2014-06-06 22:42:22 +02:00
Marijn Haverbeke
4435013900 Mark version 0.6.0 2014-06-06 22:42:03 +02:00
impinball
29feccf3cd Split up parseStatement()
It was purely interpreted by the V8 engine. Splitting it up allows the
individual pieces to be optimized, so less is interpreted.
2014-06-06 12:40:32 +02:00
Marijn Haverbeke
55b507b715 Note partial es6 support in docs 2014-06-06 12:11:20 +02:00
Artem Govorov
1e5bfc2c55 ecma 6 partial support: let and const 2014-06-06 12:10:09 +02:00
Marijn Haverbeke
3a34f7ba8c Add note about browser compatibility to README
Closes #105
2014-06-04 22:51:05 +02:00
Marijn Haverbeke
7f0f07e1f9 Check duplicate argument names for rest params
Issue #79
2014-05-28 23:24:10 +02:00
PlNG
dccd45528a Minor: Remove unused argument from readToken_slash
Possible dev relic.

readToken_slash currently does not have any arguments and does not appear to look at arguments. All existing tests pass after removal of extraneous argument while calling readToken_slash.
2014-05-28 22:27:41 +02:00
Marijn Haverbeke
5dcd50447b Clean up previous patch
Issue #100
2014-05-15 10:38:28 +02:00
impinball
31e77b975e Add option: --
Had a few bugs in the initial patch request (#98) as well...

Also, fixed the help() command to print to stderr on nonzero exit statuses given.
2014-05-15 10:32:32 +02:00
Brandon Mills
5552e866f9 Support rest parameters
http://wiki.ecmascript.org/doku.php?id=harmony:rest_parameters
The final parameter to a function is a rest parameter if it is
prefixed by "...". FunctionExpression and FunctionDeclaration
nodes have a new "rest" property that is null if there is no
rest parameter, or contains an Identifer for the parameter.
https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API#Functions

Implemented by adding a new token, `_ellipsis`, which consists of
three dots. Modified the body of parseFunction to allow a single
rest parameter at the end of an argument list. Both the token and
the rest parameter require `options.ecmaVersion` >= 6, otherwise
three dots are tokenized as three dots.
2014-05-08 07:46:47 +02:00
Conrad Irwin
2de16b8cb0 [loose parser] Fix interpretation of f."
Before this the ast produced by parse_dammit crashed in the following
code, as Uglify correctly noticed that f."" is invalid.

    sample = 'f."';

    loose = require('acorn/acorn_loose');
    uglify = require('uglify-js');

    out = new uglify.OutputStream();
    ast = loose.parse_dammit(sample);
    ast = uglify.AST_Node.from_mozilla_ast(ast);
    ast.print(out);
    // TypeError: Cannot call method 'toString' of undefined
    // member_exp.computed = false && member_exp.property == ""

    console.log(out.toString());

After this the round-tripped AST looks like: `t.✖;"";`, which is
consistent with how `foo.{` is parsed.

I also considered making it parse as t[""], but as this only turns up in
the wild when people try to use multiline strings, I felt it was better
to be obviously wrong.
2014-04-17 23:03:18 +02:00
Charles Hughes
6f41a2215d Updates license year 2014-03-25 17:50:49 +01:00
Marijn Haverbeke
4869ccfa55 Prevent loose parser from tripping on invalid regexps
Issue #39
2014-03-25 17:45:58 +01:00
Marijn Haverbeke
93124c9eb8 Don't export Node from loose parser, reuse existing Node's proto
Issue #92
2014-03-25 17:31:03 +01:00
Marijn Haverbeke
e5439847fd Rename remaining *_t constructors to something sane 2014-03-25 17:29:17 +01:00
David Bonnet
7b9a46710d Renamed node_t to Node and exported it
This is to let programmers extend the Node object with utility methods
2014-03-25 17:23:30 +01:00
Marijn Haverbeke
e282ee4c01 Bump version number post-0.5 2014-03-12 17:32:17 +01:00
Marijn Haverbeke
a09455d2bf Mark version 0.5 2014-03-12 17:25:55 +01:00
Peter Rust
954ddac8b9 [walker] Supply ancestors to visitor functions 2014-02-28 17:53:39 +01:00
Marijn Haverbeke
5bd50cce6f Don't complain about reserved words in property name position
Also add forbidReserved: "everywhere" support.

Issue #85
2014-02-14 11:27:48 +01:00
Marijn Haverbeke
716ade22fb Add allowReturnOutsideFunction option
Issue #86
2014-02-14 09:55:05 +01:00
Marijn Haverbeke
d55b6dee4a Update lastEnd in tokenizer interface
The hack for parsing --> depends on it.

Closes #84
2014-01-17 10:09:15 +01:00
Marijn Haverbeke
d973261940 [loose parser] Make sure VariableDeclaration nodes have at least one decl
Closes marijnh/tern#255
2013-12-09 17:55:16 +01:00
Marijn Haverbeke
e6ff440e9f [walker] Handle catch scopes more accurately in scopeVisitor 2013-11-28 16:56:14 +01:00
Marijn Haverbeke
b1623b10c1 Note non-reentrancy of parser in onComment docs
Closes #80
2013-11-20 10:59:12 +01:00
Marijn Haverbeke
baaa16cee7 Make sure syntax errors in regular expressions raise conforming exceptions
Just letting the error from new RegExp through creates an exception missing the
pos/loc/raisedAt properties.

Issue #82
Issue #81
2013-11-20 10:56:28 +01:00
Marijn Haverbeke
dd456e3ad5 Fix bug causing comments after 'use strict' to be handled twice
Closes #76
2013-11-11 11:25:59 +01:00
Marijn Haverbeke
cb79f13d3d [README] Search/replace gone bad 2013-11-04 16:53:28 +01:00
Marijn Haverbeke
6be7a84649 Work around broken Markdown implementation on github
Not that I can blame anyone for making mistakes implementing a
poorly specified mess like markdown.
2013-11-04 16:52:34 +01:00
Marijn Haverbeke
5ec47cf80d Rewrite README 2013-11-04 16:43:07 +01:00
Aparajita Fishman
3b05fcf16c docco is wonderful, but it isn't exactly the most concise way of figuring out how to use acorn. Here's a real README.
Fixed a typo in the options comments.
2013-11-04 15:39:22 +01:00
Marijn Haverbeke
456f099cbe Bump version for added option 2013-10-15 13:12:07 +02:00
Marijn Haverbeke
356e0be759 Add directSourceFile option 2013-10-15 13:08:56 +02:00
Aparajita Fishman
824eb798f9 More descriptive names for binop token type 2013-10-12 18:04:09 +02:00
Aparajita Fishman
9ff4981ca2 More concise way of slicing off the last character 2013-10-12 18:00:19 +02:00
Aparajita Fishman
6e6c7b0af4 Just being consistent with quote usage 2013-10-10 23:45:40 +02:00
Marijn Haverbeke
987fb51feb Bump version number post-0.4.0 2013-10-10 10:41:19 +02:00
Marijn Haverbeke
1ed25992a7 Mark release 0.4 2013-10-10 10:40:31 +02:00
Aparajita Fishman
389c9b225b Fixed: tokLineStart and tokCurLine have no meaning if options.locations is false.
Everywhere else (except one place which is a bug) those variables only appear within an `if (options.locations)` block.
2013-10-10 09:59:16 +02:00
Marijn Haverbeke
b7972ad95c Remove invalid of tokLineStart
This is only tracked when locations are on, so it can't be used
unconditionally.

Closes #71
2013-10-10 09:58:23 +02:00
Aparajita Fishman
6fd79e50fb Fixed: skipSpace did not consider 8232 and 8233 as eol, but elsewhere it was.
Both readString and skipLineComment considered 8232/8233 as eol, but skipSpace itself would not increment the line counters if they were found.

Previously 8232/8233 were listed in nonASCIIwhitespace, but since that is only used within skipSpace and those values are checked separately, they could be removed from nonASCIIwhitespace.
2013-10-08 16:33:40 +02:00
Marijn Haverbeke
22c3161b6e Fix wrong end position for VariableDeclaration nodes
It should include the semicolon.

Closes #67
2013-10-02 20:39:51 +02:00
Aparajita Fishman
b7417cec8c Just want to be a little clearer what is happening to the node var declared earlier. 2013-10-01 17:33:01 +02:00
Marijn Haverbeke
83bfd6c536 Different approach to working around html comment issue 2013-09-11 12:23:25 +02:00
Marijn Haverbeke
3d932fcfba Add .gitignore and .tern-project 2013-09-09 22:11:12 +02:00
Marijn Haverbeke
36d001a4be Work around docco leaving in a <!-- comment start
Closes #66
2013-09-09 22:10:24 +02:00
Martin Carlberg
ba8da57d16 Use correct paragraph separator for newline
0x2089(8329) is Subscript nine
0x2028(8232) is Line separator
0x2029(8233) is Paragraph separator
2013-09-09 11:35:33 +02:00
Marijn Haverbeke
b998d5e22d Add support for bizarro <!-- and --> behavior
Issue #62
2013-09-06 10:52:04 +02:00
Aparajita Fishman
411b29791b Formatting
Just being consistent.

In every other place where a between comparison is done, the lower limit is on the left. It's a whole lot easier to see it's a between comparison when the limits are in order.
2013-09-05 10:33:03 +02:00
Aparajita Fishman
cfbbeebe8b Fixed: replace absolute with relative require, remove unsupported --trackComments from usage.
Unless I'm missing something, the simple relative path "../acorn.js" is exactly equivalent to the absolute path being constructed in the old code.
2013-09-03 17:51:46 +02:00
Marijn Haverbeke
c152be4a2e Improve error message for ++/re/
Closes #54
2013-08-28 16:22:30 +02:00
Marijn Haverbeke
6659f7a033 Fix special case to handle regexps that start with =
Closes #55
2013-08-28 10:35:21 +02:00
Marijn Haverbeke
2ace0fa8dc Further refine parseExprList indentation heuristic
Closes marijnh/tern#221
2013-08-27 12:52:02 +02:00
Marijn Haverbeke
6113324cd2 Fix bug with parsing slash after operator-keyword property
Closes #53
2013-08-25 15:01:20 +02:00
Jürg Lehni
097b4162da Pass on 'this' as root scope, for better inclusion of Acorn inside Paper.js
Use same approach as Esprima.
2013-07-26 08:59:07 +02:00
Jiaxing Wang
a84e21e0ff Line number start from 1 after getToken.jumpTo() 2013-07-11 12:28:58 +02:00
Jiaxing Wang
16b54e0698 parseMaybeUnary() doesn't need parameter @noIn 2013-07-11 08:20:05 +02:00
Jiaxing Wang
567f3ca32a Remove redundant if conditions that are tested above 2013-07-11 08:20:04 +02:00
Marijn Haverbeke
328d0e514c Linting 2013-07-08 09:07:10 +02:00
Marijn Haverbeke
d3b9eb177a Always attach a guardedHandlers property to TryStatements
Closes #48
2013-07-08 09:03:23 +02:00
Marijn Haverbeke
67c48229b9 Bump version number post-0.3.1 2013-06-11 12:44:35 +02:00
Marijn Haverbeke
d2673d465a Release 0.3.1 to fix release-making-script screwup in 0.3.0 2013-06-11 12:43:56 +02:00
Marijn Haverbeke
7e248c7e3b Mark release 0.3.0 2013-06-11 12:41:03 +02:00
Marijn Haverbeke
2372b12df7 [loose parser] Refine closing heuristic for expression lists
Issue marijnh/tern#171
2013-06-10 18:02:17 +02:00
Marijn Haverbeke
3ca3aa5a25 Run a lint pass, clean up lots of small issues 2013-06-10 16:52:22 +02:00
Marijn Haverbeke
6fe123947b Prefix keywords with underscore in tokTypes object 2013-06-10 15:47:29 +02:00
Marijn Haverbeke
314327537a Add charset to script link that includes test suite
So that browsers don't get confused by the utf-8 sequences.
2013-06-08 20:36:50 +02:00
Marijn Haverbeke
adf16e33c0 Don't assume options object has a hasOwnProperty method
Closes #43
2013-06-08 20:36:44 +02:00
Marijn Haverbeke
c979446572 [package.json] Use 'repository' rather than 'repositories' field
Apparently the second is no longer supported in npm 1.2 (?).

Closes #42
2013-05-21 14:36:49 +02:00
Marijn Haverbeke
38f0e80547 Include diacritical combining marks in identifier character set
Closes marijn/tern#157
2013-05-21 09:07:50 +02:00
Marijn Haverbeke
6dd35f870a [loose parser] Fix bug in continued-expression closing
When the continued expression sat on column 1 after a non-whitespace char,
the heuristic would consider it the start of the line, even though it wasn't.

Issue marijnh/tern#141
2013-05-15 12:03:00 +02:00
Marijn Haverbeke
9eee5300db [loose parser] Less aggressive termination heuristic for comma-separated lists
See https://github.com/marijnh/tern/issues/118
2013-05-08 15:21:25 +02:00
Marijn Haverbeke
4d8eeabf52 In browser loader, refer to global object as 'this', not 'self'
Closes #41
2013-05-08 15:16:06 +02:00
Marijn Haverbeke
df763df61b Bump version number post-0.2 2013-05-03 11:54:04 +02:00
Marijn Haverbeke
4146605738 Mark version 0.2.0 2013-05-03 11:52:42 +02:00
Marijn Haverbeke
30b399ece7 Export isIdentifierChar and isIdentifierStart 2013-04-24 07:44:11 +02:00
Marijn Haverbeke
f3c70d76ef Remove assignment to non-existing var 2013-04-03 15:05:00 +02:00
Marijn Haverbeke
cc12062b9c [loose parser] Fix a whole bunch of issues in the options.locations support
Closes #40
2013-04-02 13:47:50 +02:00
Marijn Haverbeke
62bc3641af Use a single .handler property on TryStatements
As the wiki page for the spec currently seems to prescribe.
2013-04-02 09:30:35 +02:00
Paul Harper
a6b3034e71 [loose parser] More fixes to locations 2013-03-27 10:57:48 +01:00
Marijn Haverbeke
54e78b7035 Properly back up line state when re-reading a token on strict mode
Issue #38
2013-03-25 15:10:55 +01:00
Oskar Schöldström
a8a24f538b Fix \v being treated as v in IE < 9
IE < 9 treats '\v' as 'v' instead of a vertical tab ('\u000b').
Read more: http://mathiasbynens.be/notes/javascript-escapes
2013-03-23 19:18:28 +01:00
Marijn Haverbeke
76be1f8eee Make Acorn work with AMD modules
(Hopefully)
2013-03-17 22:56:49 +01:00
Paul Harper
559518acc8 .parse_dammit() now recognizes the locations option, and will add a loc object to the ast nodes as .parse() does 2013-03-17 22:07:14 +01:00
Marijn Haverbeke
38179fd855 Fix node boundaries for unexpected regular expressions
Closes #33
2013-02-28 19:28:20 +01:00
Marijn Haverbeke
0b10aa2256 Add walk.findNodeBefore 2013-02-28 19:27:29 +01:00
Marijn Haverbeke
83cdcf7dbf Remove outdated option from bin/acorn 2013-02-27 09:59:42 +01:00
zsjforcn
173d94f019 [package] Add "bin" property to package.json for npm to auto generate exection files. 2013-02-27 09:39:09 +01:00
Marijn Haverbeke
9a55d60324 Move back to regular string accumulation in readString
The apply call is a stack overflow hazard.

Closes #31
2013-02-24 21:26:09 +01:00
Marijn Haverbeke
b1845b51b1 [util/walk] Add findNodeAfter 2013-02-24 21:25:25 +01:00
Marijn Haverbeke
72d2fc2644 Fix start offset of block nodes 2013-02-20 10:48:36 +01:00
Marijn Haverbeke
782259bea1 [loose parser] Fix bug where peeked tokens persist across parses 2013-02-14 14:05:54 +01:00
Marijn Haverbeke
adcb354498 [walker] Fix broken handling of node predicates 2013-02-14 14:02:48 +01:00
Marijn Haverbeke
006d5f1c04 Bump version post-0.1 2013-02-14 10:02:27 +01:00
Marijn Haverbeke
c108741d07 Mark release 0.1 2013-02-14 10:00:19 +01:00
Marijn Haverbeke
da83f80d29 Allow passing a test predicate to findNodeAt and findNodeAround 2013-02-12 17:35:04 +01:00
Marijn Haverbeke
76c41d3a71 [loose parser] Improve closing heuristic in parseExprList 2013-02-06 13:47:05 +01:00
Marijn Haverbeke
82980794a9 Fix bug in expression-terminating heuristic
Dedented tokens should only end an expression if they are actually the first
token on the line.

This to prevent code like this from going wrong:

    x = (function(..) {
      blah();
    })(); // <-- indented same as start of expression
2013-02-05 13:49:51 +01:00
Marijn Haverbeke
d98e378590 Store default walker in exports.base, rather than exports itself
My initial idea, that client code would constantly need to access the individual
walker functions directly, isn't actually the case. This prevents unnecessary copying
of other interface functions into walkers.
2013-01-30 19:11:27 +01:00
Alistair Braidwood
0632b36c94 Improve options.locations performance by tracking newlines rather than finding them 2013-01-30 17:30:38 +01:00
Marijn Haverbeke
87a6a5a8cd Clean up readNumber, fix parsing of '2.+2'
Issue #9
2013-01-30 16:38:31 +01:00
Marijn Haverbeke
792fa96e93 Add walk.findNodeAround 2013-01-28 17:17:51 +01:00
Marijn Haverbeke
1de79a277c [loose parser] Refine block-closing heuristics, add expression-continuing heuristics 2013-01-28 16:43:19 +01:00
Marijn Haverbeke
e95c4cce50 Add walk.findNodeAt utility 2013-01-28 13:00:08 +01:00
keeyipchan
44f7aff2b7 Add testAssert() for arbitrary tests; fix skinLineComments() passing off-by-1 character to onComment(slice(.., end)) 2013-01-27 10:09:06 +01:00
Marijn Haverbeke
17a0094694 [loose parser] Improve recovery from unterminated strings and regexps 2013-01-17 15:01:13 +01:00
Marijn Haverbeke
f8bcc75378 [loose parser] Fix typo 2013-01-17 14:49:20 +01:00
Marijn Haverbeke
e130dc3fbb [loose parser] Use ✖ rather than question mark for placeholders
This way, attempts to re-parse the pretty-printed code won't
be confused by the question marks.
2013-01-17 14:45:16 +01:00
Marijn Haverbeke
207bf64e8d [loose parser] Revise strategy for forcing token consumption
It's easier and more flexible to simply handle it at the call site.
2013-01-17 14:44:00 +01:00
Marijn Haverbeke
b8ec8aab2c [loose parser] Fix bug in argument list parsing 2013-01-17 14:17:22 +01:00
Marijn Haverbeke
7d73fe243a Upgrade Esprima 2013-01-17 14:17:10 +01:00
Marijn Haverbeke
1d974ce2b6 [loose parser] Several small tweaks 2013-01-16 19:09:06 +01:00
Marijn Haverbeke
d08144c1d7 [loose parser] Support tabSize option 2013-01-16 17:53:37 +01:00
Marijn Haverbeke
3981dfa133 [loose parser] Add note about imprecision 2013-01-16 17:43:27 +01:00
Marijn Haverbeke
a2788f8864 [loose parser] Make expect check two tokens ahead if it fails to find its target 2013-01-16 17:38:56 +01:00
Marijn Haverbeke
038e438949 Add a loose parser
For getting a halfway meaningful AST out of code that may contain
syntax errors.

Use case: analyzing code as the user is editing it.
2013-01-16 17:27:28 +01:00
Marijn Haverbeke
965166cdfd Small fixes noticed while going over the when writing loose parser 2013-01-16 16:47:21 +01:00
Marijn Haverbeke
4d2d8408de Export the tokenizer 2013-01-16 12:46:26 +01:00
Marijn Haverbeke
c2dd92fec0 Attach position information to errors 2013-01-16 12:20:19 +01:00
Marijn Haverbeke
3c2bd590da Fix regexp detection after void/typeof/instanceof/delete 2013-01-15 15:58:16 +01:00
Marijn Haverbeke
8104257495 Bump version to 0.0.2 2013-01-13 22:05:46 +01:00
Marijn Haverbeke
cade51347a Remove trackComments, add onComment option
trackComments was too obscure and complicated, and not all that useful.
2013-01-13 22:04:45 +01:00
Martin Carlberg
5e4ea00f3c Unnecessary 'if' as we already know 'ch !== 92' 2013-01-09 10:13:26 +01:00
Marijn Haverbeke
e6485e61fd [walker] Allow recursive walks without building a new walker obj 2013-01-08 13:17:37 +01:00
Marijn Haverbeke
cc5971f617 Formatting 2013-01-04 09:37:21 +01:00
Arian Stolwijk
f6e0182a3a Fixes sourceFile option.
When setting the .prototype.source the sourceFile variable is undefined, and
setting the sourceFile option doesn't change the .source property on the
prototype anymore.

By setting the .source property inside the node_loc_t constructor, the correct
sourceFile is set in the loc object.
2013-01-04 09:32:43 +01:00
Alistair Braidwood
3d0f85d616 line_loc type for v8 perf 2012-12-30 12:46:54 +01:00
Alistair Braidwood
c8eb50fabe create node 'class' - improve v8 performance 2012-12-30 12:46:45 +01:00
Alistair Braidwood
2bad03e654 reduce array creation in readString 2012-12-30 12:27:13 +01:00
krator
5b19196bac Give true/false/null literals a raw property
In the generated ast, "null"/"true"/"false" are "Literal" nodes.
As every "Literal" node has a 'raw' property,
When i am doing something with the ast using python,
the 3 "Literal"s caused some problem.
make the 3 "Literal"s have 'raw' property.
2012-12-24 14:26:03 +01:00
Marijn Haverbeke
f58bb9a480 Use 'self' instead of 'window' in browser, in order to work in a web worker 2012-11-29 10:08:32 +01:00
Marijn Haverbeke
d36c70bbbf Add missing labels.pop() to allow re-using labels in a block
Issue #15
2012-11-22 10:11:00 +01:00
Marijn Haverbeke
5c44c13465 Make sure readInt doesn't try to read past len, if given
Issue #15
2012-11-22 10:07:19 +01:00
Marijn Haverbeke
5771c8b4b2 Add missing semicolon() calls to debugger and throw statement parsers
Issue #5
2012-11-22 09:48:01 +01:00
Marijn Haverbeke
74536b9eb7 Remove test that raised error from the JS engine's RegExp parser 2012-11-21 14:38:21 +01:00
Marijn Haverbeke
4229ef792e Give readToken sub-functions meaningful names 2012-11-20 16:58:57 +01:00
Alistair Braidwood
04a69abae0 Split readToken to smaller functions 2012-11-20 16:58:57 +01:00
Marijn Haverbeke
4c650ad16b Add an acorn-only button to bench.html 2012-11-20 16:58:57 +01:00
Marijn Haverbeke
905124c291 Assign parenthesized expressions a range that includes the parens
This way, composite expressions that they are part of won't get bogus
unsyntactic substrings as their range (i.e. in '(1)+1', the binop expression
would span '1)+1').

Closes #14
2012-11-18 21:17:49 +01:00
Marijn Haverbeke
f91d7f5836 [walker] Allow custom fields to be added to new walkers
Issue #13
2012-11-08 21:07:48 +01:00
Marijn Haverbeke
cb6cd3038e Make the walker's scope module use objects for variables
So that subsequent passes can attach and retrieve information
from them.
2012-11-07 12:15:32 +01:00
Marijn Haverbeke
3ba6913d30 Comment walker module 2012-11-06 11:10:58 +01:00
Marijn Haverbeke
043386067a Stop accumulating line comments when trackComments is off 2012-11-05 22:39:22 +01:00
Marijn Haverbeke
b660ff6d1c Add an AST walker utility 2012-11-05 22:32:39 +01:00
Marijn Haverbeke
16f8259dab Don't allow keywords as properties when forbidReserved is on 2012-11-05 22:25:57 +01:00
Marijn Haverbeke
b591c41513 Actually make strictSemicolons forbid all semicolon insertion 2012-11-05 22:25:40 +01:00
Marijn Haverbeke
5d83150951 Attach .raw property to literal nodes 2012-11-02 16:35:09 +01:00
Marijn Haverbeke
93d4a31abb Upgrade Esprima 2012-10-19 10:31:55 +02:00
Marijn Haverbeke
48bbcd9437 Restore nonasciiwhitespace regexp
It won't make any difference except in really strange code.
2012-10-19 10:10:53 +02:00
Alistair Braidwood
b3366233d3 skipLineComment 2012-10-19 10:05:59 +02:00
Alistair Braidwood
b38a98ffd2 skipSpace 2012-10-19 10:04:51 +02:00
Marijn Haverbeke
906a8b8e5b Simplify an if/switch combo to just a switch 2012-10-19 09:58:08 +02:00
Alistair Braidwood
5fa1f088cb readString 2012-10-19 09:53:11 +02:00
Alistair Braidwood
9bdbbaaf96 isIdentifierChar to numeric 2012-10-19 09:50:08 +02:00
abraidwood
c20cdbf8fc rearrange isIdentifierStart 2012-10-19 09:47:38 +02:00
Marijn Haverbeke
6b52dc8a84 Disallow newline after throw
Closes #11
2012-10-18 15:50:07 +02:00
Marijn Haverbeke
daefc220da Require a semicolon after do/while 2012-10-17 23:09:15 +02:00
Marijn Haverbeke
e3514627a4 Add funky newlines to nonASCIIwhitespace 2012-10-17 23:02:48 +02:00
Marijn Haverbeke
330084f993 Make 'this' a proper keyword 2012-10-17 16:34:00 +02:00
Marijn Haverbeke
96d911a30f Properly parse 10. as a valid number
Closes #9
2012-10-12 23:34:11 +02:00
Marijn Haverbeke
d198b7ed64 Upgrade Esprima and UglifyJS in benchmark comparison 2012-10-12 23:27:59 +02:00
Marijn Haverbeke
eb888141fd Add 'ranges' option to support range arrays on nodes
Closes #7
2012-10-12 23:19:04 +02:00
Marijn Haverbeke
fb003fff3a Document program and sourceFile options 2012-10-12 23:13:26 +02:00
Marijn Haverbeke
07152c41c4 Use 'new Function' instead of '(1, eval)'
In the hope that it'll be less confusing.
2012-10-12 23:09:23 +02:00
Mihai Bazon
feaa7df563 added sourceFile and program options to parse
- if `program` is given, it'll be used as the toplevel node, instead of
  creating a new node, and statements will be added to its body
- if `sourceFile` is given and `locations` is ON, it'll set the `source`
  property in every node's `loc`.
2012-10-12 23:06:44 +02:00
Marijn Haverbeke
b5e580a876 Properly enable strict mode
Closes #8
2012-10-06 12:32:45 +02:00
Marijn Haverbeke
0590d12240 Accept \0 in strings in strict mode
Closes #3
2012-10-03 22:18:52 +02:00
Mathieu 'p01' Henri
bb6687e3d1 Stricter lineBreak regexp
Checking for `\r\n?` is redundant with the `|[\n\r\u2028\u2029]`, better straighten the regexp and check for `\r\n|[\n\r\u2028\u2029]`. This might even be a itsy bitsty bit faster.
2012-10-03 11:08:27 +02:00
Marijn Haverbeke
7feb14c0ea Add a shell interface 2012-10-03 11:04:26 +02:00
Marijn Haverbeke
0820a593a6 Handle break-to-labeled-non-loop
Closes #1
2012-10-03 10:25:53 +02:00
Marijn Haverbeke
e864318883 Fix bug in benchmark
Since previous commit, Acorn is no longer properly benchmarked
when locations are on.
2012-10-02 20:22:02 +02:00
Marijn Haverbeke
4472608994 Write test status to dom rather than console 2012-10-02 18:03:22 +02:00
Marijn Haverbeke
5db60dcac9 Conform to Moz spec with regards to loc properties 2012-10-02 18:01:32 +02:00
Marijn Haverbeke
b39c337694 Extend benchmark page 2012-10-02 17:32:00 +02:00
Marijn Haverbeke
6f4e7fd502 Extend benchmark page 2012-10-02 17:17:00 +02:00
Marijn Haverbeke
30b348728c Typo in docs 2012-10-02 16:20:48 +02:00
Marijn Haverbeke
4cbe2afae5 Add docco output 2012-10-02 16:17:48 +02:00
Marijn Haverbeke
42d0c4535a More or less finish comments 2012-10-02 16:14:18 +02:00
Marijn Haverbeke
32e62f1cfc Partial parser comments 2012-10-02 10:14:57 +02:00
Marijn Haverbeke
237bfbfb9b Comment tokenizer 2012-10-02 08:44:41 +02:00
Marijn Haverbeke
60178c3d68 Shuffle parseExprAtom for expected probabilities 2012-09-24 22:06:44 +02:00
Marijn Haverbeke
092a524f43 Fix bug in number parser 2012-09-24 21:34:42 +02:00
Marijn Haverbeke
ec27961703 Less reliance on regexps, more on hacks 2012-09-24 16:15:33 +02:00
Marijn Haverbeke
a1d9587519 Add esprima and uglifyjs to compare against 2012-09-24 13:40:48 +02:00
Marijn Haverbeke
61906485a1 Add a README 2012-09-24 12:10:30 +02:00
Marijn Haverbeke
56b7db4e96 Add temp index page 2012-09-24 12:03:23 +02:00
Marijn Haverbeke
a46f0012ed Add package.json 2012-09-24 11:50:18 +02:00
Marijn Haverbeke
820f148002 Add LICENSE file 2012-09-24 11:50:10 +02:00
Marijn Haverbeke
03d95cda2c Make tests runnable under node 2012-09-24 11:50:03 +02:00
Marijn Haverbeke
587c790f7b Add esprima-derived tests, trivial benchmark 2012-09-24 11:42:01 +02:00
Marijn Haverbeke
aedcd4e12f Initial import 2012-09-24 10:48:45 +02:00
18730 changed files with 847491 additions and 96471 deletions

View File

@@ -1,6 +0,0 @@
{
"stage": 0,
"loose": ["all"],
"blacklist": ["es6.tailCall"],
"optional": ["optimisation.flow.forOf"]
}

121
.circleci/config.yml Normal file
View File

@@ -0,0 +1,121 @@
version: 2
aliases:
- &restore-node-modules-cache
keys:
- v1-yarn-deps-{{ checksum "yarn.lock" }}
- &restore-yarn-cache
keys:
- v1-yarn-cache
- &save-node-modules-cache
paths:
- node_modules
key: v1-yarn-deps-{{ checksum "yarn.lock" }}
- &save-yarn-cache
paths:
- ~/.yarn-cache
key: v1-yarn-cache
- &artifact_babel
path: ~/babel/packages/babel-standalone/babel.js
- &artifact_babel_min
path: ~/babel/packages/babel-standalone/babel.min.js
- &artifact_env
path: ~/babel/packages/babel-preset-env-standalone/babel-preset-env.js
- &artifact_env_min
path: ~/babel/packages/babel-preset-env-standalone/babel-preset-env.min.js
- &test262_workdir
working_directory: ~/babel/babel-test262-runner
- &artifact_test262_tap
path: ~/test262.tap
- &artifact_test262_xunit
path: ~/test-results
jobs:
test:
working_directory: ~/babel
docker:
- image: circleci/node:13
steps:
- checkout
- restore-cache: *restore-yarn-cache
- restore-cache: *restore-node-modules-cache
- run: yarn --version
- run: make test-ci-coverage
# Builds babel-standalone with the regular Babel config
- run: IS_PUBLISH=true make build
# test-ci-coverage doesn't test babel-standalone, as trying to gather coverage
# data for a JS file that's several megabytes large is bound to fail. Here,
# we just run the babel-standalone test separately.
- run: ./node_modules/.bin/jest packages/babel-standalone/test/
- run: ./node_modules/.bin/jest packages/babel-preset-env-standalone/test/
- store_artifacts: *artifact_babel
- store_artifacts: *artifact_babel_min
- store_artifacts: *artifact_env
- store_artifacts: *artifact_env_min
- save_cache: *save-node-modules-cache
- save_cache: *save-yarn-cache
test262:
working_directory: ~/babel
docker:
- image: circleci/node:12
steps:
- checkout
- restore-cache: *restore-yarn-cache
- restore-cache: *restore-node-modules-cache
- run:
name: Build Babel
command: BABEL_ENV=test make bootstrap
- run:
name: Link Babel
command: |
cd packages
for package in */; do
cd $package
yarn link
cd ..
done
- run:
name: Setup Test Runner
command: |
git clone --recurse-submodules https://github.com/babel/babel-test262-runner
cd babel-test262-runner
yarn
yarn add tap-mocha-reporter --dev
curl -L https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 > jq
chmod +x ./jq
for package in ../packages/*/package.json; do
yarn link $(./jq -j ".name" $package)
done
node lib/download-node
- run:
name: Run Test262
command: node lib/run-tests I_AM_SURE | tee ~/test262.tap
<<: *test262_workdir
- store_artifacts: *artifact_test262_tap
- run:
name: Output test262 results
command: |
cat ~/test262.tap | $(npm bin)/tap-mocha-reporter spec || true
<<: *test262_workdir
workflows:
version: 2
test:
jobs:
- test
master:
jobs:
- test262:
filters:
branches:
only:
- master

View File

@@ -6,6 +6,12 @@ charset = utf-8
trim_trailing_whitespace = true
end_of_line = lf
[*.{js,json}]
[*.{js,json,ts,tsx}]
indent_style = space
indent_size = 2
[Makefile]
indent_style = tab
[*.{md,markdown}]
trim_trailing_whitespace = false

View File

@@ -1 +1,26 @@
src/babel/transformation/templates
/lib
/build
/.git
package.json
lerna.json
packages/babel-runtime
!packages/babel-plugin-transform-runtime/scripts
packages/babel-runtime-corejs2
packages/babel-runtime-corejs3
packages/*/node_modules
packages/*/lib
packages/*/dist
packages/*/test/fixtures
packages/*/test/tmp
codemods/*/node_modules
codemods/*/lib
codemods/*/dist
codemods/*/test/fixtures
codemods/*/test/tmp
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/babel-parser/test/expressions

View File

@@ -1,22 +0,0 @@
{
"parser": "babel-eslint",
"rules": {
"strict": 0,
"no-underscore-dangle": 0,
"no-unused-vars": 0,
"curly": 0,
"no-multi-spaces": 0,
"key-spacing": 0,
"no-return-assign": 0,
"consistent-return": 0,
"no-shadow": 0,
"no-comma-dangle": 0,
"no-use-before-define": 0,
"no-empty": 0,
"new-parens": 0,
"no-cond-assign": 0
},
"env": {
"node": true
}
}

41
.eslintrc.json Normal file
View File

@@ -0,0 +1,41 @@
{
"root": true,
"plugins": ["prettier", "@babel/development", "import"],
"extends": "babel",
"rules": {
"prettier/prettier": "error"
},
"env": {
"node": true
},
"overrides": [
{
"files": ["packages/*/src/**/*.js", "codemods/*/src/**/*.js"],
"rules": {
"@babel/development/no-undefined-identifier": "error",
"@babel/development/no-deprecated-clone": "error",
"import/no-extraneous-dependencies": "error",
"guard-for-in": "error"
}
},
{
"files": [
"packages/*/test/**/*.js",
"codemods/*/test/**/*.js",
"packages/babel-helper-transform-fixture-test-runner/src/helpers.js",
"test/**/*.js"
],
"env": {
"jest": true
}
},
{
"files": ["packages/babel-plugin-*/src/index.js"],
"excludedFiles": ["packages/babel-plugin-transform-regenerator/**/*.js"],
"rules": {
"@babel/development/plugin-name": "error",
"eqeqeq": ["error", "always", { "null": "ignore" }]
}
}
]
}

29
.flowconfig Normal file
View File

@@ -0,0 +1,29 @@
[ignore]
<PROJECT_ROOT>/build/.*
<PROJECT_ROOT>/packages/.*/lib
<PROJECT_ROOT>/packages/.*/test
<PROJECT_ROOT>/codemods/.*/lib
<PROJECT_ROOT>/codemods/.*/test
<PROJECT_ROOT>/node_modules/module-deps/
[include]
packages/*/src
codemods/*/src
[libs]
lib/file.js
lib/parser.js
lib/third-party-libs.js.flow
packages/babel-types/lib/index.js.flow
[options]
include_warnings=true
suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe
suppress_comment= \\(.\\|\n\\)*\\$FlowIssue
suppress_comment= \\(.\\|\n\\)*\\$FlowIgnore
suppress_type=$FlowFixMe
suppress_type=$FlowSubtype
esproposal.export_star_as=enable
esproposal.optional_chaining=enable
esproposal.nullish_coalescing=enable
module.name_mapper='^@babel\/\([a-zA-Z0-9_\-]+\)$' -> '<PROJECT_ROOT>/packages/babel-\1/src/index'

1
.gitattributes vendored Normal file
View File

@@ -0,0 +1 @@
* text eol=lf

668
.github/CHANGELO-preset-env-v0-v1.md vendored Normal file
View File

@@ -0,0 +1,668 @@
# Changelog
## v1.6.1 (2017-10-17)
### :bug: Bug Fix
- Update compat table to fix two small issues ([#445](https://github.com/babel/babel-preset-env/pull/445)) (@danez)
ES2015 destructuring is not fully supported in Edge 15 and the polyfill required again. `es6.math.imul` is supported on Android as of version 4.4
- Add polyfills for ES6 static Object methods ([#441](https://github.com/babel/babel-preset-env/pull/441)) (@danez)
Functions such as `Object.keys`, `Object.freeze`, ... do already exist in ES5, but their behaviour changed in ES2015. `babel-preset-env` with `builtIns: true` now adds the core-js polyfills for this methods if the browser only supports the ES5 variant of the method (like IE11 for example)
- Normalize module format of plugins/built-ins data ([#376](https://github.com/babel/babel-preset-env/pull/376)) (@rtsao)
## v1.6.0 (2017-07-04)
### :rocket: New Feature
- Bump compat-table for node8 support ([#363](https://github.com/babel/babel-preset-env/pull/363)) (@existentialism)
We updated our mappings to support native trailing function commas and string paddings in Node.js 8+.
### :bug: Bug Fix
- Handle `chromeandroid` browserslist value ([#367](https://github.com/babel/babel-preset-env/pull/367)) (@yavorsky)
We added support for using browserslist's `chromeandroid` in `targets`.
### :memo: Documentation
- Tweak uglify option docs ([#368](https://github.com/babel/babel-preset-env/pull/368)) (@existentialism)
Thanks to @graingert and @pfiaux for pointing out some needed updates to the `uglify-js`-related docs.
## v1.5.2 (2017-06-07)
### :bug: Bug Fix
- Ensure explicit targets always override browsers key targets ([#346](https://github.com/babel/babel-preset-env/pull/346)) (@existentialism)
`browser` targets should be overridden by explicit targets, and we inadvertently broke this when we landed string version support.
## v1.5.1 (2017-05-22)
### :bug: Bug Fix
- Compile with loose mode ([#322](https://github.com/babel/babel-preset-env/pull/332)) (@existentialism)
## v1.5.0 (2017-05-19)
### :rocket: New Feature
- Support target versions as strings ([#321](https://github.com/babel/babel-preset-env/pull/321)) (@existentialism)
We were originally waiting on 2.x for a breaking change, but since node v7.10
and other targets are causing some pain, we decided to land a backwards
compatible version.
### :house: Internal
- Backport: use preset-env and remove flow-strip-types ([#324](https://github.com/babel/babel-preset-env/pull/324)) (@yavorsky)
- Bump electron-to-chromium ([#329](https://github.com/babel/babel-preset-env/pull/329)) (@existentialism)
- Tweak version mappings to match compat-table updates ([#323](https://github.com/babel/babel-preset-env/pull/323)) (@existentialism)
- Bump browserslist ([#319](https://github.com/babel/babel-preset-env/pull/319)) (@existentialism)
- Bump compat-table ([#307](https://github.com/babel/babel-preset-env/pull/307)) (@existentialism)
- Add debug-fixtures and test/tmp to .eslintignore ([#305](https://github.com/babel/babel-preset-env/pull/305)) (@yavorsky)
## v1.4.0 (2017-04-14)
### :rocket: New Feature
- Support `spec` option ([#98](https://github.com/babel/babel-preset-env/pull/98)) (@Kovensky)
Added an option to enable more spec compliant, but potentially slower, transformations for any plugins in this preset that support them.
- Bump compat-table for Edge 15 support ([#273](https://github.com/babel/babel-preset-env/pull/273)) (@existentialism)
We updated our mappings so that you can get native support for async/await and other goodies when targeting Edge 15!
### :bug: Bug Fix
- Add Android browser to name map ([#270](https://github.com/babel/babel-preset-env/pull/270)) (@existentialism)
Fixed a bug that was ignoring Android targets in browserslist queries (for example: "Android >= 4").
### :memo: Documentation
- Clarify note about loading polyfills only once ([#282](https://github.com/babel/babel-preset-env/pull/282)) (@darahak)
- Add a reminder about include/exclude options ([#275](https://github.com/babel/babel-preset-env/pull/275)) (@existentialism)
### :house: Internal
- Chore: reduce package size. ([#281](https://github.com/babel/babel-preset-env/pull/281)) (@evilebottnawi)
- Remove deprecated comment ([#271](https://github.com/babel/babel-preset-env/pull/271)) (@yavorsky)
## v1.3.3 (2017-04-07)
### :bug: Bug Fix
- Support electron version in a string format ([#252](https://github.com/babel/babel-preset-env/pull/252)) (@yavorsky)
Adding electron as a target was an inadvertent breaking change as it no longer
allowed string versions. We added an exception for now, even though it is
inconsistent with other versions. Just as a note, the upcoming version 2.x will
allow _both_ number and string versions.
- Ensure const-check plugin order ([#257](https://github.com/babel/babel-preset-env/pull/257)) (@existentialism)
We now force the `const-es2015-check` plugin to run first (so that it can
correctly report issues before they get transpiled away).
### :rocket: New Feature
- Allow use `babel-plugin-` prefix for include and exclude ([#242](https://github.com/babel/babel-preset-env/pull/242)) (@yavorsky)
The `include` and `exclude` options now allow both prefixed (`babel-plugin-transform-es2015-spread`)
and prefix-less (`transform-es2015-spread`) plugin names.
### :memo: Documentation
- Note babel plugin prefix handling in include/exclude ([#245](https://github.com/babel/babel-preset-env/pull/245)) (@existentialism)
- Fix README: debug option shows info in stdout. ([#236](https://github.com/babel/babel-preset-env/pull/236)) (@Gerhut)
### :house: Internal
- Add simple smoke-test ([#240](https://github.com/babel/babel-preset-env/pull/240)) (@existentialism)
- Add prepublish script (@existentialism)
## v1.3.2 (2017-03-30)
- Fixed an issue with a broken publish
## v1.3.1 (2017-03-30)
- Fixed a regression with missing files due to `.npmignore`.
## v1.3.0 (2017-03-30)
### :bug: Bug Fix
- Add check for ArrayBuffer[Symbol.species] ([#233](https://github.com/babel/babel-preset-env/pull/233)) (@existentialism)
We now properly check for `Symbol.species` support in ArrayBuffer and include the
polyfill if necessary. This should, as a side effect, fix ArrayBuffer-related
errors on IE9.
### :nail_care: Polish
- Fill data with electron as a target. ([#229](https://github.com/babel/babel-preset-env/pull/229)) (@yavorsky)
We've simplified things by adding `electron` as a target instead of doing a bunch of
things at runtime. Electron targets should now also be displayed in the debug output.
- separate default builtins for platforms ([#226](https://github.com/babel/babel-preset-env/pull/226)) (@restrry)
If you are targeting the `node` environment exclusively, the always-included web polyfills
(like `dom.iterable`, and a few others) will now no longer be included.
### :memo: Documentation
* remove deprecated projects ([#223](https://github.com/babel/babel-preset-env/pull/223)) [skip ci] (@stevemao)
### :house: Internal
* npmignore: Add related to build data and codecov. ([#216](https://github.com/babel/babel-preset-env/pull/216)) (@yavorsky)
## v1.2.2 (2017-03-14)
### :bug: Bug Fix
- Refactor browser data parsing to handle families ([#208](https://github.com/babel/babel-preset-env/pull/208)) (@existentialism)
When parsing plugin data, we weren't properly handling browser families. This caused
`transform-es2015-block-scoping` and other plugins to be incorrectly added for Edge >= 12.
(s/o to @mgol for the the report and review!)
- Add typed array methods to built-ins features. ([#198](https://github.com/babel/babel-preset-env/pull/198)) (@yavorsky)
Fixes an issue where some TypedArray features were not being polyfilled properly. (s/o to @alippai for the report!)
### :memo: Documentation
- Fixed minor typo in readme ([#199](https://github.com/babel/babel-preset-env/pull/199)) (@bl4ckdu5t)
- Add built-ins, better links, compat-table url, etc ([#195](https://github.com/babel/babel-preset-env/pull/195)) (@yavorsky)
- Change CONTRIBUTING.md to use absolute paths ([#194](https://github.com/babel/babel-preset-env/pull/194)) (@aaronang)
### :house: Internal
- Bump plugins ([#201](https://github.com/babel/babel-preset-env/pull/201)) (@yavorsky)
- Enable code coverage ([#200](https://github.com/babel/babel-preset-env/pull/200)) (@alxpy)
- Increase mocha timeout to 10s ([#202](https://github.com/babel/babel-preset-env/pull/202)) (@yavorsky)
## v1.2.1 (2017-03-06)
### :bug: Bug Fix
- Add transform-duplicate-keys mapping ([#192](https://github.com/babel/babel-preset-env/pull/192)) (@existentialism)
Our plugin data was missing a mapping for the `transform-duplicate-keys` plugin which caused it to never be included. (s/o to @Timer for the report!)
### :memo: Documentation
- Clarify reasons for the uglify option in README.md ([#188](https://github.com/babel/babel-preset-env/pull/188)) (@mikegreiling)
## v1.2.0 (2017-03-03)
### :rocket: New Feature
- Add uglify as a target ([#178](https://github.com/babel/babel-preset-env/pull/178)) (@yavorsky)
Support for `uglify` as a target is now available! This will enable all plugins and, as a result, fully compiles your code to ES5. Note, that useBuiltIns will work as before, and only the polyfills that your other target(s) need will be included.
```json
{
"presets": [
["env", {
"targets": {
"chrome": 55,
"uglify": true
},
"useBuiltIns": true,
"modules": false
}]
]
}
```
### :bug: Bug Fix
- Respect older versions in invert equals map ([#180](https://github.com/babel/babel-preset-env/pull/180)) (@danez)
Fixes a number of bugs that caused some incorrect and/or missing environment data when parsing `compat-table`.
## v1.1.11 (2017-03-01)
This release primarily upgrades `compat-table`, which adds support for async on Node 7.6!
### :bug: Bug Fix
- Fix hasBeenWarned condition. ([#175](https://github.com/babel/babel-preset-env/pull/175)) (@yavorsky)
### :memo: Documentation
- Add yarn example. ([#174](https://github.com/babel/babel-preset-env/pull/174)) (@yavorsky)
### :house: Internal
- Bump compat-table ([#177](https://github.com/babel/babel-preset-env/pull/177)) (@existentialism)
- Add electron version exception test ([#176](https://github.com/babel/babel-preset-env/pull/176)) (@existentialism)
## v1.1.10 (2017-02-24)
### :bug: Bug Fix
- Drop use of lodash/intersection from checkDuplicateIncludeExcludes ([#173](https://github.com/babel/babel-preset-env/pull/173)) (@existentialism)
## v1.1.9 (2017-02-24)
### :bug: Bug Fix
- Add tests for debug output ([#156](https://github.com/babel/babel-preset-env/pull/156)) (@existentialism)
Since we've (mostly @yavorsky) have fixed a number of bugs recently with the `debug` option output, we added the ability to assert stdout matches what we expect. Read the updated [CONTRIBUTING.md](https://github.com/babel/experimental/babel-preset-env/blob/master/CONTRIBUTING.md#testing-the-debug-option) for more info.
- Fixes #143. Log correct targets. ([#155](https://github.com/babel/babel-preset-env/pull/155)) (@yavorsky)
This fixes a bug in the `debug` output where incorrect target(s) were being displayed for why a particular plugin/preset was being included.
Given targets:
```txt
{
"firefox": 52,
"node": 7.4
}
```
Before:
```txt
Using plugins:
transform-es2015-destructuring {"node":6.5}
transform-es2015-for-of {"node":6.5}
transform-es2015-function-name {"node":6.5}
transform-es2015-literals {"node":4}
transform-exponentiation-operator {"firefox":52}
syntax-trailing-function-commas {"firefox":52}
```
After:
```txt
Using plugins:
transform-es2015-destructuring {"firefox":52}
transform-es2015-for-of {"firefox":52}
transform-es2015-function-name {"firefox":52}
transform-es2015-literals {"firefox":52}
transform-exponentiation-operator {"node":7.4}
syntax-trailing-function-commas {"node":7.4}
```
### :memo: Documentation
- Fix compat-table link in contributing.md (@existentialism)
- Update README examples to fix website ([#151](https://github.com/babel/babel-preset-env/pull/)) (@existentialism)
- Fix few typos ([#146](https://github.com/babel/babel-preset-env/pull/146)) (@existentialism)
- Add configuration example to clarify `debug: true` ([#138](https://github.com/babel/babel-preset-env/pull/138)) (@yavorsky)
- Fix CHANGELOGs v1.1.8 updates typo. ([#136](https://github.com/babel/babel-preset-env/pull/136)) (@yavorsky)
- README: Update `debug: true` example. ([#138](https://github.com/babel/babel-preset-env/pull/138)) (@yavorsky)
### :house: Internal
- update compat ([#169](https://github.com/babel/babel-preset-env/pull/169)) (@hzoo)
- Use external Electron to Chromium library ([#144](https://github.com/babel/babel-preset-env/pull/144)) (@Kilian)
- Update yarn lockfile ([#152](https://github.com/babel/babel-preset-env/pull/152)) (@existentialism)
- Extract option normalization into independant file ([#125](https://github.com/babel/babel-preset-env/pull/125)) (@baer)
- Update yarnfile ([#145](https://github.com/babel/babel-preset-env/pull/145)) (@baer)
- devDeps: eslint-config-babel v5.0.0 ([#139](https://github.com/babel/babel-preset-env/pull/139)) (@kaicataldo)
- Update compat-table, build data ([#135](https://github.com/babel/babel-preset-env/pull/135)) (@hzoo)
## v1.1.8 (2017-01-10)
### :bug: Bug Fix
- Debug: Transformations before logs. ([#128](https://github.com/babel/babel-preset-env/pull/128)) (@yavorsky)
Makes sure that all transformations on `targets` (such as `exclude`/`include`) are run before logging out with the `debug` option. Fixes ([#127](https://github.com/babel/babel-preset-env/issues/127)).
### :house: Internal
- Remove unnecessary extension. ([#131](https://github.com/babel/babel-preset-env/pull/131)) (@roman-yakobnyuk)
- Include yarn.lock and update CI. ([#124](https://github.com/babel/babel-preset-env/pull/124)) (@existentialism)
## v1.1.7 (2017-01-09)
Had a publishing issue in the previous release.
## v1.1.6 (2017-01-06)
### :bug: Bug Fix
- Explicitly resolve lowest browser version. ([#121](https://github.com/babel/babel-preset-env/pull/121)) (@brokenmass)
```js
{
"targets": {
"browsers": ["ios >= 6"] // was resolving to {ios: 10} rather than {ios: 6}
}
}
```
## v1.1.5 (2017-01-04)
### :bug: Bug Fix
- Show error if target version is not a number. ([#107](https://github.com/babel/babel-preset-env/pull/107)) (@existentialism)
```js
{
"presets": [
["env", {
"targets": {
"chrome": "52", // will error since it's not a number,
"chrome": 52 // correct!
}
}]
]
}
```
- Fix targets for the `debug` option. ([#109](https://github.com/babel/babel-preset-env/pull/109)) (@yavorsky)
Now it prints the transformed targets/environments rather than the browsers query.
```txt
Using targets:
{
"chrome": 53,
"ie": 10,
"node": 6
}
Modules transform: false
Using plugins:
transform-es2015-arrow-functions {"chrome":47,"node":6}
transform-es2015-block-scoped-functions {"chrome":41,"ie":11,"node":4}
Using polyfills:
es6.typed.uint8-clamped-array {"chrome":5,"node":0.12}
es6.map {"chrome":51,"node":6.5}
```
## v1.1.4 (2016-12-16)
v1.1.2-v1.1.4
### :bug: Bug Fix
The new `exclude`/`include` options weren't working correctly for built-ins. ([#102](https://github.com/babel/babel-preset-env/pull/102)).
Also fixes an issue with debug option.
## v1.1.1 (2016-12-13)
### :bug: Bug Fix
Regression with the previous release due to using `Object.values` (ES2017). This wasn't caught because we are using babel-register to run tests and includes polyfills so it didn't fail on CI even though we have Node 0.10 as an env. Looking into fixing this to prevent future issues.
## v1.1.0 (2016-12-13)
### :rocket: New Feature
- Add `exclude` option, rename `whitelist` to `include` ([#89](https://github.com/babel/babel-preset-env/pull/89)) (@hzoo)
Example:
```js
{
"presets": [
["env", {
"targets": {
"browsers": ["last 2 versions", "safari >= 7"]
},
"include": ["transform-es2015-arrow-functions"],
"exclude": [
"transform-regenerator",
"transform-async-to-generator",
"map"
],
"useBuiltIns": true
}]
]
}
```
`"exclude": ["transform-regenerator"]` doesn't transform generators and removes `regeneratorRuntime` from being imported.
`"exclude": ["transform-async-to-generator"]` doesn't use the built-in async-to-gen transform so you can use something like [fast-async](https://github.com/MatAtBread/fast-async).
`"exclude": ["map"]` doesn't include the `Map` polyfill if you know you aren't using it in your code (w/ `useBuiltIns`). (We will figure out a way to automatically do this [#84](https://github.com/babel/babel-preset-env/issues/84)).
If you pass a wrong plugin it will error: valid options for `include/exclude` are in [/data/plugin-features.js](https://github.com/babel/experimental/babel-preset-env/blob/master/data/plugin-features.js) and [/data/built-in-features.js](https://github.com/babel/experimental/babel-preset-env/blob/master/data/built-in-features.js) (without the `es6.`)
### :house: Internal
- Optimize result filtration. ([#77](https://github.com/babel/babel-preset-env/pull/77)) (@yavorsky)
- Update eslint config to align with other babel projects ([#79](https://github.com/babel/babel-preset-env/pull/79)) (@baer)
- Update pathnames to avoid uppercase ([#80](https://github.com/babel/babel-preset-env/pull/80)) (@baer)
- Refactor build data for clarity/consistency ([#81](https://github.com/babel/babel-preset-env/pull/81)) (@baer)
- Update linting rules to cover all js ([#82](https://github.com/babel/babel-preset-env/pull/82)) (@baer)
- Cleanup lib before rebuilding ([#87](https://github.com/babel/babel-preset-env/pull/87)) (@baer)
- Move linting dependency to be dev only ([#88](https://github.com/babel/babel-preset-env/pull/88)) (@baer)
### :memo: Documentation
- Fix typo ([#78](https://github.com/babel/babel-preset-env/pull/78)) (@rohmanhm)
- Fix PR link in changelog. ([#75](https://github.com/babel/babel-preset-env/pull/75)) (@nhajidin)
## v1.0.2 (2016-12-10)
### :bug: Bug Fix
* Fix issue with Object.getOwnPropertySymbols ([#71](https://github.com/babel/babel-preset-env/pull/71)) ([@existentialism](https://github.com/existentialism))
Was requiring the wrong module kinda of like in v1.0.1:
https://github.com/zloirock/core-js#ecmascript-6-symbol
```diff
-import "core-js/modules/es6.object.get-own-property-symbols";
```
The test is just a part of `Symbol`.
## v1.0.1 (2016-12-10)
### :bug: Bug Fix
* Fix regenerator import ([#68](https://github.com/babel/babel-preset-env/pull/68)) ([@hzoo](https://github.com/hzoo))
We were outputting an invalid path for `regenerator`!
```diff
+import "regenerator-runtime/runtime";
-import "core-js/modules/regenerator-runtime/runtime"-
```
## v1.0.0 (2016-12-09)
### :rocket: New Feature
* Add `useBuiltIns` option ([#56](https://github.com/babel/babel-preset-env/pull/56)) ([@hzoo](https://github.com/hzoo)), ([@yavorsky](https://github.com/yavorsky)), ([@existentialism](https://github.com/existentialism))
A way to apply `babel-preset-env` for polyfills (via `"babel-polyfill"``).
> This option will apply a new Babel plugin that replaces `require("babel-polyfill")` with the individual requires for `babel-polyfill` based on the target environments.
Install
```
npm install babel-polyfill --save
```
In
```js
import "babel-polyfill"; // create an entry js file that contains this
// or
import "core-js";
```
Out (different based on environment)
```js
// chrome 55
import "core-js/modules/es7.string.pad-start"; // haha left_pad
import "core-js/modules/es7.string.pad-end";
import "core-js/modules/web.timers";
import "core-js/modules/web.immediate";
import "core-js/modules/web.dom.iterable";
```
`.babelrc` Usage
```js
{
"presets": [
["env", {
"targets": {
"electron": 1.4
},
"modules": false, // webpack 2
"useBuiltIns": true // new option
}]
]
}
```
> Also looking to make an easier integration point via Webpack with this method. Please reach out if you have ideas!
---
* Support [Electron](http://electron.atom.io/) ([#55](https://github.com/babel/babel-preset-env/pull/55)) ([@paulcbetts](https://github.com/paulcbetts))
Electron is also an environment, so [Paul went ahead](https://twitter.com/paulcbetts/status/804507070103851008) and added support for this!
`.babelrc` Usage
```js
{
"presets": [ ["env", {"targets": { "electron": 1.4 }}]]
}
```
> Currently we are manually updating the data in [/data/electron-to-chromium.js](https://github.com/babel/experimental/babel-preset-env/blob/master/data/electron-to-chromium.js), but [@kevinsawicki](https://github.com/kevinsawicki) says we could generate the data from [atom-shell/dist/index.json](https://gh-contractor-zcbenz.s3.amazonaws.com/atom-shell/dist/index.json) as well! (Someone should make a PR :smile:)
## v0.0.9 (2016-11-24)
### :rocket: New Feature
* Support Opera ([#48](https://github.com/babel/babel-preset-env/pull/48)) (Henry Zhu)
Was as simple as modifying the chrome version and subtracting 13! (so chrome 54 = opera 41)
```js
{
"presets": [
["env", {
"targets": {
"opera": 41
}
}]
]
}
```
## v0.0.8 (2016-11-16)
### :nail_care: Polish
* Only print the debug info once ([#46](https://github.com/babel/babel-preset-env/pull/46) (Henry Zhu)
When using the `debug` option it was printing the data for each file processed rather than once.
```js
{
"presets": [
["env", {
"debug": true
}]
]
}
```
## v0.0.7 (2016-11-02)
### :rocket: New Feature
* hardcode a current node version option ([#35](https://github.com/babel/babel-preset-env/pull/35)) (Henry Zhu)
```js
{
"presets": [
["env", {
"targets": {
"node": "current" // parseFloat(process.versions.node)
}
}]
]
}
```
* add 'whitelist' option ([#31](https://github.com/babel/babel-preset-env/pull/31)) (Henry Zhu)
```js
{
"presets": [
["env", {
"targets": {
"chrome": 52
},
"whitelist": ["transform-es2015-arrow-functions"]
}]
]
}
```
* Add more aliases (Henry Zhu)
* Update plugin data: firefox 52 supports async/await! ([#29](https://github.com/babel/babel-preset-env/pull/29)) (Henry Zhu)
### :bug: Bug Fixes
* Use compat-table equals option ([#36](https://github.com/babel/babel-preset-env/pull/36)) (Henry Zhu)
Compute and use `compat-table` equivalents
```js
{
"safari6": "phantom",
"chrome44": "iojs",
"chrome50": "node64",
"chrome51": "node65",
"chrome54": "node7",
"chrome30": "android44",
"chrome37": "android50",
"chrome39": "android51",
"safari7": "ios7",
"safari71_8": "ios8",
"safari9": "ios9",
"safari10": "ios10",
"chrome50": "node6"
}
```
* Change default behavior to act the same as babel-preset-latest ([#33](https://github.com/babel/babel-preset-env/pull/33)) (Henry Zhu)
```js
{ "presets": ["env"] } // should act the same as babel-preset-latest
```
## Internal
* Add fixture helper for tests ([#28](https://github.com/babel/babel-preset-env/pull/28)) (Henry Zhu)

View File

@@ -84,7 +84,7 @@
* More performance improvements.
* Parsing is now ~30% faster thanks to [marijnh/acorn@7264bc0178e7e6af7cfe02e9e0c6b26ee0e6007f](https://github.com/marijnh/acorn/commit/7264bc0178e7e6af7cfe02e9e0c6b26ee0e6007f).
* **New Feature**
* Optional `es6.blockScopingTDZ` is now completely functional and handles all edgecases.
* Optional `es6.blockScopingTDZ` is now completely functional and handles all edge cases.
* `super` in object literals.
* Tail call optimisation. Thanks [@RReverser](https://github.com/RReverser)!
@@ -122,7 +122,7 @@
* Restructure transformers so they're only ran if the AST contains nodes that they need to worry about. Improves transpilation speed significantly.
* **Bug Fix**
* Fix source maps not tracking end of node locations.
* **Spec Compliancy**
* **Spec Compliance**
* Use static super references as the home object is actually done at definition time.
* **Polish**
* Force the `es6.destructuring` transformer to be whitelisted when the `es7.objectSpread` transformer is.
@@ -474,12 +474,12 @@
* **Polish**
* Rest parameters now allocate the array before populating.
* **Internal**
* `for...in` loops have been changed to optimized `for` loops - better performance and no enumeration of protoype keys.
* `for...in` loops have been changed to optimized `for` loops - better performance and no enumeration of prototype keys.
* Parts of the code generator have now been optimized thanks to [gaearon](https://github.com/gaearon).
## 2.12.3
* **Spec Compliancy**
* **Spec Compliance**
* Optional `typeof` transformer checks for `undefined` before passing it to the helper.
* Class methods are now named.
@@ -551,7 +551,7 @@
* Add `classesFastSuper` optional transformer that doesn't support parent getters and prototype changing.
* Add `forOfFast` transformer that speeds up `for...of` on arrays but produces more code.
* Add `--react-compat` to `bin/6to5`.
* **Spec Compliancy**
* **Spec Compliance**
* Disallow setters without a single parameter.
* Add `configurable` and `writable` to defined properties.
* Use define instead of assignment for class methods.
@@ -619,7 +619,7 @@
## 2.7.0
* **Spec Compliancy**
* **Spec Compliance**
* Disallow reassignments of imports.
* **New Feature**
* `reactCompat` option to enable pre-v0.12 react components.
@@ -643,7 +643,7 @@
* **Bug Fix**
* Better handling of number literal property keys.
* Handle `NewExpression` paren insertion edegcases better.
* Handle `NewExpression` paren insertion edge cases better.
* **Internal**
* Fix incorrect AST node `identifier("this")`.
* Better `toIdentifier` method that handles reserved words.
@@ -662,7 +662,7 @@
* **Polish**
* Move `"use strict";` to inside module bodies instead of at the top of the file.
* Better handling of dynamic imports.
* **Spec Compliancy**
* **Spec Compliance**
* Class inheritance now has a `function` or `null` type check.
* Add `interopRequireWildcard` around wildcard imports and exports to handle non-object exports.
@@ -850,7 +850,7 @@
## 1.14.10
* Fix let scoping unneccesary override.
* Fix let scoping unnecessary override.
## 1.14.6
@@ -973,7 +973,7 @@
## 1.12.21
* Fix unneccesary let scoping replacement.
* Fix unnecessary let scoping replacement.
* Add `commonInterop` module formatter. Thanks [@Naddiseo](https://github.com/Naddiseo).
* Fix `return` outside of function body bug. Thanks [@brentburg](https://github.com/brentburg).
* Add more flexible option types.
@@ -1020,7 +1020,7 @@
## 1.12.12
* Make scope tracker more reliable to handle all edgecases.
* Make scope tracker more reliable to handle all edge cases.
## 1.12.11

287
.github/CHANGELOG-v4.md vendored Normal file
View File

@@ -0,0 +1,287 @@
# Babel v4 Changelog
## 4.7.16
* **Bug Fix**
* Fix constructor spreading of typed arrays.
* Fix break/continue/return aliasing of non-loops in block scoping transformer.
## 4.7.15
* **Bug Fix**
* Fix constructor spreading of collections.
## 4.7.14
* **Bug Fix**
* Fix constructor spreading of `Promise`.
* **Internal**
* Deprecate remaining playground transformers and abstract references.
## 4.7.13
* **Bug Fix**
* Handle comments on use strict directives.
* Fix assignment patterns with a left side pattern.
* **Polish**
* Special case `this` when doing expression memoisation.
## 4.7.12
* **Bug Fix**
* Deprecate `playground.methodBinding`.
## 4.7.11
* **Bug Fix**
* Fix unicode regexes stripping their unicode flag before being passed on two `regexpu`.
## 4.7.10
* **Internal**
* Deprecate `playground.methodBinding` and `playground.objectGetterMemoization`.
* **Bug Fix**
* Fix `inputSourceMap` option. Thanks [@Rich-Harris](https://github.com/Rich-Harris)!
## 4.7.9
* **Polish**
* Allow `inputSourceMap` to be set to `false` to skip the source map inference.
* Infer computed literal property names.
* **Bug Fix**
* Fix nested labeled for-ofs.
* Fix block scoping `break` colliding with the parent switch case.
* **Internal**
* Upgrade `acorn-babel`.
## 4.7.8
* **Bug Fix**
* Fix computed classes not properly setting symbols.
## 4.7.7
* **Bug Fix**
* Fix `types` API exposure.
## 4.7.6
* **Bug Fix**
* Fix non-Identifier/Literal computed class methods.
* **Polish**
* Add a fallback if `stack` on an error is unconfigurable.
* Hoist `esModule` module declarations to the top of the file to handle circular dependencies better.
## 4.7.5
* **Bug Fix**
* Don't remap` break`s to call the iterator return.
* **Polish**
* Use a different helper for computed classes for much nicer output. Also fixes a bug in symbols being non-enumerable so they wouldn't be set on the class.
## 4.7.4
* **Bug Fix**
* Rewrite named function expressions in optional async function transformers.
* Hoist directives.
* Remove `Number` from the list of valid `runtime` constructors.
* **Internal**
* `spec.typeofSymbol` transformer has been renamed to `es6.symbols`.
## 4.7.2
* **New Feature**
* `"both"` option for `sourceMap`.
* Add output types to external helpers. Thanks [@neVERberleRfellerER](https://github.com/neVERberleRfellerER)!
* **Bug Fix**
* Fix node duplication sometimes resulting in a recursion error.
* Ignore `break`s within cases inside `for...of`.
* **Polish**
* Split up variable declarations and export declarations to allow easier transformation.
## 4.7.0
* **Bug Fix**
* Add `alternate` to list of `STATEMENT_OR_BLOCK` keys.
* Add support for module specifiers to `t.isReferenced`.
* **New Feature**
* Add `inputSourceMap` option.
* **Polish**
* Throw an error on different `babel` and `babel-runtime` versions.
* Replicate module environment for `babel-node` eval.
* Clean up classes output.
* **Spec Compliance**
* Make it illegal to use a rest parameter on a setter.
## 4.6.6
* **Bug Fix**
* Fix incorrect method call in `utility.deadCodeElimination` transformer.
* Fix `es6.blockScopingTDZ` transformer duplicating binding nodes.
## 4.6.5
* **Internal**
* `useStrict` transformer has been renamed to `strict`.
## 4.6.4
* **Bug Fix**
* Fix `ForOfStatement` not properly inheriting labels.
* When in closure mode in block scoping transformer, properly check for variable shadowing.
* **New Feature**
* New `utility.inlineEnvironmentVariables` and `utility.inlineExpression` transformers.
## 4.6.3
* **Bug Fix**
* Fix `arguments` being incorrectly aliased in arrow function rest parameter optimisation.
* Make deoptimisation trigger safer.
* **New Feature**
* Flow types are now retained when blacklisting the `flow` transformer.
## 4.6.1
* **Bug Fix**
* Fix generators in template directory being transformed.
* Fix exposure of `util` for plugins.
## 4.6.0
* **New Feature**
* Desugar sticky regexes to a new constructor expression so it can be handled by a polyfill.
* **Spec Compliance**
* `for...of` now outputs in a lengthy `try...catch` this is to ensure spec compliance in regards to iterator returns and abrupt completions. See [google/traceur-compiler#1773](https://github.com/google/traceur-compiler/issues/1773) and [babel/babel/#838](https://github.com/babel/babel/issues/838) for more information.
* **Polish**
* Rest parameters that are only referred to via number properties on member expressions are desugared into a direct `arguments` reference. Thanks [@neVERberleRfellerER](https://github.com/neVERberleRfellerER)!
* `$ babel` no longer exits on syntax errors.
* **Internal**
* Upgrade `browserify`.
* Upgrade `source-map`.
* Publicly expose more internals.
## 4.5.5
* **Polish**
* Delete old extensions when overriding them in `babel/register`.
## 4.5.3
* **Bug Fix**
* Fix whitelisting logic for helper build script.
## 4.5.2
* **New Feature**
* `returnUsedHelpers` option and add whitelist to `buildHelpers`.
* **Bug Fix**
* Fix function arity on self referencing inferred named functions.
* **Internal**
* Bump `acorn-babel`.
* Start converting source to ES6...
## 4.5.1
**Babel now compiles itself!**
![holy shit](http://gifsec.com/wp-content/uploads/GIF/2014/03/OMG-GIF_2.gif)
## 4.5.0
* **New Feature**
* Add `.babelrc` support.
* **Bug Fix**
* Move use strict directives to the module formatter bodies.
* **Internal**
* Make default `bin/babel` behaviour to ignore non-compilable files and add a `--copy-files` flag to revert to the old behaviour.
## 4.4.6
* **Bug Fix**
* Fix extending a class expression with no methods/only constructor. Thanks [@neVERberleRfellerER](https://github.com/neVERberleRfellerER)!
* Allow `MemberExpression` as a valid `left` of `ForOfStatement`.
* **Polish**
* Throw an error when people try and transpile code with the `@jsx React.DOM` pragma as it conflicts with the custom jsx constructo method detection.
* Crawl all comments for `@jsx` pragma.
* **Internal**
* Upgrade `chalk`.
* Upgrade `core-js`.
## 4.4.5
* **Internal**
* Remove function self reference optimisation.
## 4.4.4
* **Bug Fix**
* Handle inferred function ids to be reassigned and deopt to a slower but working equivalent.
* Don't unpack array patterns that have more elements than their right hand array expression.
* **Polish**
* Improve syntax highlighting in the code frame. Thanks [@lydell](https://github.com/lydell)!
* **Internal**
* Upgrade `acorn-babel`.
## 4.4.3
* **Bug Fix**
* Fix `for...of` iterator break returns being duplicated.
* Only call `return` on the iterator if it exists.
* **Internal**
* Rename `selfContained` transformer to `runtime`.
## 4.4.2
* **New Feature**
* Add `moduleId` option for specifying a custom module id.
## 4.4.0
* **New Feature**
* `/*** @jsx NAMESPACE **/` comments are now honored by the `react` transformer.
* `getModuleName` option.
* Infer function expression names. Thanks [@RReverser](https://github.com/RReverser)!
* **Bug Fix**
* Add proper control flow for tail recursion optimisation.
* **Internal**
* Remove useless `format` options and move the `format.compact` option to `format`.
* **Polish**
* Newline handling of the code generator has been heavily improved.
* Code generator now deopts whitespace if the input size is >100KB.
## 4.3.0
* **Breaking Change**
* Remove `commonStandard` module formatter and make it the default behaviour of all the strict module formatters.
## 4.2.1
* **Polish**
* Add auxiliary comment to let scoping closure flow control.
## 4.2.0
* **Polish**
* Use an assignment instead of a define for `__esModule` in loose mode.
* **Internal**
* Add error for `eval();` usage and enable strict mode for parsing.
## 4.1.0
* **New Feature**
* Add `BABEL_CACHE_PATH` and `BABEL_DISABLE_CACHE` environment variables.
* **Internal**
* Replace many internal util functions with modules. Thanks [@sindresorhus](https://github.com/sindresorhus)!
## 4.0.2
* **Bug Fix**
* Fix generators not properly propagating their internal declarations.
* **Polish**
* Update setter param length error message.
* Use ranges on dependencies.
## 4.0.0
* 6to5 is now known as Babel.
* Global helpers/runtime has now been given the more descriptive name of "external helpers".

838
.github/CHANGELOG-v5.md vendored Normal file
View File

@@ -0,0 +1,838 @@
# Babel v5 Changelog
## 5.8.26
* **Internal**
* Republish to get fix for runtime `typeof-react-element` helper.
## 5.8.25
* **Internal**
* Rename `define` method to avoid webpack assuming those files are AMD.
## 5.8.24
* **Spec Compliance**
* Updated `optimisation.react.inlineElements` transformer to React 0.14 output. Thanks [@spicyj](https://github.com/spicyj)!
* **Polish**
* Add support for evaluating more static nodes. Thanks [@hzoo](https://github.com/hzoo)!
## 5.8.23
* **Bug Fix**
* Fix a bug where pushed scope bindings weren't properly being registered.
## 5.8.22
* **Bug Fix**
* Fix bug causing regexes to cause a syntax error after a block.
* **Internal**
* Expose `File`.
## 5.8.21
* **New Feature**
* Add support for Flow export types.
* **Bug Fix**
* Fix flow type annotations on object properties being lost.
* Fix bug effecting nested arrow functions.
* Check valid `export default` `function`/`class` token when parsing export default before converting to a declaration to avoid turning expressions into declarations.
* **Polish**
* Add an exception to non-existent bindings when checking if we need to wrap block scoping blocks in a closure.
* Make comment retainment for multiple replacement nodes more predictable.
* **Internal**
* Remove `operator` property from `AssignmentPattern` nodes.
* Update `es7.asyncFunctions` and `es7.objectRestSpread` to stage 2.
## 5.8.13-5.8.20
**The CHANGELOG was broken for these releases. Git tags were not pushed in the correct order and are therefore incorrect. It's recommended you NOT use any versions within this range.**
* **New Feature**
* Add `es6.spec.modules` transformer.
* **Bug Fix**
* Don't register export declarations as a module binding.
* Register import bindings to the specifier instead of the declaration.
* `export *` should not export `default`.
* Clear `rawValue from JSX attribute values to avoid outputting the raw source verbatim.
* Add support for boolean flow literals.
* Fix bug where files that babel can compile weren't being written when ignored with the `--copy-files` flag.
* Create new raw identifiers instead of cloning the original user one when exploding export specifiers to fix source map issues resulting in incorrect locations.
* Break on hitting a terminator paren triggering character to avoid pushing multiple starting parens.
* Consider comment starting character to be a terminatorless separator to avoid starting comments breaking terminatorless nodes.
* **Internal**
* Use `json5` for parsing `.babelrc` files and `JSON` for `package.json`.
* Update Regenerator dependency to `0.8.35`.
* Remove flow types from being scope tracked.
* **Polish**
* Only register export declarations in scope tracking if they're of a valid type.
* Only output code frame and message on syntax errors in CLI.
* Set decorated initialisers that have no `initialiser` to `undefined`.
* Optimise common `typeof` cases in `es6.spec.symbols` transformer.
## 5.8.12
* **Bug Fix**
* Fix bug in lookahead causing decorators to be cleared.
## 5.8.11
* **Bug Fix**
* Check if module options are nully instead of falsy to allow empty strings as `moduleRoot` etc.
* Fix bug where reassigning the rest parameter wouldn't result in a deoptimisation.
## 5.8.9
* **Bug Fix**
* Fix issue in parser where the flow plugin wasn't using state to refer to whether it as in a type or not causing lookaheads to cause breakages.
## 5.8.8
* **Bug Fix**
* Fix comments not being attached if they're touching the start of their node.
## 5.8.7
* Never published, environment issues, again.
## 5.8.6
* **Bug Fix**
* Remove `rawValue` for JSX inner text.
## 5.8.5
* **Polish**
* Rewrite parentheses insertion for terminatorless nodes such as `BreakStatement` to be much more stable and cleaner.
* Use `Object.setPrototypeOf` and fallback to `__proto__` in `inherits` helper.
## 5.8.2-5.8.4
Issues with publish process.
## 5.8.1
* **Bug Fix**
* Fix regression where async arrow functions couldn't have type annotation parameters.
* Output type annotations of type instantiation parameters.
* **Polish**
* Prepend to highest loop when performing rest parameter allocation optimisation.
* Add comment attachment to parser.
* Add support for retaining inner comments of empty blocks.
## 5.8.0
* Never released due to publish environment issues.
## 5.7.4
* **Bug Fix**
* Fix comments containg `@flow` being completely removed from output rather than just the specific directive.
## 5.7.3
* **Bug Fix**
* Add shim file for broken file path that old versions of the CLI would attempt to use.
## 5.7.2
* **Bug Fix**
* Fix performance issue in code generator when comment columns would attempt to match up in `compact` mode causing large amounts of whitespace.
* Fix single line comments not outputting a newline in `compact` mode.
* **Polish**
* Add support for flow return types for arrow functions.
## 5.7.1
* **Bug Fix**
* Add back mistakenly removed `replaceWithSourceString` method.
## 5.7.0
* **Bug Fix**
* Deopt on spread elements when performing array destructuring unpack optimisation.
* **New Feature**
* Add `shouldPrintComment` option to control comment output.
* Add `.babelignore` file to be consistent with other tools.
* Allow `.babelrc` configs to be specified via `package.json`.
* **Polish**
* Don't ignore comments when using `compact: true` option.
* Add support for Flow `import typeof`.
* Fix incorrect inheritance method position when using loose mode classes and constructor isn't the first item.
* **Internal**
* Completely fork Acorn with `babylon`.
* Rewrite build system to accommodate for multiple packages.
## 5.6.17
* **Bug Fix**
* Fix `CodeGenerator.findCommonStringDelimiter` causing a stack overflow.
## 5.6.16
* **Internal**
* Fix `recast` version to avoid pulling in a newer version.
* **New Feature**
* Add support for functions in `util.shouldIgnore`.
* **Polish**
* Strip flow directives in flow transformer.
* Add a check for out of bounds default parameters, drastically improving performance and removes engine deoptimisations.
* Various performance optimisations by [@samccone](https://github.com/samccone) 💅✨
* Delay `this` assignment when referencing this inside an arrow function pre-bare super in derived class constructors.
* Split up class body pushing if the constructor is in the wrong order.
* **Bug Fix**
* Fix hoisting of `ForInStatement` `init` variables in `system` module formatter.
* `PathHoister`: Don't hoist to the same function as their original paths function parent.
* `PathHoister`: Push each violation paths ancestry to the breakOnScopePaths collection to avoid constant hoisting to nested paths.fix tail call recursion on functions with less arguments than parameters.
* Disallow `super.*` before `super()` in derived class constructors.
* Properly regenerate scope for replaced nodes. Thanks [@loganfsmyth](https://github.com/loganfsmyth)!
* Move up template literal simplification logic to avoid breaking on single elements.
## 5.6.13-5.6.15
* Setting up automatic Travis releases.
## 5.6.12
* **Bug Fix**
* Fix finding parent for top-level shadowed functions.
## 5.6.11
** **Internal**
* Merge `es6.parameters.rest` and `es6.parameters.default` transformers. See commit [c0fd4c1f9e0b18231f585c4fa793e4cb0e01aed1](https://github.com/babel/babel/commit/c0fd4c1f9e0b18231f585c4fa793e4cb0e01aed1) for more info.
## 5.6.10
* **Bug Fix**
* Fix faulty internal require check.
* **Polish**
* Add support for trailing commas in arrow function parameter lists.
## 5.6.8
* **Bug Fix**
* Fix binary expressions colliding with unary expression operators in compact mode.
* Fix node properties being set to `null` when using computed properties.
## 5.6.7
* **Bug Fix**
* Fix hoisting of `ForXStatement` `left` `var`s when inserting a block scoping IIFE.
* **Polish**
* Combine all leading computed property initialisers into the root object in loose mode.
* **Internal**
* Deprecate returning of replacement strings from visitor methods.
## 5.6.6
* **Bug Fix**
* Fix weird parser bug where `void` type annotations were being parsed as keywords causing the tokeniser to lose track of context.
## 5.6.5
* **Bug Fix**
* Fix nested functions causing rest parameter optimisation to not properly detect when it should deopt on a reference.
* **Internal**
* Update Regenerator `0.8.31`.
## 5.6.4
* **Internal**
* Add `ParenthesizedExpression` node type.
## 5.6.3
* **Bug Fix**
* Fix rest parameter array allocation loop being incorrectly aliased.
## 5.6.2
* **Bug Fix**
* Fix method key literals not turning into computed member expression in loose mode.
* Elect rest parameters in spread element position as candidates instead of replacing them in place.
## 5.6.0
* **Bug Fix**
* Fix istanbul interop for register hook when registering for non-existence extension.
* Fix super class constructor call differing for no constructor in derived classes.
* Disable module import receiver when in loose mode.
* Fix duplicate filenames when using `babel` CLI when passing multiple matching patterns.
* Register labels as bindings to fix undeclared variable checks.
* **Polish**
* Remove unnecessary string binary expressions when transforming template literals.
* Support module live bindings in arbitrary positions not in Program statement position.
* Throw error when attempting to replace a `Program` root node with another node not of type `Program`.
* Optimise rest parameters in spread element position and allocate rest array at the earliest common ancestor of all references.
* Generate original number representation when value was not changed.
* Check for invalid binding identifiers when generating inferred method names.
* Don't terminate CLI when watching files fail compilation on init.
* **New Feature**
* Add new plugin API.
* **Internal**
* Split react displayName addition into a plugin.
* Add check for `JSXMemberExpression` to `t.isReferenced`.
* Move `validation.undeclaredVariableCheck` transformer up.
* Start great core-to-plugin exodus.
* Add `BindingIdentifier` virtual type.
* Hidden class optimisations.
* Array allocation optimisations.
* Update `regenerator`.
* Update `js-tokens`.
* Sync with upstream Acorn.
## 5.5.8
* **Internal**
* Remove extremely unprofessional and harsh error message for those hotlinking to `resolve-rc`.
## 5.5.7
* **Bug Fix**
* Push newline after decorators when doing code gen.
* Rewriting error handling to normalise options before merging them.
* Remove duplicate keys in `alias-keys.json` causing errors in strict mode.
* Fix `$ babel --help` not showing optional transformers as such.
* **New Feature**
* Add `auxiliaryCommentBefore` and `auxiliaryCommentAfter` options.
## 5.5.6
* **Bug Fix**
* Fix `let` binding collision in loop head not properly replacing `AssignmentExpression`s.
## 5.5.5
* **Bug Fix**
* Fix `file.opts` not being set before `file.log.deprecate` was called causing a `ReferenceError` as it was checking for a property on it.
## 5.5.4
* **Bug Fix**
* Add back missing `shouldIgnore` check.
* Log message on deprecated options rather than throw an error.
* Fix name of `auxiliaryComment` option when attempting Istanbul interop in `babel/register`.
## 5.5.3
* **Bug Fix**
* Fix weird state bug when traversing overa `node` `ClassProperty` instead of `path` in the `es6.classes` transformer.
## 5.5.2
* **Bug Fix**
* Fix `NodePath#isPure` on `Property` nodes.
* Use cwd instead of entry file directory when working out relative directory for `babel/register`.
* **Internal**
* Add scary warning for those few who choose to use the WIP experimental transformers.
## 5.5.1
* **Bug Fix**
* Remove `ClassProperty` nodes always in the `Flow` transformer. This is fine now since class properties aren't supported in any engine that supports classes but the `es7.classProperties` transformer will need to be updated in the future to desugar to ES6 classes instead of relying on the `es6.classes` transformer from being ran.
## 5.5.0
* **Bug Fix**
* Allow pushing declarations to `SwitchStatement`s.
* Fix `minification.removeDebugger` to remove `DebuggerStatement`s rather than `ExpressionStatement`s with an identifier of `debugger`.
* Check LHS in `ForInStatement` and `ForOfStatement` for constant violations.
* Register function `id` as a reference when naming methods to avoid collisions.
* Support key literals when checking for the existence of `displayName` property when attempting to add it for `React.createClass`.
* Remove `ExportDefaultSpecifier` check from `t.isDefaultSpecifier`.
* Don't consider `JSXIdentifier` HTML tag identifiers to be references.
* **Polish**
* Update `minification.deadCodeElimination` transformer to remove all statements after completion statements.
* Update `minification.deadCodeElimination` transformer to not inline single used bindings that exist in different scopes.
* When performing Istanbul interop in `babel/register`, add the auxiliary comment `"istanbul ignore text"` to get more accurate coverage.
* Add `--nolazy` argument to `babel-node`.
* Add support for `cluster` forking.
* Perform scope tracking in a single pass instead of multiple.
* Smarten up type inferrence and resolution to support the whole array of language constructs.
* Optimise module metadata retrieval into a single pass.
* Ignore trailing commas when inferring newlines.
* Rename `minification.inlineExpressions` transformer to `minification.constantFolding`.
* Check path relative to entry file when checking to see if we're inside `node_modules` when using `babel/register`.
* Upgrade `regenerator`.
## 5.4.7
* **Bug Fix**
* Don't consider `JSXAttribute` `names` to be valid `ReferencedIdentifier`s.
## 5.4.6
* **Bug Fix**
* Fix `spec.functionName` transformer incorrectly attempting to rename a binding that doesn't exist as it's a global.
* **Internal**
* Deprecate custom module formatters.
## 5.4.5
* **Bug Fix**
* Add `JSXIdentifier` as a valid `ReferencedIdentifier` visitor virtual type.
* Ignore `CallExpression` `_prettyCall` when the `retainLines` option is enabled.
* Inherit comments to new declaration node when exploding module declarations.
* Fix `es6.tailCall` transformer failing on calls that exceed the max parameters of the function.
## 5.4.4
* **Bug Fix**
* Fix bug where replacing variable declarations in the head of a `for` loop would turn them into `ExpressionStatement`s.
* Fix renaming of assignment expressions that were non-identifiers ie. patterns.
* Force space before `class` `id` to avoid breaking named classes when using `compact` mode.
* Add assignment pattern explosion to avoid initial duplicate nodes.
* Ignore this and arguments when performing TCO on shadowed functions.
* **Polish**
* Rename `sourceMapName` option to `sourceMapTarget`. Thanks [@getify](https://github.com/getify)!
* Better detection of completion records, ignore those in `Function`s.
* Clarified descriptions of the options that are enabled by default.
* Resolve `\`babel-plugin-${name}\`` plugin names **before** just checking the `name`. Thanks [@jquense](https://github.com/jquense)!
* Update AMD module formatter to add import default remapping.
## 5.4.3
* **Bug Fix**
* Fix `module` being incorrectly rewritten when used as in an export declaration.
* When performing single-reference inlining, ensure that the single reference isn't a child of the binding itself.
* Fix a bug in `minification.deadCodeElimination` where a new binding instance was being created for local class bindings instead of just inheriting the parent one.
* Fix bug with paren printing in `compact` and `retainLines` mode where a left paren was already printed before catching up.
* **Internal**
* Handle contexts for paths much better. This will ensure that the path node location info is in sync.
## 5.4.2
* **Polish**
* `ignore` and `only` patterns are now **very** liberal. The pattern can now exist anywhere in the path.
## 5.4.1
* **Bug Fix**
* Add missing `slash` dependency. Thanks [@browncolyn](https://github.com/browncolyn)!
* **Polish**
* Clean up `shouldIgnore` algorithm to work how you'd expect rather than being a hacky piece of shit. It now crawls the entire path, checking each section of it against the input ignore/only patterns. This means that the pattern `foo` will ignore the paths `foo/bar.js`, `bar/foo` etc.
## 5.4.0
* **New Feature**
* Added [function bind syntax](https://github.com/zenparsing/es-function-bind) behind stage 0. Thanks [@RReverser](https://github.com/rreverser)!
* Added `env` option. Especially handy when using the `.babelrc`.
* **Bug Fix**
* Fix files not properly being ignored when `babel.transform` ignores them when using `$ babel`.
* Fix scope tracking registering loop head bindings to their `VariableDeclaration` instead of `VariableDeclarator`.
* **Polish**
* Normalise path separators for souce map paths when using `$ babel`.
* Rework `PathHoister` to ignore global references and to not deopt on reassignments to referenced bindings, instead it tries to hoist to the highest scope.
* Added missing exponential operator inlining. Thanks [@nkt](https://github.com/nkt)!
* Optimise `regenerator` transformer. Thanks [@benjamn](https://github.com/benjamn)!
## 5.3.3
* **Bug Fix**
* Fix `minification.deadCodeElimination` transformer incorrectly trying to inline import declarations.
* Fix `minification.inlineExpression` transformer getting into an infinite loop.
## 5.3.2
* **Bug Fix**
* Fix patterns not being considered when hoisting variables in the `es6.blockScoping` transformer.
## 5.3.1
* **Bug Fix**
* Fix unique export specifiers not being cloned when exploding class and function exports,
* **Polish**
* Turn import remaps to sequence expressions to remove their context and improve performance.
## 5.3.0
**Speeeeeeed**
![gifs lol](https://31.media.tumblr.com/568205a0e37ae15eca510fa639589a59/tumblr_n8kw8kpcSb1sg6cg8o1_500.gif)
* **Spec Compliance**
* Allow trailing param commas for methods when using the `es7.trailingCommas` transformer.
* **Bug Fix**
* Fix `es6.blockScoping` transformer not properly ignoring `break` in `SwitchCase`.
* Fix lookahead context saving to avoid weird tokenizer state.
* Explode duplicate identifiers in export/import specifiers and property shorthand to create unique objects.
* Skip loose mode for class methods when they have decorators.
* When removing nodes, share their comments with their siblings.
* Properly hoist temp param declarations when doing TCO.
* **Internal**
* Add `--harmony_generators` flag to `$ babel-node`.
* Internal AST traversals have been minimised **drastically**. Transformers have been grouped together which means entire tree traversals are much fewer. Visiting nodes is now also skipped if the traversal context can detect that the handler is a noop. This sames precious cycles as it avoids constructing traversal paths and creating a new traversal context. See issues [#1472](https://github.com/babel/babel/issues/1472) and [#1486](https://github.com/babel/babel/issues/1486) for related discussion.
* **Polish**
* Move many `utility` transformers to `minification`.
## 5.2.17
* **Bug Fix**
* Fix auxiliary comments not properly being attached to function declaration helpers.
* Add `Super` node type to `ast-types` patch.
* Ignore parameter bindings when attempting to inline them in the `minification.deadCodeElimination` transformer.
* Correct `extensions` arguments when using the Babel CLI.
## 5.2.16
* **Bug Fix**
* Fix plugins being disabled when using the whitelist.
* Fix correct function scope being passed to `nameMethod.property` when inferring the function name for class methods.
* Fix incorrect extensions reference causing weird issues when using the Babel CLI.
* Fix destructuring param reference replacements not inheriting from their original param.
* **Spec Compliance**
* Fix order that method decorators are ran in.
## 5.2.15
* **Bug Fix**
* Fix initializer descriptor add attempt if it doesn't exist.
## 5.2.14
* **Bug Fix**
* Fix bug with initializer decorators where the descriptors weren't being defined if there was no `initializer` property.
* **Internal**
* Expose `retainLines` option to CLI.
* Fix `retainLines` option not being taken into consideration when doing multiple variable declaration declarators generation.
* Expose minified and unminified copies of dist scripts.
## 5.2.13
* **Bug Fix**
* Fix `ExportDeclaration`s being incorrectly removed when using the `utility.deadCodeElimination` transformer.
* Fix position of `utility` transformers.
* **New Feature**
* Add built-in `esquery` support.
* **Internal**
* Consolidate notion of "virtual types".
## 5.2.12
* **Polish**
* Make UID generation based on module declarations **much** nicer.
* **Internal**
* Remove internal check for traversal path replacement of self. This is a pattern that **could** come up in the wild and it could lead to pretty nasty code and may lead to internal regressions as the test coverage isn't 100% :( Instead, just put it in the fast path.
## 5.2.11
* **Internal**
* Rename `getModuleName` option to `getModuleId`, doh.
## 5.2.10
* **Bug Fix**
* Fix numerous issues in `replaceWithSourceString`. Thanks [@pangratz](https://github.com/pangratz)!
* **New Feature**
* Add `getModuleName` option. Thanks [@jayphelps](https://github.com/jayphelps)!
## 5.2.9
* **Bug Fix**
* Fix `_blockHoist` transformer incorrectly sorting nodes on shitty environments that aren't spec compliant in their key order.
* Fix broken `parse` API method reference to an undeclared import.
## 5.2.7
* **Bug Fix**
* Move `utility.deadCodeElimination` transformer up to avoid race conditions.
* Fix shorthand property scope binding renaming.
* **Polish**
* Turn helper variable declarations into function declarations if possible.
* **Internal**
* Removed native inheritance support from classes.
* Added `replaceWithSourceString` path API.
* Split up `es3.propertyLiterals` and `es3.memberExpressionLiterals` transformers to `minification.propertyLiterals` and `es3.memberExpressionLiterals`.
## 5.2.6
* **Internal**
* Fix transformer aliases being accidentally set as deprecated ones.
* Expose `Pipeline` as `TransformerPipeline` instead.
## 5.2.5
* **Bug Fix**
* Fix `parse` API not adding all the correct pipeline transformers.
## 5.2.4
* **Bug Fix**
* Fix race condition with the Node API being loaded awkwardly and not being able to initialise itself when used in the browser.
* **Internal**
* Expose `transform.pipeline`.
## 5.2.3
* **Bug Fix**
* Fix plugin containers being called with an undefined import. Thanks [@timbur](https://github.com/timbur)!
* Allow Flow object separators to be commas. Thanks [@monsanto](https://github.com/monsanto)!
* Add missing `Statement` and `Declaration` node aliases to flow types.
## 5.2.2
* **Internal**
* Allow `util.arrayify` to take arbitrary types and coerce it into an array.
## 5.2.1
* **Bug Fix**
* Fix regression in `node/register` that caused `node_modules` to not be ignored.
## 5.2.0
* **Bug Fix**
* Fix plugin strings splitting arbitrarily on `:` which caused full paths on Windows to fail as they include `:` after the drive letter.
* Call class property `initializer`s with their target instead of their descriptor.
* Fix `ignore` and `only` not properly working on Windows path separators. Thanks [@stagas](https://github.com/stagas)!
* Fix `resolveRc` running on files twice causing issues. Thanks [@lukescott](https://github.com/lukescott)!
* Fix shorthand properties not correctly being target for `isReferenced` checks. Thanks [@monsanto](https://github.com/monsanto)!
* **Polish**
* Allow passing an array of globs to `babel/register` `only` and `ignore` options. Thanks [@Mark-Simulacrum](https://github.com/Mark-Simulacrum)!
* When inferring function names that collide with upper bindings, instead of doing the wrapper, instead rename them.
* Consider constant-like variable declaration functions to always refer to themselves so TOC can be performed.
* Process globs manually when using `$ babel` as some shells such as Windows don't explode them. Thanks [@jden](https://github.com/jden)!
* Add alternative way to execute plugins via a closure that's called with the current Babel instance.
* **Internal**
* Remove multiple internal transformers in favor of directly doing things when we need to. Previously, declarations such as `_ref` that we needed to create in specific scopes were done at the very end via the `_declarations` transformer. Now, they're done and added to the scope **right** when they're needed. This gets rid of the crappy `_declarations` property on scope nodes and fixes the crappy regenerator bug where it was creating a new `BlockStatement` so the declarations were being lost.
* Rework transformer traversal optimisation. Turns out that calling a `check` function for **every single node** in the AST is ridiculously expensive. 300,000 nodes timesed by ~30 transformers meant that it took tens of seconds to perform while it's quicker to just do the unnecessary traversal. Seems obvious in hindsight.
* **New Feature**
* Add `jscript` transformer that turns named function expressions into function declarations to get around [JScript's horribly broken function expression semantics](https://kangax.github.io/nfe/#jscript-bugs). Thanks [@kondi](https://github.com/kondi)!
* Add `@@hasInstance` support to objects when using the `es6.spec.symbols` transformer.
* Add `retainLines` option that retains the line (but not the columns!) of the input code.
## 5.1.13
* **Polish**
* Remove symbol check from `defineProperty` helper.
## 5.1.12
* **Bug Fix**
* Fix `resolveModuleSource` not being ran on `ExportAllDeclaration`s.
* Fix `.babelrc` being resolved multiple times when using the require hook.
* Fix parse error on spread properties in assignment position.
* Fix `externalHelpers` option being incorrectly listed as type `string`.
* **Internal**
* Upgrade `core-js` to `0.9.0`.
* **Spec Compliance**
* Fix object decorators not using the `initializer` pattern.
* Remove property initializer descriptor reflection.
## 5.1.11
* **Bug Fix**
* Memoise and bind member expression decorators.
* Move JSX children cleaning to opening element visitor. Fixes elements not being cleaned in certain scenarios.
* Consider `SwitchStatement`s to be `Scopable`.
* Fix `bluebirdCoroutines` calling `interopRequireWildcard` before it's defined.
* Add space to `do...while` code generation.
* Validate `super` use before `this` on `super` exit rather than entrance.
* **Polish**
* Add Babel name to logger.
## 5.1.10
* **Bug Fix**
* Remove `makePredicate` from acorn in favor of an `indexOf`.
* Remove statements to expression explosion when inserting a block statement.
* **Internal**
* Remove runtime compatibility check.
## 5.1.9
* **Bug Fix**
* Fix class property initializers with `undefined` values not being correctly writable.
* Fix self inferring generators incorrectly causing a stack error.
* Fix default export specifiers not triggering AMD `module` argument inclusion.
* Fix assignments not having their module references properly remapped.
* **Internal**
* Upgrade to latest `acorn`.
* **Polish**
* Make invalid LHS pattern error messages nicer.
## 5.1.8
* **Bug Fix**
* Only make parenthesized object pattern LHS illegal.
## 5.1.7
* **Internal**
* Add `parse` node API.
## 5.1.6
* **Bug Fix**
* Fix `runtime` built-in catchall not properly checking for local variables.
## 5.1.5
* **Internal**
* Bump `core-js` version.
## 5.1.4
* **Polish**
* Add missing `Reflect` methods to runtime transformer.
## 5.1.3
* **Internal**
* Switch entirely to vanilla regenerator.
* Clean up and make the parsing of decorators stateless.
* **Bug Fix**
* Don't do TCO on generators and async functions.
* Add missing `core-js` runtime definitions.
## 5.1.2
* **Bug Fix**
* Add `getIterator` and `isIterable` to `babel-runtime` build script.
## 5.1.1
* **Bug Fix**
* Add missing runtime symbol definitions.
## 5.1.0
* **Bug Fix**
* Fix super reference when using decorators.
* Don't do array unpack optimisation when member expressions are present.
* Add missing descriptors for undecorated class properties.
* Don't consider `arguments` and `eval` valid function names when doing function name inferrence.
* Fix scope tracking of constants in loop heads.
* Parse `AwaitExpression` as a unary instead of an assignment.
* Fix regex evaluation when attempting static evaluation.
* Don't emit tokens when doing a lookahead.
* Add missing `test` declaration to `utility.deadCodeElimination` transformer.
* **Internal**
* Upgrade `regenerator` to the latest and use my branch with the hope of eventually switching to vanilla regenerator.
* Add support for the replacement of for loop `init`s with statements.
* Upgrade dependencies.
* **Polish**
* When adding the scope IIFE when using default parameters, don't shadow the function expression, just `apply` `this` and `arguments` if necessary.
* Use path basename as non-default import fallback.
* **New Feature**
* Add [trailing function comma proposal](https://github.com/jeffmo/es-trailing-function-commas). Thanks [@AluisioASG](https://github.com/AluisioASG)!
* Add support for object literal decorators.
* Make core-js modular when using the `runtime` transformer.
## 5.0.12
* **Bug Fix**
* Fix incorrect remapping of module references inside of a function id redirection container.
## 5.0.11
* **Bug Fix**
* Fix new `for...of` loops not properly inheriting their original loop.
* **Internal**
* Disable scope instance cache.
* **Polish**
* Allow comments in `.babelrc` JSON.
## 5.0.9
* **Polish**
* Use `moduleId` for UMD global name if available.
* **Bug Fix**
* Fix UMD global `module` variable shadowing the `amd`/`common` `module` variable.
* Fix Flow param type annotation regression.
* Fix function name collision `toString` wrapper. Thanks [@alawatthe](https://github.com/alawatthe)!
## 5.0.8
* **Bug Fix**
* Fix falsy static class properties not being writable.
* Fix block scoping collisions not properly detecting modules and function clashes.
* Skip `this` before `super` for derived constructors on functions.
## 5.0.7
* **New Feature**
* Add `--ignore` and `--only` support to the CLI.
* **Bug Fix**
* Remove `HOMEPATH` environment variable from home resolution in `babel/register` cache.
* **Internal**
* Disable WIP path resolution introducing infinite recursion in some code examples.
* **Polish**
* Add live binding to CommonJS default imports.
## 5.0.6
* **Bug Fix**
* Fix mangling of import references that collide with properties on `Object.prototype`.
* Fix duplicate declarations incorrectly being reported for `var`.
## 5.0.5
* **Internal**
* Upgrade `core-js`.
* **Bug Fix**
* Fix arrays not being supported in `util.list`.
## 5.0.4
* **Polish**
* Check for top level `breakConfig` in `resolveRc`.
## 5.0.3
* **Bug Fix**
* Make relative location absolute before calling `resolveRc`.
* **Internal**
* Switch to global UID registry.
* Add `breakConfig` option to prevent Babel from erroring when hitting that option.
## 5.0.1
* **Bug Fix**
* Fix duplicate declaration regression.
* Fix not being able to call non-writable methods.
## 5.0.0
* **New Feature**
* Decorators based on [@wycat's](https://github.com/wycats) [stage 1 proposal](https://github.com/wycats/javascript-decorators).
* Class property initializers based on [@jeffmo's](https://github.com/jeffmo) [stage 0 proposal](https://gist.github.com/jeffmo/054df782c05639da2adb).
* Export extensions based on [@leebyron's](https://github.com/leebyron) [stage 1 proposal](https://github.com/leebyron/ecmascript-more-export-from).
* UMD module formatter now supports globals.
* Add `es3.runtime`, `optimisation.react.inlineElements` and `optimisation.react.constantElements` transformers.
* Add stage option that replaces the experimental one.
* Allow ES7 transformer to be enabled via `optional` instead of only via `stage`.
* Infer string quotes to use in the code generator.
* Consider `export { foo as default };` to be the same as `export default foo;`.
* Add `nonStandard` option that can be set to `false` to remove parser support for JSX and Flow.
* Add `jsxPragma` option.
* Automatically generate CLI options based on internal API options.
* Add support for `.babelrc` on absolute paths.
* Plugin API!
* **Internal**
* Export `options` in browser API.
* Rewritten parser.
* Don't block hoist when runtime transformer is enabled in system module formatter.
* Rewritten the internal traversal and node replacement API to use "paths" that abstracts out node relationships.
* **Polish**
* JSX output is now more inline with the official JSX transformer.
* Hoist block scoping IIFE - this improves memory usage and performance.
* Better IIFE detection - references are now checked to see if they're referencing the binding we're searching for.
* Check for import reassignments in constants transformer.
* Make method definitions with expression bodies illegal.
* Save register cache on tick instead of `SIGINT`.
* Enable strict mode on babel-node eval flag.
* **Bug Fixes**
* Add support for live bindings. This change also increases the reliability of export specifier renaming.
* Add support for super update and non equals assignment expressions.
* Rename shadow constructor binding in classes.
* Seed next iteration bindings with previous fresh bindings when reassigning loop block scoped variables.
* Fix new expression spread referencing the wrong constructor.
* Call `resolveModuleSource` on dynamic imports.
* Added `param` to list of duplicate declaration kinds.
* **Breaking Changes**
* The Babel playground has been removed.
* ES7 Abstract References have been removed.
* Experimental option has been removed in favor of a stage option.
* Rename `returnUsedHelpers` to `metadataUsedHelpers`.

4016
.github/CHANGELOG-v6.md vendored Normal file

File diff suppressed because it is too large Load Diff

6
.github/ISSUE_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,6 @@
<!---
Thanks for filing an issue 😄 ! Before you submit, please read the following:
Check the other issue templates if you are trying to submit a bug report, feature request, or question
Search open/closed issues before submitting since someone might have asked the same thing before!
-->

44
.github/ISSUE_TEMPLATE/Bug_report.md vendored Normal file
View File

@@ -0,0 +1,44 @@
---
name: "\U0001F41B Bug Report"
about: "If something isn't working as expected \U0001F914."
title: ''
labels: 'i: bug, i: needs triage'
assignees: ''
---
## Bug Report
**Current Behavior**
A clear and concise description of the behavior.
**Input Code**
- REPL or Repo link if applicable:
```js
var your => (code) => here;
```
**Expected behavior/code**
A clear and concise description of what you expected to happen (or code).
**Babel Configuration (.babelrc, package.json, cli command)**
```js
{
"your": { "config": "here" }
}
```
**Environment**
- Babel version(s): [e.g. v6.0.0, v7.0.0-beta.34]
- Node/npm version: [e.g. Node 8/npm 5]
- OS: [e.g. OSX 10.13.4, Windows 10]
- Monorepo: [e.g. yes/no/Lerna]
- How you are using Babel: [e.g. `cli`, `register`, `loader`]
**Possible Solution**
<!--- Only if you have suggestions on a fix for the bug -->
**Additional context/Screenshots**
Add any other context about the problem here. If applicable, add screenshots to help explain.

View File

@@ -0,0 +1,23 @@
---
name: "\U0001F680 Feature Request"
about: "I have a suggestion (and may want to implement it \U0001F642)!"
title: ''
labels: 'i: enhancement, i: needs triage'
assignees: ''
---
## Feature Request
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I have an issue when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen. Add any considered drawbacks.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Teachability, Documentation, Adoption, Migration Strategy**
If you can, explain how users will be able to use this and possibly write out a version the docs.
Maybe a screenshot or design?

45
.github/ISSUE_TEMPLATE/Regression-v7.md vendored Normal file
View File

@@ -0,0 +1,45 @@
---
name: "\U0001F4A5 v7 Regression"
about: Report an unexpected behavior in v7 from v6 (Check the upgrade guide first
✌️)
title: ''
labels: 'i: bug, 7.x: regression, i: needs triage'
assignees: ''
---
# v7 Regression
> First check out: https://babeljs.io/docs/en/v7-migration
> Also a partial upgrade tool: https://github.com/babel/babel-upgrade
**Potential Commit/PR that introduced the regression**
If you have time to investigate, what PR/date introduced this issue.
**Describe the regression**
A clear and concise description of what the regression is.
**Input Code**
<!--- If you have link to our REPL or a standalone repo please link that! -->
```js
var your => (code) => here;
```
**Babel Configuration (.babelrc, package.json, cli command)**
```js
{
"your": { "config": "here" }
}
```
**Expected behavior/code**
A clear and concise description of what you expected to happen (or code).
**Environment**
- Babel version(s): [e.g. v6.0.0, v7.0.0-beta.34]
- Node/npm version: [e.g. Node 8/npm 5]
- OS: [e.g. OSX 10.13.4, Windows 10]
- Monorepo [e.g. yes/no/Lerna]
- How you are using Babel: [e.g. `cli`, `register`, `loader`]

View File

@@ -0,0 +1,19 @@
---
name: "\U0001F917 Support Question"
about: "If you have a question \U0001F4AC, please check out our Slack or StackOverflow!"
title: ''
labels: 'i: question, i: needs triage'
assignees: ''
---
--------------^ Click "Preview" for a nicer view!
We primarily use GitHub as an issue tracker; for usage and support questions, please check out these resources below. Thanks! 😁.
---
* Slack Community Chat: https://babeljs.slack.com (you can sign-up at https://slack.babeljs.io/ for an invite)
* StackOverflow: https://stackoverflow.com/questions/tagged/babeljs using the tag `babeljs`
* Twitter: If it's just a quick question you can ping our Twitter: https://twitter.com/babeljs
* Also have a look at the readme for more information on how to get support:
https://github.com/babel/babel/blob/master/README.md

28
.github/ISSUE_TEMPLATE/Support_us.md vendored Normal file
View File

@@ -0,0 +1,28 @@
---
name: "\U0001F91D Support us on Babel"
about: "If you would like to support our efforts in maintaining this community-driven
project \U0001F64C!"
title: ''
labels: ''
assignees: ''
---
--------------^ Click "Preview" for a nicer view!
> Open Collective: https://opencollective.com/babel
> Henry's Patreon: https://www.patreon.com/henryzhu
Help support Babel!
Babel has always been a community project, not really backed or owned by any single (or group) of companies. While some maintainers used to work at Facebook (and Henry at Adobe) no one was working on it full time and there certainly isn't a huge company or team anywhere doing all this work.
---
As a group of volunteers you can help us in a few ways
- Giving developer time on the project. (Message us on [Twitter](https://twitter.com/babeljs) or [Slack](https://slack.babeljs.io/) for guidance). Companies should be paying their employees to contribute back to the open source projects they use everyday.
- Giving funds by becoming one of our sponsors/donators!
If you'd like to sustain the future of the project as a whole, we have an [Open Collective](https://opencollective.com/babel) that you can donate to. This is a way for funds to be allocated to the core team.
You can also support [Henry](https://github.com/hzoo) directly since I [left my job to work on Babel and Open Source full time](https://twitter.com/left_pad/status/969793227862790144) at my [Patreon](https://www.patreon.com/henryzhu).

23
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,23 @@
<!--
Before making a PR, please read our contributing guidelines
https://github.com/babel/babel/blob/master/CONTRIBUTING.md
Please note that the Babel Team requires two approvals before merging most PRs.
For issue references: Add a comma-separated list of a [closing word](https://help.github.com/articles/closing-issues-via-commit-messages/) followed by the ticket number fixed by the PR. (it should be underlined in the preview if done correctly)
If you are making a change that should have a docs update: submit another PR to https://github.com/babel/website
-->
| Q                       | A <!--(Can use an emoji 👍) -->
| ------------------------ | ---
| Fixed Issues? | `Fixes #1, Fixes #2` <!-- remove the (`) quotes and write "Fixes" before the number to link the issues -->
| Patch: Bug Fix? |
| Major: Breaking Change? |
| Minor: New Feature? |
| Tests Added + Pass? | Yes
| Documentation PR Link | <!-- If only readme change, add `[skip ci]` to your commits -->
| Any Dependency Changes? |
| License | MIT
<!-- Describe your changes below in as much detail as possible -->

12
.github/lock.yml vendored Normal file
View File

@@ -0,0 +1,12 @@
# Configuration for lock-threads - https://github.com/dessant/lock-threads
# Number of days of inactivity before a closed issue or pull request is locked
daysUntilLock: 91
# Comment to post before locking. Set to `false` to disable
lockComment: false
# The label to be applied when an issue is locked
lockLabel: 'outdated'
# Issues or pull requests with these labels will not be locked
# exemptLabels:
# - no-locking

81
.github/workflows/issue-triage.yml vendored Normal file
View File

@@ -0,0 +1,81 @@
name: Issue Triage
on:
issues:
types: [opened, labeled]
jobs:
welcome:
name: Welcome comment
runs-on: ubuntu-latest
steps:
- name: Check if Babel member
id: is_babel_member
if: github.event.action == 'opened'
uses: babel/actions/is-org-member@v2
with:
org: babel
username: ${{ github.event.issue.user.login }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Create Welcome Comment
uses: babel/actions/create-comment@v2
if: |
github.event.action == 'opened' &&
steps.is_babel_member.outputs.result == 0
with:
token: ${{ secrets.BOT_TOKEN }}
issue: ${{ github.event.issue.number }}
comment: >
Hey @${{ github.event.issue.user.login }}!
We really appreciate you taking the time to report an issue. The
collaborators on this project attempt to help as many people as
possible, but we're a limited number of volunteers, so it's
possible this won't be addressed swiftly.
If you need any help, or just have general Babel or JavaScript questions, we have a
vibrant [Slack community](https://babeljs.slack.com) that typically always has someone
willing to help. You can sign-up [here](https://slack.babeljs.io/) for an invite."
needs_info:
name: Needs Info
runs-on: ubuntu-latest
steps:
- name: Create Needs Info Comment
uses: babel/actions/create-comment@v2
if: |
github.event.action == 'labeled' &&
github.event.label.name == 'Needs Info'
with:
token: ${{ secrets.BOT_TOKEN }}
issue: ${{ github.event.issue.number }}
comment: >
Hi @${{ github.event.issue.user.login }}!
This issue is missing some important information we'll need
to be able to reproduce this issue.
Please understand that we receive a high volume of issues,
and there are only a limited number of volunteers that help
maintain this project. The easier it is for us to decipher an
issue with the info provided, the more likely it is that we'll
be able to help.
Please make sure you have the following information documented in
this ticket:
1. Your Babel configuration (typically from `.babelrc` or `babel.config.js`)
2. The current (incorrect) behavior you're seeing
3. The behavior you expect
4. A [short, self-contained example](http://sscce.org/)
Please provide either a link to the problem via the
[`repl`](https://babeljs.io/repl/), or if the `repl` is
insufficient, a new and minimal repository with instructions on
how to build/replicate the issue.

53
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,53 @@
name: Release
on:
push:
tags: ["v*"]
jobs:
github_release:
name: Trigger GitHub release
runs-on: ubuntu-latest
steps:
- name: Checkout the new tag
uses: actions/checkout@v1.0.0
- name: Get tag info
id: tags
uses: babel/actions/get-release-tags@v2
- name: Generate the changelog
id: changelog
uses: babel/actions/generate-lerna-changelog@v2
with:
from: ${{ steps.tags.outputs.old }}
to: ${{ steps.tags.outputs.new }}
env:
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
- name: Create a draft GitHub release
uses: babel/actions/publish-github-release@v2
with:
tag: ${{ steps.tags.outputs.new }}
changelog: ${{ steps.changelog.outputs.changelog }}
token: ${{ secrets.BOT_TOKEN }}
- name: Check if releasing from master
id: is_master
uses: babel/actions/ref-matches-branch@v2
with:
name: master
- name: Update CHANGELOG.md
if: steps.is_master.outputs.result == 1
uses: babel/actions/update-changelog@v2
with:
changelog: ${{ steps.changelog.outputs.changelog }}
- name: Commit CHANGELOG.md
if: steps.is_master.outputs.result == 1
run: |
git add CHANGELOG.md
git -c user.name="Babel Bot" -c user.email="babel-bot@users.noreply.github.com" \
commit -m "Add ${{ steps.tags.outputs.new }} to CHANGELOG.md [skip ci]" --no-verify --quiet
git push "https://babel-bot:${{ secrets.BOT_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" master

63
.gitignore vendored
View File

@@ -1,17 +1,62 @@
.npmrc
.DS_Store
node_modules
test/core/tmp
/node_modules
/.github/actions/*/node_modules
/packages/*/node_modules
/packages/*/LICENSE
!/packages/babel-parser/LICENSE
!/packages/babel-plugin-transform-object-assign/LICENSE
*.log
*.cache
/templates.json
/tests.json
/build
/.eslintcache
/browser.js
/browser-polyfill.js
/runtime.js
coverage
dist
.package.json
packages/babel-runtime/core-js
packages/babel-runtime/helpers/*.js
packages/babel-runtime/regenerator/*.js
lib
/.package.json
package-lock.json
!/.github/actions/*/package-lock.json
/packages/babel-runtime/helpers/*.js
!/packages/babel-runtime/helpers/toArray.js
!/packages/babel-runtime/helpers/iterableToArray.js
!/packages/babel-runtime/helpers/temporalRef.js
/packages/babel-runtime/helpers/esm/*.js
!/packages/babel-runtime/helpers/esm/toArray.js
!/packages/babel-runtime/helpers/esm/iterableToArray.js
!/packages/babel-runtime/helpers/esm/temporalRef.js
/packages/babel-runtime-corejs2/helpers/*.js
!/packages/babel-runtime-corejs2/helpers/toArray.js
!/packages/babel-runtime-corejs2/helpers/iterableToArray.js
!/packages/babel-runtime-corejs2/helpers/temporalRef.js
/packages/babel-runtime-corejs2/helpers/esm/*.js
!/packages/babel-runtime-corejs2/helpers/esm/toArray.js
!/packages/babel-runtime-corejs2/helpers/esm/iterableToArray.js
!/packages/babel-runtime-corejs2/helpers/esm/temporalRef.js
/packages/babel-runtime-corejs2/core-js/**/*.js
!/packages/babel-runtime-corejs2/core-js/map.js
/packages/babel-runtime-corejs3/helpers/*.js
/packages/babel-runtime-corejs3/helpers/esm/*.js
/packages/babel-runtime-corejs3/core-js/**/*.js
/packages/babel-runtime-corejs3/core-js-stable/**/*.js
/packages/babel-register/test/.babel
/packages/babel-cli/test/tmp
/packages/babel-node/test/tmp
/packages/*/lib
.nyc_output
/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/babel-parser/build
.idea/
/.changelog

3
.gitmodules vendored
View File

@@ -1,3 +0,0 @@
[submodule "vendor/traceur"]
path = vendor/traceur
url = https://github.com/google/traceur-compiler

View File

@@ -1,2 +0,0 @@
instrumentation:
root: lib

View File

@@ -1,15 +0,0 @@
*.log
*.cache
.*
/lib/babel/transformation/templates
/test
/benchmark
/Makefile
/dist
/tests.json
/CHANGELOG.md
/.package.json
/coverage
/vendor
/packages
/src

5
.prettierignore Normal file
View File

@@ -0,0 +1,5 @@
package.json
packages/babel-preset-env/data
packages/*/test/fixtures/**/input.*
packages/*/test/fixtures/**/exec.*
packages/*/test/fixtures/**/output.*

23
.prettierrc Normal file
View File

@@ -0,0 +1,23 @@
{
"arrowParens": "avoid",
"trailingComma": "es5",
"useTabs": false,
"semi": true,
"singleQuote": false,
"bracketSpacing": true,
"jsxBracketSameLine": false,
"tabWidth": 2,
"printWidth": 80,
"overrides": [{
"files": [
"**/codemods/*/src/**/*.js",
"**/codemods/*/test/**/*.js",
"**/packages/*/src/**/*.js",
"**/packages/*/test/**/*.js"
],
"parser": "babylon",
"options": {
"trailingComma": "all"
}
}]
}

View File

@@ -1,19 +1,60 @@
#sudo: false
git:
depth: 5
language: node_js
cache:
directories:
- node_modules
node_js:
- "0.12"
- "iojs"
yarn: true
before_script: "npm install -g codeclimate-test-reporter"
script: "make test-travis"
os: linux
env:
global:
- PATH=$HOME/.yarn/bin:$PATH
- JOB=test
install: skip
before_script:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- if [ "$TRAVIS_OS_NAME" = "windows" ]; then choco install make; fi
script:
- if [ "$JOB" = "test" ]; then make -j test-ci; fi
- if [ "$JOB" = "lint" ]; then make -j code-quality-ci; fi
- if [ "$JOB" = "babel-parser-flow-tests" ]; then make -j test-flow-ci; fi
- if [ "$JOB" = "babel-parser-test262-tests" ]; then make -j test-test262-ci; fi
matrix:
fast_finish: true
include:
- node_js: "node"
env: JOB=lint
# We test the latest version on circleci
- node_js: "12"
# Move `windows` build to be the third since it is slow
- os: windows
node_js: "node"
env:
- JOB=test
# https://travis-ci.community/t/build-doesnt-finish-after-completing-tests/288/9
- YARN_GPG=no
# Continue node_js matrix
- node_js: "6"
- node_js: "10"
- node_js: "8"
- node_js: "node"
env: JOB=babel-parser-flow-tests
- node_js: "node"
env: JOB=babel-parser-test262-tests
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/acf1870e9d223c65e8d5
on_success: always
slack:
on_success: change
on_failure: always
on_start: false
rooms:
# Generate with
# travis encrypt "babeljs:<token>#activity" --add notifications.slack.rooms
# where <token> is from the Slack integration settings.
secure: SrwPKRe2AiNAKRo/+2yW/x4zxbWf2FBXuBuuPkdTJVTpWe++Jin1lXYJWTKP1a1i/IbmhffBO9YZcUFbeuXJpRM083vO8VYpyuBMQRqWD+Z3o+ttPlHGOJgnj0nkIcGRk6k7PpyHNnIkixfEJDvbbg9lN1Jswb3xkL8iYIHpuFE=
branches:
except:
- /^v\d+\.\d+\.\d+$/

File diff suppressed because it is too large Load Diff

View File

@@ -1,13 +1,74 @@
# Contributor Code of Conduct
# Contributor Covenant Code of Conduct
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
## Our Pledge
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to make participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
## Our Standards
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
Examples of behavior that contributes to creating a positive environment
include:
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting Henry Zhu <hi@henryzoo.com>, Logan Smyth <loganfsmyth@gmail.com> or one of the other [Babel core team members](https://babeljs.io/team). All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/

View File

@@ -1,27 +1,53 @@
<p align="center">
----
<p align="center" class="toc">
<strong><a href="#setup">Setup</a></strong>
|
<strong><a href="#running-tests">Running tests</a></strong>
<strong><a href="#running-lintingtests">Running linting/tests</a></strong>
|
<strong><a href="#workflow">Workflow</a></strong>
<strong><a href="#writing-tests">Writing tests</a></strong>
|
<strong><a href="#dependencies">Dependencies</a></strong>
<strong><a href="#debugging-code">Debugging code</a></strong>
|
<strong><a href="#code-standards">Code Standards</a></strong>
<strong><a href="#internals">Internals</a></strong>
</p>
----
# Contributing
Contributions are always welcome, no matter how large or small. Before
contributing, please read the
[code of conduct](https://github.com/babel/babel/blob/master/CODE_OF_CONDUCT.md).
## 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/blob/master/packages/babel-parser/ast/spec.md) is a bit different from [ESTree](https://github.com/estree/estree). The differences are listed [here](https://babeljs.io/docs/en/next/babel-parser.html#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
- When you feel ready to jump into the Babel source code, a good place to start is to look for issues tagged with [help wanted](https://github.com/babel/babel/labels/help%20wanted) and/or [good first issue](https://github.com/babel/babel/labels/good%20first%20issue).
- Follow along with what we are working on by joining our [Slack](https://babeljs.slack.com) (you can sign-up [here](https://slack.babeljs.io/)
for an invite), following our announcements on [Twitter](https://twitter.com/babeljs), and reading (or participating!) in our [meeting notes](https://github.com/babel/notes).
- Check out our [website](http://babeljs.io/) and the [repo](https://github.com/babel/website)
- You can contribute by triaging issues which may include reproducing bug reports or asking for vital information, such as version numbers or reproduction instructions. If you would like to start triaging issues, one easy way to get started is to [subscribe to babel on CodeTriage](https://www.codetriage.com/babel/babel). [![Open Source Helpers](https://www.codetriage.com/babel/babel/badges/users.svg)](https://www.codetriage.com/babel/babel)
## Chat
Feel free to check out the `#discussion`/`#development` channels on our [Slack](https://slack.babeljs.io) (you can sign-up [here](https://slack.babeljs.io/) for an invite). Some of us are always online to chat!
## Developing
#### Setup
**Note:** Versions `< 5.1.10` can't be built.
Babel is built for Node 6 and up but we develop using Node 8 and yarn. You can check this with `node -v`.
Make sure that Yarn is installed with version >= `0.28.0`.
Installation instructions can be found here: https://yarnpkg.com/en/docs/install.
### Setup
```sh
$ git clone https://github.com/babel/babel
@@ -32,138 +58,267 @@ $ make bootstrap
Then you can either run:
```sh
$ make build-core
$ make build
```
to build Babel **once** or:
```sh
$ make watch-core
$ make watch
```
to have Babel build itself then incrementally build files on change.
to have Babel build itself and incrementally build files on change.
#### Running tests
You can access the built files for individual packages from `packages/<package-name>/lib`.
You can run tests via:
If you wish to build a copy of Babel for distribution, then run:
```sh
$ make build-dist
```
### Running linting/tests
You can run lint via:
```sh
# ~6 sec on a MacBook Pro (Mid 2015)
$ make lint
```
You can run eslint's autofix via:
```sh
$ make fix
```
You can run tests + lint for all packages (slow) via:
```sh
# ~46 sec on a MacBook Pro (Mid 2015)
$ make test
```
This is mostly overkill and you can limit the tests to a select few by directly
running them with `mocha`:
If you just want to run all tests:
```sh
$ mocha test/core/transformation.js
# ~40 sec on a MacBook Pro (Mid 2015)
$ make test-only
```
Use mocha's `--grep` option to run a subset of tests by name:
Most likely you'll want to focus in on a specific issue.
To run tests for a specific package in [packages](https://github.com/babel/babel/tree/master/packages), you can use the `TEST_ONLY` environment variable:
```sh
$ mocha test/core/transformation.js --grep es7
$ TEST_ONLY=babel-cli make test
```
If you don't have `mocha` installed globally, you can still use it from Babel's
dependencies in `node_modules`, but make sure `node_modules/.bin` is added to
your [`$PATH`](http://unix.stackexchange.com/questions/26047/how-to-correctly-add-a-path-to-path) environment variable.
`TEST_ONLY` will also match substrings of the package name:
```sh
# Run tests for the @babel/plugin-transform-classes package.
$ TEST_ONLY=babel-plugin-transform-classes make test
```
#### Workflow
Use the `TEST_GREP` variable to run a subset of tests by name:
* Fork the repository
* Clone your fork and change directory to it (`git clone git@github.com:yourUserName/babel.git && cd babel`)
* Install the project dependencies (`make bootstrap`)
* Link your forked clone (`npm link`)
* Develop your changes ensuring you're fetching updates from upstream often
* Ensure the test are passing (`make test`)
* Create new pull request explaining your proposed change or reference an issue in your commit message
```sh
$ TEST_GREP=transformation make test
```
Substitute spaces for hyphens and forward slashes when targeting specific test names:
#### Dependencies
```sh
$ TEST_GREP="arrow functions destructuring parameters" make test
```
+ [ast-types](http://ghub.io/ast-types) This is required to monkeypatch regenerators AST definitions. Could be improved in the future.
To enable the Node.js debugger added in v6.3.0, set the `TEST_DEBUG` environment variable:
+ [chalk](http://ghub.io/chalk) This is used for terminal color highlighting for syntax errors.
```sh
$ TEST_DEBUG=true make test
```
+ [convert-source-map](http://ghub.io/convert-source-map) Turns a source map object into a comment etc.
You can combine `TEST_DEBUG` with `TEST_GREP` or `TEST_ONLY` to debug a subset of tests. If you plan to stay long in the debugger (which you'll likely do!), you may increase the test timeout by editing [test/mocha.opts](https://github.com/babel/babel/blob/master/test/mocha.opts).
+ [core-js](http://ghub.io/core-js) Used for the polyfill.
To overwrite any test fixtures when fixing a bug or anything, add the env variable `OVERWRITE=true`
+ [debug](http://ghub.io/debug) Used to output debugging information when NODE_DEBUG is set to babel.
```sh
$ OVERWRITE=true TEST_ONLY=babel-plugin-transform-classes make test-only
```
+ [detect-indent](http://ghub.io/detect-indent) This is used in the code generator so it can infer indentation.
To test the code coverage, use:
+ [estraverse](http://ghub.io/estraverse) The only method on this is attachComments. I'd like to implement our own comment attachment algorithm eventually though.
```sh
$ BABEL_ENV=cov make build
$ ./scripts/test-cov.sh
```
+ [esutils](http://ghub.io/esutils) Various ES related utilities. Check whether something is a keyword etc.
#### Troubleshooting Tests
+ [fs-readdir-recursive](http://ghub.io/fs-readdir-recursive) Recursively search a directory for.
In case you're not able to reproduce an error on CI locally, it may be due to
+ [globals](http://ghub.io/globals) A list of JavaScript global variables. This is used by the scope tracking to check for colliding variables.
- Node Version: Travis CI runs the tests against all major node versions. If your tests use JavaScript features unsupported by lower versions of node, then use [minNodeVersion option](#writing-tests) in options.json.
- Timeout: Check the CI log and if the only errors are timeout errors and you are sure that it's not related to the changes you made, ask someone in the slack channel to trigger rebuild on the CI build and it might be resolved
+ [is-integer](http://ghub.io/is-integer) Checks if something is an integer.
In case you're locally getting errors which are not on the CI, it may be due to
+ [js-tokens](http://ghub.io/js-tokens) This is used to get tokens for syntax error highlighting.
- Updates in Dependencies: Make sure you run `make bootstrap` before you run `make build` or `make watch` before you run the tests.
+ [leven](http://ghub.io/leven) A levenstein algorithm to determine how close a word is to another. This is used to offer suggestions when using the utility.undeclaredVariableCheck transformer.
### Writing tests
+ [line-numbers](http://ghub.io/line-numbers) Used to produce the code frames in syntax errors.
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).
+ [lodash](http://ghub.io/lodash) Used for various utilities.
#### `@babel/plugin-x`
+ [minimatch](http://ghub.io/minimatch) This is used to match glob-style ignore/only filters.
All the Babel plugins (and other packages) that have a `/test/fixtures` are written in a similar way.
+ [output-file-sync](http://ghub.io/output-file-sync) Synchronously writes a file and create its ancestor directories if needed.
For example, in [`@babel/plugin-transform-exponentiation-operator/test`](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-exponentiation-operator/test):
+ [path-is-absolute](http://ghub.io/path-is-absolute) Checks if a path is absolute. C:\foo and \foo are considered absolute.
- 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/plugin-transform-exponentiation-operator"] }`.
- If necessary, you can have an `options.json` with different options in each subfolder.
+ [regenerator](http://ghub.io/regenerator) This is used to transform generators/async functions.
- 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 [`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. This kind of test only works in sub-subdirectories of `/fixtures`, i.e. `/fixtures/exponentian-operator/binary/input.js` and **not** `/fixtures/exponentian-operator/input.js`.
- 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.
+ [regexpu](http://ghub.io/regexpu) Used to transform unicode regex patterns.
In a fixture test, you simply write out the code you want to transform in `input.js`.
+ [repeating](http://ghub.io/repeating) Repeats a string.
```js
// input.js
2 ** 2;
```
+ [shebang-regex](http://ghub.io/shebang-regex) Literally just a regex that matches shebangs.
and the expected output after transforming it with your `options.json` in `output.js`.
+ [slash](http://ghub.io/slash) Normalises path separators.
```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.
+ [source-map](http://ghub.io/source-map) Generates sourcemaps.
```js
// exec.js
expect(2 ** 3).toBe(8);
expect(3 * 2 ** 3).toBe(24);
```
+ [source-map-support](http://ghub.io/source-map-support) Adds source map support to babel-node/babel/register.
If you need to check for an error that is thrown you can add to the `options.json`
+ [strip-json-comments](http://ghub.io/strip-json-comments) Remove comments from a JSON string. This is used for .babelrc files.
```js
// options.json example
{
"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)"
}
```
+ [to-fast-properties](http://ghub.io/to-fast-properties) A V8 trick to put an object into fast properties mode.
If the test requires a minimum Node version, you can add `minNodeVersion` (must be in semver format).
+ [trim-right](http://ghub.io/trim-right) Trims the rightside whitespace.
```js
// options.json example
{
"minNodeVersion": "5.0.0"
}
```
+ [user-home](http://ghub.io/user-home) Gets the users home directory. This is used to resolve the babel-node/babel/register cache.
#### `@babel/parser` (babylon)
Writing tests for the babel parser is very
similar to the other packages.
Inside the `packages/babel-parser/test/fixtures` folder are categories/groupings of test fixtures (es2015, flow,
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:
#### Code Standards
* Create an `input.js` file that contains the code you want the babel parser to parse.
* **General**
* Max of five arguments for functions
* Max depth of four nested blocks
* 2-spaced soft tabs
* 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.
* **Naming**
* CamelCase all class names
* camelBack all variable names
After writing tests for @babel/parser, just build it by running:
* **Spacing**
* Spaces after all keywords
* Spaces before all left curly braces
```sh
$ make build
```
* **Comments**
* Use JSDoc-style comments for methods
* Single-line comments for ambiguous code
Then, to run the tests, use:
* **Quotes**
* Always use double quotes
* Only use single quotes when the string contains a double quote
```sh
$ TEST_ONLY=babel-parser make test-only
```
* **Declaration**
* No unused variables
* No pollution of global variables and prototypes
#### Bootstrapping expected output
For both `@babel/plugin-x` and `@babel/parser`, you can easily generate an `output.js`/`output.json` automatically by just providing `input.js` and running the tests as you usually would.
```
// Example
- packages
- babel-parser
- test
- fixtures
- comments
- basic
- block-trailing-comment
- input.js
- output.json (will be generated if not created)
```
### Debugging code
A common approach to debugging JavaScript code is to walk through the code using the [Chrome DevTools](https://developers.google.com/web/tools/chrome-devtools/) debugger.
For illustration purposes, we are going to assume that we need to get a better understanding of [`Generator.generate()`](https://github.com/babel/babel/blob/b5246994b57f06af871be6a63dcc4c6fd41d94d6/packages/babel-generator/src/index.js#L32), which is responsible for generating code for a given AST.
To get a better understanding of what is actually going on for this particular piece of code, we are going to make use of breakpoints.
```diff
generate() {
+ debugger; // breakpoint
return super.generate(this.ast);
}
```
To include the changes, we have to make sure to build Babel:
```bash
$ make build
```
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
$ TEST_DEBUG=true TEST_GREP=ClassDeclaration make test-only
./scripts/test.sh
Debugger listening on port 9229.
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
```
To start the debugging in Chrome DevTools, open the given URL.
The debugger starts at the first executed line of code, which is Mocha's first line by default.
Click _Resume script execution_ <img src="https://i.imgur.com/TmYBn9d.png" alt="Resume script execution button." width="16"> to jump to the set breakpoint.
Note that the code shown in Chrome DevTools is compiled code and therefore differs.
## Creating a new plugin (`spec-new`)
> Example: https://github.com/babel/babylon/pull/541
- Create a new issue that describes the proposal (ex: [#538](https://github.com/babel/babylon/issues/538)). Include any relevant information like proposal repo/author, examples, parsing approaches, meeting notes, presentation slides, and more.
- The pull request should include:
- [ ] An update to the [plugins](https://github.com/babel/babel/tree/master/packages/babel-parser#plugins) part of the readme. Add a new entry to that list for the new plugin flag (and link to the proposal)
- [ ] If any new nodes or modifications need to be added to the AST, update [ast/spec.md](https://github.com/babel/babel/blob/master/packages/babel-parser/ast/spec.md)
- [ ] Make sure you use the `this.hasPlugin("plugin-name-here")` check in the babel parser so that your new plugin code only runs when that flag is turned on (not default behavior)
- [ ] Add failing/passing tests according to spec behavior
- Start working about the Babel transform itself!
## Internals
- AST spec ([babel-parser/ast/spec.md](https://github.com/babel/babel/blob/master/packages/babel-parser/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))

168
Gulpfile.js Normal file
View File

@@ -0,0 +1,168 @@
"use strict";
const plumber = require("gulp-plumber");
const through = require("through2");
const chalk = require("chalk");
const newer = require("gulp-newer");
const babel = require("gulp-babel");
const gulpWatch = require("gulp-watch");
const fancyLog = require("fancy-log");
const filter = require("gulp-filter");
const gulp = require("gulp");
const path = require("path");
const webpack = require("webpack");
const rollup = require("rollup");
const rollupBabel = require("rollup-plugin-babel");
const rollupNodeResolve = require("rollup-plugin-node-resolve");
const rollupReplace = require("rollup-plugin-replace");
const { registerStandalonePackageTask } = require("./scripts/gulp-tasks");
const defaultSourcesGlob = "./@(codemods|packages)/*/src/**/*.js";
function swapSrcWithLib(srcPath) {
const parts = srcPath.split(path.sep);
parts[2] = "lib";
return parts.join(path.sep);
}
function getIndexFromPackage(name) {
return `${name}/src/index.js`;
}
function compilationLogger() {
return through.obj(function(file, enc, callback) {
fancyLog(`Compiling '${chalk.cyan(file.relative)}'...`);
callback(null, file);
});
}
function errorsLogger() {
return plumber({
errorHandler(err) {
fancyLog(err.stack);
},
});
}
function rename(fn) {
return through.obj(function(file, enc, callback) {
file.path = fn(file);
callback(null, file);
});
}
function buildBabel(exclude, sourcesGlob = defaultSourcesGlob) {
const base = __dirname;
let stream = gulp.src(sourcesGlob, { base: __dirname });
if (exclude) {
const filters = exclude.map(p => `!**/${p}/**`);
filters.unshift("**");
stream = stream.pipe(filter(filters));
}
return stream
.pipe(errorsLogger())
.pipe(newer({ dest: base, map: swapSrcWithLib }))
.pipe(compilationLogger())
.pipe(babel())
.pipe(
// Passing 'file.relative' because newer() above uses a relative
// path and this keeps it consistent.
rename(file => path.resolve(file.base, swapSrcWithLib(file.relative)))
)
.pipe(gulp.dest(base));
}
function buildRollup(packages) {
return Promise.all(
packages.map(pkg => {
const input = getIndexFromPackage(pkg);
fancyLog(`Compiling '${chalk.cyan(input)}' with rollup ...`);
return rollup
.rollup({
input,
plugins: [
rollupReplace({
"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV),
}),
rollupBabel({
envName: "babel-parser",
}),
rollupNodeResolve(),
],
})
.then(bundle => {
return bundle.write({
file: path.join(pkg, "lib/index.js"),
format: "cjs",
name: "babel-parser",
sourcemap: process.env.NODE_ENV !== "production",
});
});
})
);
}
const bundles = ["packages/babel-parser"];
gulp.task("build-rollup", () => buildRollup(bundles));
gulp.task("build-babel", () => buildBabel(/* exclude */ bundles));
gulp.task("build-babel-types", () =>
buildBabel(/* exclude */ bundles, "packages/babel-types/src/**/*.js")
);
gulp.task("build", gulp.parallel("build-rollup", "build-babel"));
gulp.task("default", gulp.series("build"));
gulp.task("build-no-bundle", () => buildBabel());
gulp.task(
"watch",
gulp.series("build-no-bundle", function watch() {
gulpWatch(
defaultSourcesGlob,
{ debounceDelay: 200 },
gulp.task("build-no-bundle")
);
})
);
registerStandalonePackageTask(
gulp,
"babel",
"Babel",
path.join(__dirname, "packages"),
require("./packages/babel-standalone/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"
)
)
),
];
registerStandalonePackageTask(
gulp,
"babel-preset-env",
"babelPresetEnv",
path.join(__dirname, "packages"),
require("./packages/babel-preset-env-standalone/package.json").version,
presetEnvWebpackPlugins
);

View File

@@ -1,7 +1,7 @@
Copyright (c) 2014-2015 Sebastian McKenzie <sebmck@gmail.com>
MIT License
Copyright (c) 2014-present Sebastian McKenzie and other contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including

303
Makefile
View File

@@ -1,125 +1,256 @@
MAKEFLAGS = -j1
BROWSERIFY_CMD = node_modules/browserify/bin/cmd.js
ISTANBUL_CMD = node_modules/istanbul/lib/cli.js cover
UGLIFY_CMD = node_modules/uglify-js/bin/uglifyjs
#UGLIFY_CMD = node_modules/uglify-js/bin/uglifyjs --mangle sort
MOCHA_CMD = node_modules/mocha/bin/_mocha
BABEL_CMD = node_modules/babel/bin/babel
FLOW_COMMIT = 09669846b7a7ca5a6c23c12d56bb3bebdafd67e9
TEST262_COMMIT = 8688c4ab79059c3097098605e69f1ee5eda6c409
export NODE_ENV = test
# Fix color output until TravisCI fixes https://github.com/travis-ci/travis-ci/issues/7967
export FORCE_COLOR = true
.PHONY: clean test test-cov test-clean test-travis test-simple test-all test-browser test-parser publish build bootstrap publish-core publish-runtime build-core watch-core build-core-test clean-core
SOURCES = packages codemods
build-core: clean-core
node $(BABEL_CMD) src --out-dir lib --copy-files
.PHONY: build build-dist watch lint fix clean test-clean test-only test test-ci publish bootstrap
build-core-test: clean-core
node $(BABEL_CMD) src --out-dir lib --copy-files --auxiliary-comment "istanbul ignore next"
build: build-bundle
ifneq ("$(BABEL_COVERAGE)", "true")
$(MAKE) build-standalone
endif
watch-core: clean-core
node $(BABEL_CMD) src --out-dir lib --watch --copy-files
build-bundle: clean clean-lib
yarn gulp build
$(MAKE) generate-standalone generate-type-helpers
# call build again as the generated files might need to be compiled again.
yarn gulp build
$(MAKE) build-typings
$(MAKE) build-dist
clean-core:
rm -rf lib
build-bundle-ci: bootstrap-only
$(MAKE) build-bundle
build:
mkdir -p dist
make build-core
generate-standalone:
node packages/babel-standalone/scripts/generate.js
node tools/cache-templates
generate-type-helpers:
node packages/babel-types/scripts/generateTypeHelpers.js
node $(BROWSERIFY_CMD) -e lib/babel/polyfill.js >dist/polyfill.js
node $(UGLIFY_CMD) dist/polyfill.js >dist/polyfill.min.js
build-typings: build-flow-typings build-typescript-typings
node $(BROWSERIFY_CMD) lib/babel/api/browser.js -s babel >dist/babel.js
node $(UGLIFY_CMD) dist/babel.js >dist/babel.min.js
build-flow-typings:
node packages/babel-types/scripts/generators/flow.js > packages/babel-types/lib/index.js.flow
node packages/babel-cli/bin/babel-external-helpers >dist/external-helpers.js
node $(UGLIFY_CMD) dist/external-helpers.js >dist/external-helpers.min.js
build-typescript-typings:
node packages/babel-types/scripts/generators/typescript.js > packages/babel-types/lib/index.d.ts
rm -rf templates.json
build-standalone: build-babel-standalone build-preset-env-standalone
clean:
rm -rf coverage templates.json test/tmp dist lib
build-standalone-ci: build-bundle-ci
$(MAKE) build-standalone
build-babel-standalone:
yarn gulp build-babel-standalone
build-preset-env-standalone:
yarn gulp build-babel-preset-env-standalone
prepublish-build-standalone:
BABEL_ENV=production IS_PUBLISH=true yarn gulp build-babel-standalone
prepublish-build-preset-env-standalone:
BABEL_ENV=production IS_PUBLISH=true yarn gulp build-babel-preset-env-standalone
build-dist: build-polyfill-dist build-plugin-transform-runtime-dist
build-polyfill-dist:
cd packages/babel-polyfill; \
scripts/build-dist.sh
build-plugin-transform-runtime-dist:
cd packages/babel-plugin-transform-runtime; \
node scripts/build-dist.js
build-no-bundle: clean clean-lib
BABEL_ENV=development yarn gulp build-no-bundle
# Ensure that build artifacts for types are created during local
# development too.
$(MAKE) generate-type-helpers
$(MAKE) build-typings
watch: build-no-bundle
BABEL_ENV=development yarn gulp watch
code-quality-ci: flowcheck-ci lint-ci
flowcheck-ci: bootstrap-flowcheck
$(MAKE) flow
code-quality: flow lint
flow:
yarn flow check --strip-root
bootstrap-flowcheck: bootstrap-only
yarn gulp build-babel-types
$(MAKE) build-typings
lint-ci: lint-js-ci lint-ts-ci
lint-js-ci: bootstrap-only
$(MAKE) lint-js
lint-ts-ci: bootstrap-flowcheck
$(MAKE) lint-ts
lint: lint-js lint-ts
lint-js:
yarn eslint scripts $(SOURCES) '*.js' --format=codeframe
lint-ts:
scripts/tests/typescript/lint.sh
fix: fix-json fix-js
fix-js:
yarn eslint scripts $(SOURCES) '*.js' --format=codeframe --fix
fix-json:
yarn prettier "{packages,codemod}/*/test/fixtures/**/options.json" --write --loglevel warn
clean: test-clean
rm -f .npmrc
rm -rf packages/babel-polyfill/browser*
rm -rf packages/babel-polyfill/dist
rm -rf coverage
rm -rf packages/*/npm-debug*
test-clean:
rm -rf test/tmp
$(foreach source, $(SOURCES), \
$(call clean-source-test, $(source)))
test: test-parser
node $(MOCHA_CMD) test/core
make test-clean
# Does not work on Windows; use "yarn jest" instead
test-only:
BABEL_ENV=test ./scripts/test.sh
$(MAKE) test-clean
test-all:
export ALL_BABEL_TESTS=1; \
make test
test: lint test-only
test-cov:
rm -rf coverage
make build-core-test
node $(ISTANBUL_CMD) $(MOCHA_CMD) -- test/core
test-ci: jest-ci
test-parser:
node test/acorn/run.js
jest-ci: build-standalone-ci
BABEL_ENV=test yarn jest --maxWorkers=4 --ci
$(MAKE) test-clean
test-travis: bootstrap build test
# Does not work on Windows
test-ci-coverage: SHELL:=/bin/bash
test-ci-coverage:
BABEL_COVERAGE=true BABEL_ENV=test $(MAKE) bootstrap
BABEL_ENV=test TEST_TYPE=cov ./scripts/test-cov.sh
bash <(curl -s https://codecov.io/bash) -f coverage/coverage-final.json
test-browser:
mkdir -p dist
bootstrap-flow:
rm -rf build/flow
mkdir -p build
git clone --branch=master --single-branch --shallow-since=2018-11-01 https://github.com/facebook/flow.git build/flow
cd build/flow && git checkout $(FLOW_COMMIT)
node tools/cache-templates
node tools/build-tests
node $(BROWSERIFY_CMD) -e test/core/_browser.js >dist/babel-test.js
rm -rf templates.json tests.json
test-flow:
node scripts/tests/flow/run_babel_parser_flow_tests.js
test -n "`which open`" && open test/browser.html
test-flow-ci: build-bundle-ci bootstrap-flow
$(MAKE) test-flow
publish:
test-flow-update-whitelist:
node scripts/tests/flow/run_babel_parser_flow_tests.js --update-whitelist
bootstrap-test262:
rm -rf build/test262
mkdir -p build
git clone --branch=master --single-branch --shallow-since=2019-09-01 https://github.com/tc39/test262.git build/test262
cd build/test262 && git checkout $(TEST262_COMMIT)
test-test262:
node scripts/tests/test262/run_babel_parser_test262.js
test-test262-ci: build-bundle-ci bootstrap-test262
$(MAKE) test-test262
test-test262-update-whitelist:
node scripts/tests/test262/run_babel_parser_test262.js --update-whitelist
# Does not work on Windows
clone-license:
./scripts/clone-license.sh
prepublish-build: clean-lib clean-runtime-helpers
NODE_ENV=production BABEL_ENV=production $(MAKE) build
$(MAKE) clone-license
prepublish:
$(MAKE) bootstrap-only
$(MAKE) prepublish-build
$(MAKE) test
new-version:
git pull --rebase
yarn lerna version --force-publish="@babel/runtime,@babel/runtime-corejs2,@babel/runtime-corejs3,@babel/standalone,@babel/preset-env-standalone"
make test
# NOTE: Run make new-version first
publish: prepublish
yarn lerna publish from-git
$(MAKE) clean
read -p "Version: " version; \
npm version $$version --message "v%s"
publish-ci: prepublish
ifneq ("$(NPM_TOKEN)", "")
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
else
echo "Missing NPM_TOKEN env var"
exit 1
endif
yarn lerna publish from-git --yes
rm -f .npmrc
$(MAKE) clean
make build
bootstrap-only: lerna-bootstrap
cp dist/babel.js browser.js
cp dist/babel.min.js browser.min.js
yarn-install: clean-all
yarn --ignore-engines
cp dist/polyfill.js browser-polyfill.js
cp dist/polyfill.min.js browser-polyfill.min.js
lerna-bootstrap: yarn-install
yarn lerna bootstrap
cp dist/external-helpers.js external-helpers.js
cp dist/external-helpers.min.js external-helpers.min.js
bootstrap: bootstrap-only
$(MAKE) build
node tools/cache-templates
test -f templates.json
clean-lib:
$(foreach source, $(SOURCES), \
$(call clean-source-lib, $(source)))
npm publish
clean-runtime-helpers:
rm -rf packages/babel-runtime/helpers
rm -rf packages/babel-runtime-corejs2/helpers
rm -rf packages/babel-runtime-corejs2/core-js
git push --follow-tags
clean-all:
rm -rf node_modules
rm -rf package-lock.json
rm -rf .changelog
make publish-cli
make publish-runtime
$(foreach source, $(SOURCES), \
$(call clean-source-all, $(source)))
rm -rf templates.json browser.js browser.min.js browser-polyfill.js browser-polyfill.min.js external-helpers.js external-helpers.min.js
$(MAKE) clean
publish-runtime:
cd packages; \
node build-runtime.js; \
cd babel-runtime; \
npm publish
define clean-source-lib
rm -rf $(1)/*/lib
publish-cli:
cd packages; \
node build-cli.js; \
cd babel-cli; \
npm publish
endef
bootstrap:
npm list --global --depth 1 babel >/dev/null 2>&1 && npm uninstall -g babel || true
npm install
npm link
cd packages/babel-cli && npm install && npm link && npm link babel-core
git submodule update --init
make build
define clean-source-test
rm -rf $(1)/*/test/tmp
rm -rf $(1)/*/test-fixtures.json
endef
define clean-source-all
rm -rf $(1)/*/lib
rm -rf $(1)/*/node_modules
rm -rf $(1)/*/package-lock.json
endef

112
README.md
View File

@@ -1,17 +1,121 @@
<p align="center">
<a href="https://babeljs.io/">
<img alt="babel" src="https://raw.githubusercontent.com/babel/logo/master/logo.png" width="546">
<img alt="babel" src="https://raw.githubusercontent.com/babel/logo/master/babel.png" width="546">
</a>
</p>
<p align="center">
<strong>Babel</strong> is a compiler for writing next generation JavaScript.
The compiler for writing next generation JavaScript.
</p>
<p align="center">
For questions and support please visit the <a href="https://gitter.im/babel/babel">gitter room</a> or <a href="http://stackoverflow.com/questions/tagged/babeljs">StackOverflow</a>. The Babel issue tracker is <strong>exclusively</strong> for bug reports and feature requests.
<a href="https://www.npmjs.com/package/@babel/core"><img alt="v7 npm Downloads" src="https://img.shields.io/npm/dm/@babel/core.svg?maxAge=43200&label=v7%20downloads"></a>
<a href="https://www.npmjs.com/package/babel-core"><img alt="v6 npm Downloads" src="https://img.shields.io/npm/dm/babel-core.svg?maxAge=43200&label=v6%20downloads"></a>
</p>
<p align="center">
<a href="https://travis-ci.com/babel/babel"><img alt="Travis Status" src="https://img.shields.io/travis/com/babel/babel/master.svg?label=travis&maxAge=43200"></a>
<a href="https://circleci.com/gh/babel/babel"><img alt="CircleCI Status" src="https://img.shields.io/circleci/project/github/babel/babel/master.svg?label=circle&maxAge=43200"></a>
<a href="https://codecov.io/github/babel/babel"><img alt="Coverage Status" src="https://img.shields.io/codecov/c/github/babel/babel/master.svg?maxAge=43200"></a>
<a href="https://slack.babeljs.io/"><img alt="Slack Status" src="https://slack.babeljs.io/badge.svg"></a>
<a href="https://twitter.com/intent/follow?screen_name=babeljs"><img alt="Follow on Twitter" src="https://img.shields.io/twitter/follow/babeljs.svg?style=social&label=Follow"></a>
</p>
<h2 align="center">Supporting Babel</h2>
<p align="center">
For documentation and website issues please visit the <a href="https://github.com/babel/babel.github.io">babel.github.io</a> repo.
<a href="#backers"><img alt="Backers on Open Collective" src="https://opencollective.com/babel/backers/badge.svg" /></a>
<a href="#sponsors"><img alt="Sponsors on Open Collective" src="https://opencollective.com/babel/sponsors/badge.svg" /></a>
<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 (pronounced ["babble"](https://soundcloud.com/sebmck/how-to-pronounce-babel)) is a community-driven project used by many companies and projects, and is maintained by a group of [volunteers](https://babeljs.io/team). If you'd like to help support the future of the project, please consider:
- Giving developer time on the project. (Message us on [Twitter](https://twitter.com/babeljs) or [Slack](https://slack.babeljs.io/) for guidance!)
- Giving funds by becoming a sponsor on [Open Collective](https://opencollective.com/babel) or [Patreon](https://www.patreon.com/henryzhu)!
## Sponsors
Our top sponsors are shown below! [[Become a sponsor](https://opencollective.com/babel#sponsor)]
<a href="https://opencollective.com/babel/sponsor/0/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/0/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/1/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/1/avatar.svg"></a>
<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>
## Intro
Babel is a tool that helps you write code in the latest version of JavaScript. When your supported environments don't support certain features natively, Babel will help you compile those features down to a supported version.
**In**
```js
// ES2015 arrow function
[1, 2, 3].map((n) => n + 1);
```
**Out**
```js
[1, 2, 3].map(function(n) {
return n + 1;
});
```
Try it out at our [REPL](https://babeljs.io/repl/build/master#?code_lz=NoRgNATGDMC6B0BbAhgBwBQDsAEBeAfNjgNTYgCUA3EA&lineWrap=true&presets=es2015%2Ces2016%2Ces2017&version=7.0.0-beta.2).
## FAQ
### Who maintains Babel?
Mostly a handful of volunteers, funded by you! Please check out our [team page](https://babeljs.io/team)!
### 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), [audio version](https://youtu.be/40abpedBKK8) by [@swyx](https://twitter.com/@swyx). Tweet us your recordings!
### Looking for support?
For questions and support please join our [Slack Community](https://slack.babeljs.io/) (you can sign-up [here](https://slack.babeljs.io/) for an invite), ask a question on [Stack Overflow](https://stackoverflow.com/questions/tagged/babeljs), or ping us on [Twitter](https://twitter.com/babeljs).
### Where are the docs?
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](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 [#development](https://babeljs.slack.com/messages/development) Slack channel and say hi ([signup](https://slack.babeljs.io))!
- 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](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aclosed+label%3A%22good+first+issue%22) to get a sense of the kinds of issues you can tackle.
Some resources:
- Our [CONTRIBUTING.md](CONTRIBUTING.md) to get started with setting up the repo.
- Our discussions/notes/roadmap: [babel/notes](https://github.com/babel/notes)
- Our progress on TC39 proposals: [babel/proposals](https://github.com/babel/proposals)
- Our blog which contains release posts and explainations: [/blog](https://babeljs.io/blog)
- Our videos page with talks about open source and Babel: [/videos](https://babeljs.io/videos)
- Our [podcast](https://podcast.babeljs.io)
### How is the repo structured?
The Babel repo is managed as a [monorepo](doc/design/monorepo.md) that is composed of many [npm packages](packages/README.md).
## License
[MIT](LICENSE)

19
SECURITY.md Normal file
View File

@@ -0,0 +1,19 @@
# Security Policy
## Supported Versions
This is the list of versions of `babel` which are
currently being supported with security updates.
| Version | Supported |
| -------- | ------------------ |
| 7.x | :white_check_mark: |
| 6.26.x | :white_check_mark: |
| < 6.26.0 | :x: |
## Reporting a Vulnerability
To report a vulnerability please send an email with the details to security@babeljs.io.
This will help us to assess the risk and start the necessary steps.
Thanks for helping to keep babel secure.

80
SONG.md Normal file
View File

@@ -0,0 +1,80 @@
## Hallelujah—In Praise of Babel
➤ [🎶 Audio version here!](https://youtu.be/40abpedBKK8)
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, Hallelujah
Hallelujah, Hallelujah
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, Hallelujah
Hallelujah, Hallelujah
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, Hallelujah
Hallelujah, Hallelujah
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, Hallelujah
Hallelujah, Hallelujah
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, Hallelujah
Hallelujah, Hallelujah
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, Hallelujah
Hallelujah, Hallelujah
[Angus Croll](https://github.com/angus-c)

140
babel.config.js Normal file
View File

@@ -0,0 +1,140 @@
"use strict";
module.exports = function(api) {
const env = api.env();
const includeCoverage = process.env.BABEL_COVERAGE === "true";
const envOptsNoTargets = {
loose: true,
modules: false,
exclude: ["transform-typeof-symbol"],
};
const envOpts = Object.assign({}, envOptsNoTargets);
let convertESM = true;
let ignoreLib = true;
let includeRuntime = false;
const nodeVersion = "6.9";
switch (env) {
// Configs used during bundling builds.
case "babel-parser":
convertESM = false;
ignoreLib = false;
envOpts.targets = {
node: nodeVersion,
};
break;
case "standalone":
convertESM = false;
ignoreLib = false;
includeRuntime = true;
break;
case "production":
// Config during builds before publish.
envOpts.targets = {
node: nodeVersion,
};
break;
case "development":
envOpts.debug = true;
envOpts.targets = {
node: "current",
};
break;
case "test":
envOpts.targets = {
node: "current",
};
break;
}
const config = {
// Our dependencies are all standard CommonJS, along with all sorts of
// other random files in Babel's codebase, so we use script as the default,
// and then mark actual modules as modules farther down.
sourceType: "script",
comments: false,
ignore: [
// These may not be strictly necessary with the newly-limited scope of
// babelrc searching, but including them for now because we had them
// in our .babelignore before.
"packages/*/test/fixtures",
ignoreLib ? "packages/*/lib" : null,
"packages/babel-standalone/babel.js",
"packages/babel-preset-env-standalone/babel-preset-env.js",
].filter(Boolean),
presets: [["@babel/env", envOpts]],
plugins: [
// TODO: Use @babel/preset-flow when
// https://github.com/babel/babel/issues/7233 is fixed
"@babel/plugin-transform-flow-strip-types",
["@babel/proposal-class-properties", { loose: true }],
"@babel/proposal-export-namespace-from",
"@babel/proposal-numeric-separator",
[
"@babel/proposal-object-rest-spread",
{ useBuiltIns: true, loose: true },
],
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-proposal-nullish-coalescing-operator",
convertESM ? "@babel/transform-modules-commonjs" : null,
].filter(Boolean),
overrides: [
{
test: "packages/babel-parser",
plugins: [
"babel-plugin-transform-charcodes",
["@babel/transform-for-of", { assumeArray: true }],
],
},
{
test: ["./packages/babel-cli", "./packages/babel-core"],
plugins: [
// Explicitly use the lazy version of CommonJS modules.
convertESM
? ["@babel/transform-modules-commonjs", { lazy: true }]
: null,
].filter(Boolean),
},
{
test: "./packages/babel-polyfill",
presets: [["@babel/env", envOptsNoTargets]],
},
{
// The vast majority of our src files are modules, but we use
// unambiguous to keep things simple until we get around to renaming
// the modules to be more easily distinguished from CommonJS
test: [
"packages/*/src",
"packages/*/test",
"codemods/*/src",
"codemods/*/test",
],
sourceType: "unambiguous",
},
{
// The runtime transform shouldn't process its own runtime or core-js.
exclude: [
"packages/babel-runtime",
/[\\/]node_modules[\\/](?:@babel\/runtime|babel-runtime|core-js)[\\/]/,
],
plugins: [
includeRuntime
? ["@babel/transform-runtime", { version: "7.4.4" }]
: null,
].filter(Boolean),
},
].filter(Boolean),
};
// we need to do this as long as we do not test everything from source
if (includeCoverage) {
config.auxiliaryCommentBefore = "istanbul ignore next";
config.plugins.push("babel-plugin-istanbul");
}
return config;
};

25
babel.sublime-project Normal file
View File

@@ -0,0 +1,25 @@
{
"settings": {
"rulers": [
80
],
// Set to false to disable detection of tabs vs. spaces on load
"detect_indentation": false,
"translate_tabs_to_spaces": true,
"tab_size": 2
},
"folders": [{
"path": ".",
"folder_exclude_patterns": [
"packages/*/lib",
"node_modules"
],
"file_exclude_patterns": [
]
}]
}

12
codecov.yml Normal file
View File

@@ -0,0 +1,12 @@
coverage:
parsers:
javascript:
enable_partials: yes
status:
project:
default:
target: "80%"
patch:
enabled: false
ignore:
- packages/babel-types/src/*/generated/index.js

View File

@@ -0,0 +1,3 @@
src
test
*.log

View File

@@ -0,0 +1,57 @@
# @babel/plugin-codemod-object-assign-to-object-spread
Transforms old code that uses `Object.assign` with an Object Literal as
the first param to use Object Spread syntax.
## Examples
```js
const obj = Object.assign({
test1: 1,
}, other, {
test2: 2,
}, other2);
```
Is transformed to:
```js
const obj = {
test1: 1,
...other,
test2: 2,
...other2,
};
```
## Installation
```sh
npm install --save-dev @babel/plugin-codemod-object-assign-to-object-spread
```
## Usage
### Via `.babelrc` (Recommended)
**.babelrc**
```jsonc
{
"plugins": ["@babel/plugin-codemod-object-assign-to-object-spread"]
}
```
### Via CLI
```sh
babel --plugins @babel/plugin-codemod-object-assign-to-object-spread script.js
```
### Via Node API
```javascript
require("@babel/core").transform("code", {
plugins: ["@babel/plugin-codemod-object-assign-to-object-spread"]
});
```

View File

@@ -0,0 +1,28 @@
{
"name": "@babel/plugin-codemod-object-assign-to-object-spread",
"version": "7.0.0",
"description": "Transforms Object.assign into object spread syntax",
"repository": "https://github.com/babel/babel/tree/master/codemods/babel-plugin-codemod-object-assign-to-object-spread",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"main": "lib/index.js",
"keywords": [
"@babel/codemod",
"@babel/plugin"
],
"dependencies": {
"@babel/plugin-syntax-object-rest-spread": "^7.0.0"
},
"peerDependencies": {
"@babel/core": "^7.0.0-0"
},
"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/helper-plugin-test-runner": "^7.0.0"
},
"publishConfig": {
"access": "public"
}
}

View File

@@ -0,0 +1,35 @@
import syntaxObjectRestSpread from "@babel/plugin-syntax-object-rest-spread";
export default function({ types: t }) {
return {
inherits: syntaxObjectRestSpread,
visitor: {
CallExpression(path) {
if (!path.get("callee").matchesPattern("Object.assign")) return;
const args = path.get("arguments");
if (args.length === 0) return;
const [objPath] = args;
if (!objPath.isObjectExpression()) return;
const obj = objPath.node;
const { properties } = obj;
for (let i = 1; i < args.length; i++) {
const arg = args[i];
const { node } = arg;
if (arg.isObjectExpression()) {
properties.push(...node.properties);
} else {
properties.push(t.spreadElement(node));
}
}
path.replaceWith(obj);
},
},
};
}

View File

@@ -0,0 +1 @@
Object.assign({test: 1}, test2, {test: 2}, test3);

View File

@@ -0,0 +1,3 @@
{
"plugins": ["../../../../lib"]
}

View File

@@ -0,0 +1,6 @@
({
test: 1,
...test2,
test: 2,
...test3
});

View File

@@ -0,0 +1,3 @@
{
"plugins": ["../../../../lib"]
}

View File

@@ -0,0 +1,3 @@
import runner from "@babel/helper-plugin-test-runner";
runner(__dirname);

View File

@@ -0,0 +1,3 @@
src
test
*.log

View File

@@ -0,0 +1,59 @@
# @babel/plugin-codemod-optional-catch-binding
> If the argument bound to the catch block is not referenced in the catch block, that argument and the catch binding is removed.
## Examples
```js
try {
throw 0;
} catch (err) {
console.log("it failed, but this code executes");
}
```
Is transformed to:
```js
try {
throw 0;
} catch {
console.log("it failed, but this code executes");
}
```
## Installation
```sh
npm install --save-dev @babel/plugin-codemod-optional-catch-binding
```
## Usage
### Via `.babelrc` (Recommended)
**.babelrc**
```jsonc
{
"plugins": ["@babel/plugin-codemod-optional-catch-binding"]
}
```
### Via CLI
```sh
babel --plugins @babel/plugin-codemod-optional-catch-binding script.js
```
### Via Node API
```javascript
require("@babel/core").transform("code", {
plugins: ["@babel/plugin-codemod-optional-catch-binding"]
});
```
## References
This codemod updates your source code in line with the following proposal:
- [Proposal: Optional Catch Binding for ECMAScript](https://github.com/babel/proposals/issues/7)

View File

@@ -0,0 +1,25 @@
{
"name": "@babel/plugin-codemod-optional-catch-binding",
"version": "7.0.0",
"description": "Remove unused catch bindings",
"repository": "https://github.com/babel/babel/tree/master/codemods/babel-plugin-codemod-remove-unused-catch-binding",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"main": "lib/index.js",
"keywords": [
"@babel/codemod",
"@babel/plugin"
],
"dependencies": {
"@babel/plugin-syntax-optional-catch-binding": "^7.0.0"
},
"peerDependencies": {
"@babel/core": "^7.0.0-0"
},
"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/helper-plugin-test-runner": "^7.0.0"
}
}

View File

@@ -0,0 +1,23 @@
import syntaxOptionalCatchBinding from "@babel/plugin-syntax-optional-catch-binding";
export default function({ types: t }) {
return {
inherits: syntaxOptionalCatchBinding,
visitor: {
CatchClause(path) {
if (path.node.param === null || !t.isIdentifier(path.node.param)) {
return;
}
const binding = path.scope.getOwnBinding(path.node.param.name);
if (binding.constantViolations.length > 0) {
return;
}
if (!binding.referenced) {
const paramPath = path.get("param");
paramPath.remove();
}
},
},
};
}

View File

@@ -0,0 +1,5 @@
try {
throw 0;
} catch {
console.log("it failed, but this code executes");
}

View File

@@ -0,0 +1,5 @@
try {
throw 0;
} catch {
console.log("it failed, but this code executes");
}

View File

@@ -0,0 +1,5 @@
try {
throw 0;
} catch ([message]) {
console.log("it failed, but this code executes");
}

View File

@@ -0,0 +1,5 @@
try {
throw 0;
} catch ([message]) {
console.log("it failed, but this code executes");
}

View File

@@ -0,0 +1,5 @@
try {
throw 0;
} catch (err) {
console.log("it failed, but this code executes");
}

View File

@@ -0,0 +1,5 @@
try {
throw 0;
} catch {
console.log("it failed, but this code executes");
}

View File

@@ -0,0 +1,7 @@
try {
throw 0;
} catch ({
message
}) {
console.log("it failed, but this code executes");
}

View File

@@ -0,0 +1,7 @@
try {
throw 0;
} catch ({
message
}) {
console.log("it failed, but this code executes");
}

View File

@@ -0,0 +1,5 @@
try {
throw 0;
} catch ([message]) {
console.log(message);
}

View File

@@ -0,0 +1,5 @@
try {
throw 0;
} catch ([message]) {
console.log(message);
}

View File

@@ -0,0 +1,5 @@
try {
throw 0;
} catch (e) {
e = new TypeError('A new variable is not being declared or initialized; the catch binding is being referenced and cannot be removed.');
}

View File

@@ -0,0 +1,5 @@
try {
throw 0;
} catch (e) {
e = new TypeError('A new variable is not being declared or initialized; the catch binding is being referenced and cannot be removed.');
}

View File

@@ -0,0 +1,5 @@
try {
throw 0;
} catch (err) {
console.log(err, "it failed, but this code executes");
}

View File

@@ -0,0 +1,5 @@
try {
throw 0;
} catch (err) {
console.log(err, "it failed, but this code executes");
}

View File

@@ -0,0 +1,7 @@
try {
throw 0;
} catch ({
message
}) {
console.log(message);
}

View File

@@ -0,0 +1,7 @@
try {
throw 0;
} catch ({
message
}) {
console.log(message);
}

View File

@@ -0,0 +1,7 @@
try {
throw 0;
} catch (err) {
console.log("it failed, but this code executes");
} finally {
console.log("this code also executes");
}

View File

@@ -0,0 +1,7 @@
try {
throw 0;
} catch {
console.log("it failed, but this code executes");
} finally {
console.log("this code also executes");
}

View File

@@ -0,0 +1,7 @@
try {
throw 0;
} catch (err) {
console.log(err, "it failed, but this code executes");
} finally {
console.log("this code also executes");
}

View File

@@ -0,0 +1,7 @@
try {
throw 0;
} catch (err) {
console.log(err, "it failed, but this code executes");
} finally {
console.log("this code also executes");
}

View File

@@ -0,0 +1,3 @@
import runner from "@babel/helper-plugin-test-runner";
runner(__dirname);

1
doc/ast/spec.md Normal file
View File

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

View File

@@ -0,0 +1,9 @@
# Compiler assumptions
Babel and its associated official transforms make some assumptions about your code. These
assumptions are only made as they're either **impossible** to take into consideration or
are extremely exotic.
- `undefined`, `NaN` and `Infinity` have not been externally redefined.
- Built-in objects such as `Object`, `Array`, `String`, `Number`, `Boolean` etc have not been redefined.
- Standard methods on built-ins have not been redefined in a way that breaks the original contract.

View File

@@ -0,0 +1,22 @@
# Compiler environment support
**NOTE:** Compiler support does not dictate the runtime requirements of compiled code.
## Officially supported environments
The Babel compiler is **only** supported in these environments:
- Modern browsers such as Chrome, Firefox, Safari, Edge etc.
- Node.js 6 and newer versions
## Unsupported environments
This means that any other environment is not supported, this includes but is not limited
to:
- Rhino
- Nashorn
- Internet Explorer
**NOTE:** If Babel works in any of the unsupported environments, it is purely
coincidental and has no bearing on future compatibility. Use at your own risk.

45
doc/design/monorepo.md Normal file
View File

@@ -0,0 +1,45 @@
# Why is Babel a monorepo?
> The tool for managing the monorepo in Babel has been extracted out as [Lerna](https://github.com/lerna/lerna)
Juggling a multimodule project over multiple repos is like trying to teach a newborn baby how to
ride a bike.
Babel follows a monorepo approach, all officially maintained modules are in the same repo.
This is quite taboo but let's look at the pros and cons:
**Pros:**
* Single lint, build, test and release process.
* Easy to coordinate changes across modules.
* Single place to report issues.
* Easier to setup a development environment.
* Tests across modules are run together which finds bugs that touch multiple modules more easily.
**Cons:**
* Codebase looks more intimidating.
* Repo is bigger in size.
* [Can't `npm install` modules directly from GitHub](https://github.com/npm/npm/issues/2974)
* ???
## This is dumb! Nobody in open source does this!
[React](https://github.com/facebook/react/tree/master/packages), [Meteor](https://github.com/meteor/meteor/tree/devel/packages), and [Ember](https://github.com/emberjs/ember.js/tree/master/packages), among others, do this.
## Previous discussion
- [Dan Luu](http://danluu.com/monorepo/)
- [Gregory](http://gregoryszorc.com/blog/2014/09/09/on-monolithic-repositories/)
- [Szorc](http://gregoryszorc.com/blog/2015/02/17/lost-productivity-due-to-non-unified-repositories/)
- [Face](https://www.youtube.com/watch?v=X0VH78ye4yY)[book](https://code.facebook.com/posts/218678814984400/scaling-mercurial-at-facebook/)
- [Benjamin Pollack](http://bitquabit.com/post/unorthodocs-abandon-your-dvcs-and-return-to-sanity/)
- [Benjamin Eberlei](https://qafoo.com/resources/presentations/froscon_2015/monorepos.html)
- [Simon Stewart](http://blog.rocketpoweredjetpants.com/2015/04/monorepo-one-source-code-repository-to.html)
- [Digital Ocean](https://www.digitalocean.com/company/blog/taming-your-go-dependencies/)
- [Google](http://www.infoq.com/presentations/Development-at-Google), [another](https://www.youtube.com/watch?v=W71BTkUbdqE)
- [Twitter](https://www.youtube.com/watch?v=bjh4DHuOf4E)
- [thedufer](http://www.reddit.com/r/programming/comments/1unehr/scaling_mercurial_at_facebook/cek9nkq)
- [Paul Hammant](http://paulhammant.com/categories.html#Trunk_Based_Development)
- [Exponent](https://blog.getexponent.com/universe-exponents-code-base-f12fa236b8e#.9dj8a82be)

5
doc/design/versioning.md Normal file
View File

@@ -0,0 +1,5 @@
# How does Babel versioning work?
## Does Babel follow semver?
Yes.

37
lerna.json Normal file
View File

@@ -0,0 +1,37 @@
{
"version": "7.7.0",
"changelog": {
"repo": "babel/babel",
"cacheDir": ".changelog",
"labels": {
"PR: Spec Compliance :eyeglasses:": ":eyeglasses: Spec Compliance",
"PR: Breaking Change :boom:": ":boom: Breaking Change",
"PR: New Feature :rocket:": ":rocket: New Feature",
"PR: Bug Fix :bug:": ":bug: Bug Fix",
"PR: Polish :nail_care:": ":nail_care: Polish",
"PR: Docs :memo:": ":memo: Documentation",
"PR: Internal :house:": ":house: Internal",
"PR: Performance :running_woman:": ":running_woman: Performance"
}
},
"command": {
"publish": {
"ignoreChanges": [
"*.md",
"*.txt",
"test/**",
"codemods/**",
"# We ignore every JSON file, except for built-in-modules, built-ins and plugins defined in babel-preset-env/data.",
"@(!(built-in-modules|built-ins|plugins|package)).json"
]
}
},
"packages": [
"codemods/*",
"packages/*"
],
"npmClient": "yarn",
"npmClientArgs": [
"--no-lockfile"
]
}

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