Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Polyfill Object.fromEntries
  • Loading branch information
nicolo-ribaudo committed May 6, 2021
commit 2e85d14bee05174478d05d0a320b24581fc48292
4 changes: 3 additions & 1 deletion eslint/babel-eslint-parser/src/convert/convertTokens.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { tokTypes } from "@babel/core";

const tl = Object.fromEntries(
const tl = (process.env.BABEL_8_BREAKING

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to try to figure out a way to test this? Would it work to just manually set process.env.BABEL_8_BREAKING in our tests?

@nicolo-ribaudo nicolo-ribaudo May 6, 2021 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it's tested by the "Test Babel 8 breaking changes" job (even if it doesn't show up in codecov).
When running locally, you can use BABEL_8_BREAKING=true make test.

? Object.fromEntries
: p => p.reduce((o, [k, v]) => ({ ...o, [k]: v }), {}))(
Object.keys(tokTypes).map(key => [key, tokTypes[key].label]),
);

Expand Down