mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Use CompilerError invariant
The CompilerError module's `invariant` is wired up to our bailout system so in compiler passes should be preferred to the raw `invariant` module. We should probably add an internal eslint rule to suggest using CompilerError if the file is in one of the compiler pass directories.
This commit is contained in:
@@ -7,9 +7,9 @@
|
||||
|
||||
import { NodePath } from "@babel/traverse";
|
||||
import * as t from "@babel/types";
|
||||
import invariant from "invariant";
|
||||
import { setEmpty, setEq, setIntersect, setSubset } from "../Common/utils";
|
||||
import type { CompilerContext } from "../CompilerContext";
|
||||
import { invariant } from "../CompilerError";
|
||||
import * as IR from "../IR";
|
||||
import * as LIR from "../LIR";
|
||||
import { PassKind, PassName } from "../Pass";
|
||||
|
||||
@@ -7,14 +7,14 @@
|
||||
|
||||
import type { NodePath } from "@babel/traverse";
|
||||
import * as t from "@babel/types";
|
||||
import type { CompilerContext } from "../CompilerContext";
|
||||
import { OutputKind } from "../CompilerOutputs";
|
||||
import * as LIR from "../LIR";
|
||||
import * as IR from "../IR";
|
||||
import { PassKind, PassName } from "../Pass";
|
||||
import { assertExhaustive } from "../Common/utils";
|
||||
import invariant from "invariant";
|
||||
import type { CompilerContext } from "../CompilerContext";
|
||||
import { invariant } from "../CompilerError";
|
||||
import { OutputKind } from "../CompilerOutputs";
|
||||
import * as IR from "../IR";
|
||||
import * as LIR from "../LIR";
|
||||
import { isReactiveBlock, isRenderBlock } from "../LIR";
|
||||
import { PassKind, PassName } from "../Pass";
|
||||
|
||||
/**
|
||||
* An optional debug step when the output {@link OutputKind.IR} is enabled.
|
||||
|
||||
Reference in New Issue
Block a user