| 1405 | } |
| 1406 | |
| 1407 | void fxScopeCodingBlock(txScope* self, txCoder* coder) |
| 1408 | { |
| 1409 | if (self->declareNodeCount) { |
| 1410 | txDeclareNode* node = self->firstDeclareNode; |
| 1411 | while (node) { |
| 1412 | if (node->flags & mxDeclareNodeClosureFlag) { |
| 1413 | if (!(node->flags & mxDeclareNodeUseClosureFlag)) { |
| 1414 | node->index = coder->scopeLevel++; |
| 1415 | fxCoderAddVariable(coder, 0, XS_CODE_NEW_CLOSURE, node->symbol, node->index); |
| 1416 | if (node->description->token == XS_TOKEN_VAR) { |
| 1417 | fxCoderAddByte(coder, 1, XS_CODE_UNDEFINED); |
| 1418 | fxCoderAddIndex(coder, 0, XS_CODE_VAR_CLOSURE_1, node->index); |
| 1419 | fxCoderAddByte(coder, -1, XS_CODE_POP); |
| 1420 | } |
| 1421 | } |
| 1422 | } |
| 1423 | else { |
| 1424 | node->index = coder->scopeLevel++; |
| 1425 | if (node->symbol) |
| 1426 | fxCoderAddVariable(coder, 0, XS_CODE_NEW_LOCAL, node->symbol, node->index); |
| 1427 | else |
| 1428 | fxCoderAddIndex(coder, 0, XS_CODE_NEW_TEMPORARY, node->index); |
| 1429 | if (node->description->token == XS_TOKEN_VAR) { |
| 1430 | fxCoderAddByte(coder, 1, XS_CODE_UNDEFINED); |
| 1431 | fxCoderAddIndex(coder, 0, XS_CODE_VAR_LOCAL_1, node->index); |
| 1432 | fxCoderAddByte(coder, -1, XS_CODE_POP); |
| 1433 | } |
| 1434 | } |
| 1435 | node = node->nextDeclareNode; |
| 1436 | } |
| 1437 | if (self->flags & mxEvalFlag) { |
| 1438 | fxCoderAddByte(coder, 1, XS_CODE_UNDEFINED); |
| 1439 | fxCoderAddByte(coder, 0, XS_CODE_WITH); |
| 1440 | node = self->firstDeclareNode; |
| 1441 | while (node) { |
| 1442 | fxCoderAddIndex(coder, 0, XS_CODE_STORE_1, node->index); |
| 1443 | node = node->nextDeclareNode; |
| 1444 | } |
| 1445 | fxCoderAddByte(coder, -1, XS_CODE_POP); |
| 1446 | coder->environmentLevel++; |
| 1447 | } |
| 1448 | } |
| 1449 | } |
| 1450 | |
| 1451 | void fxScopeCodingBody(txScope* self, txCoder* coder) |
| 1452 | { |
no test coverage detected