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

Function isReadonlySymbol

test/fixtures/snapshot/typescript.js:78290–78304  ·  view source on GitHub ↗
(symbol)

Source from the content-addressed store, hash-verified

78288 return !setProp;
78289 }
78290 function isReadonlySymbol(symbol) {
78291 // The following symbols are considered read-only:
78292 // Properties with a 'readonly' modifier
78293 // Variables declared with 'const'
78294 // Get accessors without matching set accessors
78295 // Enum members
78296 // Object.defineProperty assignments with writable false or no setter
78297 // Unions and intersections of the above (unions and intersections eagerly set isReadonly on creation)
78298 return !!(ts.getCheckFlags(symbol) & 8 /* CheckFlags.Readonly */ ||
78299 symbol.flags & 4 /* SymbolFlags.Property */ && ts.getDeclarationModifierFlagsFromSymbol(symbol) & 64 /* ModifierFlags.Readonly */ ||
78300 symbol.flags & 3 /* SymbolFlags.Variable */ && getDeclarationNodeFlagsFromSymbol(symbol) & 2 /* NodeFlags.Const */ ||
78301 symbol.flags & 98304 /* SymbolFlags.Accessor */ && !(symbol.flags & 65536 /* SymbolFlags.SetAccessor */) ||
78302 symbol.flags & 8 /* SymbolFlags.EnumMember */ ||
78303 ts.some(symbol.declarations, isReadonlyAssignmentDeclaration));
78304 }
78305 function isAssignmentToReadonlyEntity(expr, symbol, assignmentKind) {
78306 var _a, _b;
78307 if (assignmentKind === 0 /* AssignmentKind.None */) {

Callers 12

addPropertyToElementListFunction · 0.85
getSpreadSymbolFunction · 0.85
propertyRelatedToFunction · 0.85
comparePropertiesFunction · 0.85
isConstantReferenceFunction · 0.85
checkIdentifierFunction · 0.85
checkDeleteExpressionFunction · 0.85

Calls 2

someMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…