Skip to content

Commit

Permalink
Remove dead POLY_SKIPPED code
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie committed Apr 8, 2024
1 parent f92749e commit 79aa80f
Showing 1 changed file with 1 addition and 39 deletions.
40 changes: 1 addition & 39 deletions grafast/grafast/src/engine/executeBucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@ import * as assert from "../assert.js";
import type { Bucket, RequestTools } from "../bucket.js";
import { isDev } from "../dev.js";
import type { GrafastError } from "../error.js";
import {
$$error,
isGrafastError,
newGrafastError,
SafeError,
} from "../error.js";
import { $$error, newGrafastError, SafeError } from "../error.js";
import { inspect } from "../inspect.js";
import type {
BatchExecutionValue,
Expand Down Expand Up @@ -43,23 +38,9 @@ import { timeSource } from "../timeSource.js";
import { arrayOfLength, isPromiseLike, sudo } from "../utils.js";
import type { MetaByMetaKey } from "./OperationPlan.js";

const DEBUG_POLYMORPHISM = false;

/** Path to use when there's no polymorphic paths. */
const NO_POLY_PATH = "";

// TODO: the handling of polymorphism via POLY_SKIPPED is distasteful. Find a
// better approach.

// An error that indicates this entry was skipped because it didn't match
// polymorphicPath.
const POLY_SKIPPED = newGrafastError(
new Error(
"GrafastInternalError<757b99f9-cb4d-4141-895d-8c687b2048fd>: Polymorphic skipped; you should never see this",
),
null,
);

const timeoutError = Object.freeze(
new SafeError(
"Execution timeout exceeded, please simplify or add limits to your request.",
Expand Down Expand Up @@ -761,25 +742,6 @@ export function executeBucket(
stepPolymorphicPaths !== null &&
!stepPolymorphicPaths.has(polymorphicPathList[index] as string)
) {
/*
const e =
isDev && DEBUG_POLYMORPHISM
? Object.assign(
newGrafastError(
new Error(
`GrafastInternalError<00d52055-06b0-4b25-abeb-311b800ea284>: step ${
step.id
} (polymorphicPaths ${[
...stepPolymorphicPaths,
]}) has no match for '${polymorphicPathList[index]}'`,
),
step.id,
),
{ $$error: POLY_SKIPPED },
)
: POLY_SKIPPED;
indexError = e;
*/
indexFlags |= FLAG_POLY_SKIPPED;
forceIndexValue = null;
} else if (extra._bucket.flagUnion !== NO_FLAGS) {
Expand Down

0 comments on commit 79aa80f

Please sign in to comment.