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

Function bindPrototypePropertyAssignment

test/fixtures/snapshot/typescript.js:47313–47323  ·  view source on GitHub ↗

* For `x.prototype.y = z`, declare a member `y` on `x` if `x` is a function or class, or not declared. * Note that jsdoc preceding an ExpressionStatement like `x.prototype.y;` is also treated as a declaration.

(lhs, parent)

Source from the content-addressed store, hash-verified

47311 * Note that jsdoc preceding an ExpressionStatement like `x.prototype.y;` is also treated as a declaration.
47312 */
47313 function bindPrototypePropertyAssignment(lhs, parent) {
47314 // Look up the function in the local scope, since prototype assignments should
47315 // follow the function declaration
47316 var classPrototype = lhs.expression;
47317 var constructorFunction = classPrototype.expression;
47318 // Fix up parent pointers since we're going to use these nodes before we bind into them
47319 ts.setParent(constructorFunction, classPrototype);
47320 ts.setParent(classPrototype, lhs);
47321 ts.setParent(lhs, parent);
47322 bindPropertyAssignment(constructorFunction, lhs, /*isPrototypeProperty*/ true, /*containerIsClass*/ true);
47323 }
47324 function bindObjectDefinePropertyAssignment(node) {
47325 var namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]);
47326 var isToplevel = node.parent.parent.kind === 305 /* SyntaxKind.SourceFile */;

Callers 2

bindWorkerFunction · 0.85

Calls 1

bindPropertyAssignmentFunction · 0.85

Tested by

no test coverage detected