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

Function visitAssignmentPattern

test/fixtures/snapshot/typescript.js:95841–95864  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

95839 return ts.visitNode(node, visitor);
95840 }
95841 function visitAssignmentPattern(node) {
95842 if (ts.isArrayLiteralExpression(node)) {
95843 // Transforms private names in destructuring assignment array bindings.
95844 // Transforms SuperProperty assignments in destructuring assignment array bindings in static initializers.
95845 //
95846 // Source:
95847 // ([ this.#myProp ] = [ "hello" ]);
95848 //
95849 // Transformation:
95850 // [ { set value(x) { this.#myProp = x; } }.value ] = [ "hello" ];
95851 return factory.updateArrayLiteralExpression(node, ts.visitNodes(node.elements, visitArrayAssignmentTarget, ts.isExpression));
95852 }
95853 else {
95854 // Transforms private names in destructuring assignment object bindings.
95855 // Transforms SuperProperty assignments in destructuring assignment object bindings in static initializers.
95856 //
95857 // Source:
95858 // ({ stringProperty: this.#myProp } = { stringProperty: "hello" });
95859 //
95860 // Transformation:
95861 // ({ stringProperty: { set value(x) { this.#myProp = x; } }.value }) = { stringProperty: "hello" };
95862 return factory.updateObjectLiteralExpression(node, ts.visitNodes(node.properties, visitObjectAssignmentTarget, ts.isObjectLiteralElementLike));
95863 }
95864 }
95865 }
95866 ts.transformClassFields = transformClassFields;
95867 function createPrivateStaticFieldInitializer(variableName, initializer) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected