MCPcopy Create free account
hub / github.com/aiscript-dev/aiscript / assertValue

Function assertValue

src/interpreter/control.ts:64–75  ·  view source on GitHub ↗
(v: Value | Control)

Source from the content-addressed store, hash-verified

62}
63
64export function assertValue(v: Value | Control): asserts v is Value {
65 switch (v.type) {
66 case 'return':
67 throw new AiScriptRuntimeError('Invalid return');
68 case 'break':
69 throw new AiScriptRuntimeError('Invalid break');
70 case 'continue':
71 throw new AiScriptRuntimeError('Invalid continue');
72 default:
73 v satisfies Value;
74 }
75}
76
77export function isControl(v: Value | Control | Reference): v is Control {
78 switch (v.type) {

Callers 7

execMethod · 0.85
execSyncMethod · 0.85
collectNsMemberMethod · 0.85
collectNsMemberSyncMethod · 0.85
evalAndSetAttrMethod · 0.85
evalAndSetAttrSyncMethod · 0.85
unWrapRetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected