JLHwung
Repos
277
Followers
280
Following
176

🐠 Babel is a compiler for writing next generation JavaScript.

41462
5172

Events

review comment

Created at 2 days ago
issue comment
Support more inner comments

Yeah. When an AST node has more than one empty spot, the inner comments are not sufficient for recreating code exactly from AST.

Created at 2 days ago
pull request opened
Support more inner comments

| Q                       | A | ------------------------ | --- | Fixed Issues? | Babel-generator does not print inner comments in certain situations | Patch: Bug Fix? | Y | Major: Breaking Change? | | Minor: New Feature? | | Tests Added + Pass? | Yes | Documentation PR Link | | Any Dependency Changes? | | License | MIT

This PR supports inner comments attached to generators, async methods and async do expressions. Because such inner comments must be block comments due to the noLineTerminator restrictions, we then ensure that such restrictions are respected by the babel-generator.

This PR also relaxes the condition when Babel prints single arrow binding x => {}. Before this PR we prints (x) => {} when x has attached comments. In this PR we relaxes the condition so that we can still output /* leading */x/* trailing */ => {}.

Created at 2 days ago
create branch
JLHwung create branch support-more-inner-comments
Created at 2 days ago

Improve module expression parsing/printing (#14980)

  • fix: several ModuleExpression printing edgecases

  • fix: end module expression's program before }

  • fix: expect braceL after module

  • refactor: introduce ensureNoLineTerminator

  • use this.ensureNoLineTerminator

  • update source-map fixtures

  • address review comments

  • consume eof when end is eof

Created at 5 days ago
delete branch
JLHwung delete branch fix-module-expression
Created at 5 days ago
pull request closed
Improve module expression parsing/printing

| Q                       | A | ------------------------ | --- | Fixed Issues? | See below | Patch: Bug Fix? | Yes | Major: Breaking Change? | | Minor: New Feature? | | Tests Added + Pass? | Yes | Documentation PR Link | | Any Dependency Changes? | | License | MIT

This PR fixes several module expression related parsing / printing issues

  • The program of a module expression should not end at }, instead it should end before } because } is not part of the embedded program
  • Print directives / comments of the embedded program
  • Print inner comments of a module expression, i.e. the block comments between module and {
  • Ensure no line terminators between module and {

Created at 5 days ago

consume eof when end is eof

Created at 5 days ago

address review comments

Created at 5 days ago

Internally rename proposal-* to transform-* in preset-env (#14976)

Disallow rest object destructuring of null/undefined (#14985)

Fix holes handling in optimized array destructuring (#14984)

Improve source map generation (#14967)

Update test262 (#14992)

chore: update test262 to 58b7a2358286b918efd38eac4b2facbc8ada1206

Update compat data (#14991)

chore: update compat data to c2f9ff98b30cc04e9174d9c31f0098ae88f29245

fix: several ModuleExpression printing edgecases

fix: end module expression's program before }

fix: expect braceL after module

refactor: introduce ensureNoLineTerminator

use this.ensureNoLineTerminator

update source-map fixtures

Created at 5 days ago

refactor: introduce ensureNoLineTerminator

use this.ensureNoLineTerminator

Created at 6 days ago

Disallow rest object destructuring of null/undefined (#14985)

Created at 6 days ago
closed issue
[Bug]: Destructuring null with rest

💻

  • [ ] Would you like to work on a fix?

How are you using Babel?

Other (Next.js, Gatsby, vue-cli, ...)

Input code

var { ... x } = null ;

Configuration file name

No response

Configuration

No response

Current and expected behavior

The input code is destructuring null so it should throw exception but the transpiled code does not.

Environment

Reproduction on Babel's own REPL

Possible solution

No response

Additional context

No response

Created at 6 days ago
pull request closed
Disallow rest object destructuring of null/undefined

| Q                       | A | ------------------------ | --- | Fixed Issues? | Fixes #14982 | Patch: Bug Fix? | | Major: Breaking Change? | | Minor: New Feature? | | Tests Added + Pass? | Yes | Documentation PR Link | | Any Dependency Changes? | | License | MIT

Created at 6 days ago

fix: expect braceL after module

Created at 1 week ago