MCPcopy Index your code
hub / github.com/nodejs/node / writeOperation

Function writeOperation

test/fixtures/snapshot/typescript.js:104177–104216  ·  view source on GitHub ↗

* Writes an operation as a statement to the current label's statement list. * * @param operation The OpCode of the operation

(operationIndex)

Source from the content-addressed store, hash-verified

104175 * @param operation The OpCode of the operation
104176 */
104177 function writeOperation(operationIndex) {
104178 tryEnterLabel(operationIndex);
104179 tryEnterOrLeaveBlock(operationIndex);
104180 // early termination, nothing else to process in this label
104181 if (lastOperationWasAbrupt) {
104182 return;
104183 }
104184 lastOperationWasAbrupt = false;
104185 lastOperationWasCompletion = false;
104186 var opcode = operations[operationIndex];
104187 if (opcode === 0 /* OpCode.Nop */) {
104188 return;
104189 }
104190 else if (opcode === 10 /* OpCode.Endfinally */) {
104191 return writeEndfinally();
104192 }
104193 var args = operationArguments[operationIndex];
104194 if (opcode === 1 /* OpCode.Statement */) {
104195 return writeStatement(args[0]);
104196 }
104197 var location = operationLocations[operationIndex];
104198 switch (opcode) {
104199 case 2 /* OpCode.Assign */:
104200 return writeAssign(args[0], args[1], location);
104201 case 3 /* OpCode.Break */:
104202 return writeBreak(args[0], location);
104203 case 4 /* OpCode.BreakWhenTrue */:
104204 return writeBreakWhenTrue(args[0], args[1], location);
104205 case 5 /* OpCode.BreakWhenFalse */:
104206 return writeBreakWhenFalse(args[0], args[1], location);
104207 case 6 /* OpCode.Yield */:
104208 return writeYield(args[0], location);
104209 case 7 /* OpCode.YieldStar */:
104210 return writeYieldStar(args[0], location);
104211 case 8 /* OpCode.Return */:
104212 return writeReturn(args[0], location);
104213 case 9 /* OpCode.Throw */:
104214 return writeThrow(args[0], location);
104215 }
104216 }
104217 /**
104218 * Writes a statement to the current label's statement list.
104219 *

Callers 1

buildStatementsFunction · 0.85

Calls 12

tryEnterLabelFunction · 0.85
tryEnterOrLeaveBlockFunction · 0.85
writeEndfinallyFunction · 0.85
writeStatementFunction · 0.85
writeAssignFunction · 0.85
writeBreakFunction · 0.85
writeBreakWhenTrueFunction · 0.85
writeBreakWhenFalseFunction · 0.85
writeYieldFunction · 0.85
writeYieldStarFunction · 0.85
writeReturnFunction · 0.85
writeThrowFunction · 0.85

Tested by

no test coverage detected