* 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
* Add --keep-module-extension option to babel-cli
* Rename keep-module-extension option to keep-file-extension; Change option to preserve all file extensions
* 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.
* 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.
* 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