What each name carried, so the message echoes the caller's own value.
OptionalcauseReadonlycodeStable discriminant — branch on this, not on instanceof.
ReadonlykindDiscriminated tag for exhaustive matching.
ReadonlyoptionsThe removed option names present on the bag, in the order checked.
OptionalstackStaticstackThe Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
StaticcaptureCreates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();
OptionalconstructorOpt: FunctionStaticprepare
The engine-selection options 0.5.0 removed, named on the bag that still carries one.
Remarks
#280 deleted
CreateCauslOptions.engine,CreateCauslOptions.backendandAuthoritativeWasmOptions.fallbackToTs/.fallbackToJsfrom the TYPES, and for one release that was the whole of the removal — every construct path simply stopped reading them. Measured onaeeab58, afterpreloadCauslWasm():Excess-property checking only fires on an object LITERAL assigned straight into the parameter. A variable, a bag typed as
CreateCauslOptions, a value parsed from JSON or an env-driven config, anas never/as any, a@ts-expect-error, or any JavaScript caller passes all four through in silence — so the compile-time removal covers the callers who were least likely to have pinned an engine, and misses the ones who did it deliberately.That is the SILENT ENGINE SWAP this release exists to abolish, one option name over. A 0.4.x adopter who wrote
engine: 'js-ssot'on purpose — because their suite depends on the floor's behaviour on the §18A.1.1 surfaces #272 established the two engines disagree on — is moved ontorust-ssotwith no warning, no event, and no throw. It is also the only one of #280's removals with no loud signal at all: the capability fallback throws, the missing preload throws, and this returned a working graph running the other engine.Note that the third line above is a REGRESSION beyond the removal itself. At the merge-base a typo'd value was a
RangeErrorfromresolveWasmEngineMode("engine must be 'js-ssot' or 'rust-ssot'"); #280 deleted that validator along with the option, so 0.5.0 accepts nonsense where 0.4.x refused it.So the options are now REMOVED rather than ignored, which is what
CHANGELOG.md's migration step 5 already promised in writing. The remedy is always the same and is stated on the error: delete the option. There is one engine,createCausl()returns it or throws, and nothing is lost by dropping the key.Branch on
error.code === 'CAUSL_REMOVED_ENGINE_OPTION'.