MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / _xsbug_script_

Function _xsbug_script_

tools/test262/_262.c:321–364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

319}
320
321void _xsbug_script_(txMachine* the)
322{
323 txSlot* realm = mxProgram.value.reference->next->value.module.realm;
324 mxTry(the) {
325 txParser _parser;
326 txParser* parser = &_parser;
327 txParserJump jump;
328 txString name = NULL;
329 txScript* script = NULL;
330 fxInitializeParser(parser, the, the->parserBufferSize, the->parserTableModulo);
331 parser->firstJump = &jump;
332 if (c_setjmp(jump.jmp_buf) == 0) {
333 txStringStream stream;
334 stream.slot = mxArgv(3);
335 stream.offset = 0;
336 stream.size = fxToInteger(the, mxArgv(5)) - 1;
337 parser->path = fxNewParserSymbol(parser, fxToString(the, mxArgv(1)));
338 fxParserTree(parser, &stream, fxStringGetter, mxProgramFlag | mxDebugFlag | mxStrictFlag, &name);
339 fxParserHoist(parser);
340 fxParserBind(parser);
341 script = fxParserCode(parser);
342 }
343 #ifdef mxInstrument
344 if (the->peakParserSize < parser->total)
345 the->peakParserSize = parser->total;
346 #endif
347 name = fxNewParserChunk(parser, 8 + parser->path->length);
348 strcpy(name, "xsbug://");
349 strcat(name, parser->path->string);
350 mxModuleInstanceInternal(mxProgram.value.reference)->value.module.id = fxID(the, name);
351 fxTerminateParser(parser);
352 if (xsTest(xsArg(2)))
353 gxTest262Async = TEST262_ASYNC_WAITING;
354 fxRunScript(the, script, mxRealmGlobal(realm), C_NULL, mxRealmClosures(realm)->value.reference, C_NULL, mxProgram.value.reference);
355 mxPop();
356 if (gxTest262Async == TEST262_SYNC)
357 fxBubble(the, 2, "<", 0, "test262");
358 }
359 mxCatch(the) {
360 mxPush(mxException);
361 fxBubble(the, 2, fxToString(the, the->stack), 0, "test262");
362 mxPop();
363 }
364}
365
366void fx_agent_get_safeBroadcast(xsMachine* the)
367{

Callers

nothing calls this directly

Calls 13

fxInitializeParserFunction · 0.85
fxToIntegerFunction · 0.85
fxNewParserSymbolFunction · 0.85
fxToStringFunction · 0.85
fxParserTreeFunction · 0.85
fxParserHoistFunction · 0.85
fxParserBindFunction · 0.85
fxParserCodeFunction · 0.85
fxNewParserChunkFunction · 0.85
fxIDFunction · 0.85
fxTerminateParserFunction · 0.85
fxRunScriptFunction · 0.85

Tested by

no test coverage detected