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:
Lauren Tan
2022-10-14 12:10:53 -04:00
parent b1006e12cd
commit 58100e3d60
2 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -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";
+6 -6
View File
@@ -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.