Re-add null check for closure-data (Originally removed in 177dee8f16)

Review URL: https://codereview.chromium.org/2438823002 .
This commit is contained in:
Sigmund Cherem 2016-10-20 14:21:00 -07:00
parent d274e8adf8
commit 61bf1c2dc0

View file

@ -81,11 +81,13 @@ class RuntimeTypeGenerator {
if (!method.isAbstract) {
ClosureClassMap closureData = compiler.closureToClassMapper
.getClosureToClassMapping(method.resolvedAst);
ClosureFieldElement thisLocal =
closureData.freeVariableMap[closureData.thisLocal];
if (thisLocal != null) {
jsAst.Name thisName = namer.instanceFieldPropertyName(thisLocal);
thisAccess = js('this.#', thisName);
if (closureData != null) {
ClosureFieldElement thisLocal =
closureData.freeVariableMap[closureData.thisLocal];
if (thisLocal != null) {
jsAst.Name thisName = namer.instanceFieldPropertyName(thisLocal);
thisAccess = js('this.#', thisName);
}
}
}