MCPcopy Index your code
hub / github.com/aiscript-dev/aiscript / getAttr

Function getAttr

test/interpreter.ts:330–337  ·  view source on GitHub ↗
(name: string, script: string)

Source from the content-addressed store, hash-verified

328
329describe('Attribute', () => {
330 const getAttr = async (name: string, script: string): Promise<Value['attr']> => {
331 const parser = new Parser();
332 const interpreter = new Interpreter({});
333 const ast = parser.parse(script);
334 await interpreter.exec(ast);
335 const value = interpreter.scope.get(name);
336 return value.attr;
337 };
338
339 test.concurrent('no attribute', async () => {
340 const attr = await getAttr('f', `

Callers 1

interpreter.tsFile · 0.85

Calls 3

parseMethod · 0.95
execMethod · 0.95
getMethod · 0.65

Tested by

no test coverage detected