From 56d042468f7e84f6ed537e54300fc74bd3054ff1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=96=87=E7=92=90?= Date: Tue, 5 Jun 2018 18:45:36 +0800 Subject: [PATCH] add commnet --- src/compiler/checker.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index be8b11bf1f0..e2c4c81751c 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -17107,6 +17107,8 @@ namespace ts { }); // A protected property is accessible if the property is within the declaring class or classes derived from it if (!enclosingClass) { + // allow PropertyAccessibility if context is in function with this parameter + // static member access is disallow let thisParameter: ParameterDeclaration | undefined; const thisContainer = getThisContainer(node, /* includeArrowFunctions */ false); if (flags & ModifierFlags.Static || !thisContainer || !isFunctionLike(thisContainer) || !(thisParameter = getThisParameter(thisContainer)) || !thisParameter.type) {