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

Function isControl

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

Source from the content-addressed store, hash-verified

75}
76
77export function isControl(v: Value | Control | Reference): v is Control {
78 switch (v.type) {
79 case 'null':
80 case 'bool':
81 case 'num':
82 case 'str':
83 case 'arr':
84 case 'obj':
85 case 'fn':
86 case 'error':
87 case 'reference':
88 return false;
89 case 'return':
90 case 'break':
91 case 'continue':
92 return true;
93 }
94 // exhaustive check
95 v satisfies never;
96 throw new TypeError('expected value or control');
97}

Callers 6

_evalBinaryOperationMethod · 0.85
__evalMethod · 0.85
__evalSyncMethod · 0.85
getReferenceMethod · 0.85
getReferenceSyncMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected