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

Function bindObjectLiteralExpression

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

Source from the content-addressed store, hash-verified

46409 typeLiteralSymbol.members.set(symbol.escapedName, symbol);
46410 }
46411 function bindObjectLiteralExpression(node) {
46412 var ElementKind;
46413 (function (ElementKind) {
46414 ElementKind[ElementKind["Property"] = 1] = "Property";
46415 ElementKind[ElementKind["Accessor"] = 2] = "Accessor";
46416 })(ElementKind || (ElementKind = {}));
46417 if (inStrictMode && !ts.isAssignmentTarget(node)) {
46418 var seen = new ts.Map();
46419 for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
46420 var prop = _a[_i];
46421 if (prop.kind === 298 /* SyntaxKind.SpreadAssignment */ || prop.name.kind !== 79 /* SyntaxKind.Identifier */) {
46422 continue;
46423 }
46424 var identifier = prop.name;
46425 // ECMA-262 11.1.5 Object Initializer
46426 // If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true
46427 // a.This production is contained in strict code and IsDataDescriptor(previous) is true and
46428 // IsDataDescriptor(propId.descriptor) is true.
46429 // b.IsDataDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true.
46430 // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true.
46431 // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true
46432 // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields
46433 var currentKind = prop.kind === 296 /* SyntaxKind.PropertyAssignment */ || prop.kind === 297 /* SyntaxKind.ShorthandPropertyAssignment */ || prop.kind === 169 /* SyntaxKind.MethodDeclaration */
46434 ? 1 /* ElementKind.Property */
46435 : 2 /* ElementKind.Accessor */;
46436 var existingKind = seen.get(identifier.escapedText);
46437 if (!existingKind) {
46438 seen.set(identifier.escapedText, currentKind);
46439 continue;
46440 }
46441 }
46442 }
46443 return bindAnonymousDeclaration(node, 4096 /* SymbolFlags.ObjectLiteral */, "__object" /* InternalSymbolName.Object */);
46444 }
46445 function bindJsxAttributes(node) {
46446 return bindAnonymousDeclaration(node, 4096 /* SymbolFlags.ObjectLiteral */, "__jsxAttributes" /* InternalSymbolName.JSXAttributes */);
46447 }

Callers 1

bindWorkerFunction · 0.85

Calls 3

bindAnonymousDeclarationFunction · 0.85
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…