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

Function fx_parseURLShortenPath

modules/data/url/url.c:1478–1501  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1476}
1477
1478void fx_parseURLShortenPath(txMachine* the, txSlot* path)
1479{
1480 txIndex length;
1481 txBoolean flag;
1482 mxPushSlot(path);
1483 mxGetID(mxID(_length));
1484 length = (txIndex)fxToLength(the, the->stack);
1485 mxPop();
1486 if (length == 1) {
1487 mxPushSlot(path);
1488 mxGetIndex(0);
1489 flag = fx_parseURLIsWindowsDriveLetter(the, the->stack->value.string, 0);
1490 mxPop();
1491 if (flag)
1492 return;
1493 }
1494 if (length > 0) {
1495 length--;
1496 mxPushInteger(length);
1497 mxPushSlot(path);
1498 mxSetID(mxID(_length));
1499 mxPop();
1500 }
1501}
1502
1503void fx_serializeURL(txMachine* the)
1504{

Callers 2

fx_parseURLFunction · 0.85
fx_parseURLPushPathFunction · 0.85

Calls 2

fxToLengthFunction · 0.85

Tested by

no test coverage detected