10000 Adding a few comments per CR feedback · johnangularjs/TypeScript@c96eee0 · GitHub
[go: up one dir, main page]

Skip to content

Commit c96eee0

Browse files
committed
Adding a few comments per CR feedback
1 parent 7c2a3c2 commit c96eee0

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/compiler/binder.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -386,10 +386,10 @@ module ts {
386386

387387
function declareSymbolAndAddToSymbolTableWorker(node: Declaration, symbolFlags: SymbolFlags, symbolExcludes: SymbolFlags): Symbol {
388388
switch (container.kind) {
389-
// Modules, source files, and classes need specialized handling for how their
389+
// Modules, source files, and classes need specialized handling for how their
390390
// members are declared (for example, a member of a class will go into a specific
391-
// symbol table depending on if it is static or not). As such, we defer to
392-
// specialized handlers to take care of declaring these child members.
391+
// symbol table depending on if it is static or not). We defer to specialized
392+
// handlers to take care of declaring these child members.
393393
case SyntaxKind.ModuleDeclaration:
394394
return declareModuleMember(node, symbolFlags, symbolExcludes);
395395

@@ -407,9 +407,10 @@ module ts {
407407
case SyntaxKind.ObjectLiteralExpression:
408408
case SyntaxKind.InterfaceDeclaration:
409409
// Interface/Object-types always have their children added to the 'members' of
410-
// their container. They are only accessible through an instance of their
411-
// container, and are never in scope otherwise (even inside the body of the
412-
// object / type / interface declaring them).
410+
// their container. They are only accessible through an instance of their
411+
// container, and are never in scope otherwise (even inside the body of the
412+
// object / type / interface declaring them). An exception is type parameters,
413+
// which are in scope without qualification (similar to 'locals').
413414
return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes);
414415

415416
case SyntaxKind.FunctionType:
@@ -427,10 +428,10 @@ module ts {
427428
case SyntaxKind.ArrowFunction:
428429
case SyntaxKind.TypeAliasDeclaration:
429430
// All the children of these container types are never visible through another
430-
// symbol (i.e. through another symbol's 'exports' or 'members'). Instead,
431-
// they're only accessed 'lexically' (i.e. from code that exists underneath
431+
// symbol (i.e. through another symbol's 'exports' or 'members'). Instead,
432+
// they're only accessed 'lexically' (i.e. from code that exists underneath
432433
// their container in the tree. To accomplish this, we simply add their declared
433-
// symbol to the 'locals' of the container. These symbols can then be found as
434+
// symbol to the 'locals' of the container. These symbols can then be found as
434435
// the type checker walks up the containers, checking them for matching names.
435436
return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes);
436437
}

0 commit comments

Comments
 (0)
0