refactor(analysis): remove fixed result quotas
This commit is contained in:
@@ -4,17 +4,12 @@ import type {
|
||||
JavaScriptSemanticPrimitive,
|
||||
JavaScriptSemanticValue,
|
||||
} from "./javascriptSemanticIr.js";
|
||||
import type { JavaScriptSemanticAnalysisState } from "./javascriptSemanticState.js";
|
||||
import {
|
||||
reachSemanticValueLimit,
|
||||
semanticPrimitiveKey,
|
||||
} from "./javascriptSemanticProvenance.js";
|
||||
import { semanticPrimitiveKey } from "./javascriptSemanticProvenance.js";
|
||||
import { compareCodePoints } from "./javascriptStaticAnalysisHelpers.js";
|
||||
|
||||
/** Normalize one bounded collection of possible primitive values. */
|
||||
export const semanticPrimitiveSet = (
|
||||
values: readonly JavaScriptSemanticPrimitive[],
|
||||
state: JavaScriptSemanticAnalysisState,
|
||||
): JavaScriptSemanticValue => {
|
||||
const unique = [
|
||||
...new Map(
|
||||
@@ -23,13 +18,6 @@ export const semanticPrimitiveSet = (
|
||||
].sort((left, right) =>
|
||||
compareCodePoints(semanticPrimitiveKey(left), semanticPrimitiveKey(right)),
|
||||
);
|
||||
if (unique.length > state.limits.maxUnionValues) {
|
||||
reachSemanticValueLimit(state, "maxUnionValues");
|
||||
return {
|
||||
status: "limit-reached",
|
||||
reason: "maxUnionValues reached.",
|
||||
};
|
||||
}
|
||||
const only = unique[0];
|
||||
return unique.length === 1 && only !== undefined
|
||||
? { status: "literal", value: only }
|
||||
|
||||
Reference in New Issue
Block a user