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

Function transformProperty

test/fixtures/snapshot/typescript.js:95302–95313  ·  view source on GitHub ↗

* Transforms a property initializer into an assignment statement. * * @param property The property declaration. * @param receiver The object receiving the property assignment.

(property, receiver)

Source from the content-addressed store, hash-verified

95300 * @param receiver The object receiving the property assignment.
95301 */
95302 function transformProperty(property, receiver) {
95303 var savedCurrentStaticPropertyDeclarationOrStaticBlock = currentStaticPropertyDeclarationOrStaticBlock;
95304 var transformed = transformPropertyWorker(property, receiver);
95305 if (transformed && ts.hasStaticModifier(property) && (currentClassLexicalEnvironment === null || currentClassLexicalEnvironment === void 0 ? void 0 : currentClassLexicalEnvironment.facts)) {
95306 // capture the lexical environment for the member
95307 ts.setOriginalNode(transformed, property);
95308 ts.addEmitFlags(transformed, 2 /* EmitFlags.AdviseOnEmitNode */);
95309 classLexicalEnvironmentMap.set(ts.getOriginalNodeId(transformed), currentClassLexicalEnvironment);
95310 }
95311 currentStaticPropertyDeclarationOrStaticBlock = savedCurrentStaticPropertyDeclarationOrStaticBlock;
95312 return transformed;
95313 }
95314 function transformPropertyWorker(property, receiver) {
95315 var _a;
95316 // We generate a name here in order to reuse the value cached by the relocated computed name expression (which uses the same generated name)

Calls 2

transformPropertyWorkerFunction · 0.85
setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…