Minor in JS backend: add @Nullable to JsNameRef#getQualifier and JsNameRef#getSymbol.
This commit is contained in:
@@ -50,11 +50,13 @@ public final class JsNameRef extends JsExpressionImpl implements HasName {
|
|||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public Symbol getSymbol() {
|
public Symbol getSymbol() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
public JsExpression getQualifier() {
|
public JsExpression getQualifier() {
|
||||||
return qualifier;
|
return qualifier;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ abstract class FunctionContext(
|
|||||||
val staticRef = callName.staticRef
|
val staticRef = callName.staticRef
|
||||||
if (staticRef !is JsFunction) continue
|
if (staticRef !is JsFunction) continue
|
||||||
|
|
||||||
val functionCalled = staticRef as JsFunction
|
val functionCalled = staticRef
|
||||||
if (isFunctionCreator(functionCalled)) {
|
if (isFunctionCreator(functionCalled)) {
|
||||||
declareFunctionConstructorCall(call)
|
declareFunctionConstructorCall(call)
|
||||||
}
|
}
|
||||||
@@ -120,7 +120,7 @@ abstract class FunctionContext(
|
|||||||
|
|
||||||
/** remove ending `.call()` */
|
/** remove ending `.call()` */
|
||||||
if (isCallInvocation(call)) {
|
if (isCallInvocation(call)) {
|
||||||
callQualifier = (callQualifier as JsNameRef).getQualifier()
|
callQualifier = (callQualifier as JsNameRef).getQualifier()!!
|
||||||
}
|
}
|
||||||
|
|
||||||
/** in case 4, 5 get ref (reduce 4, 5 to 2, 3 accordingly) */
|
/** in case 4, 5 get ref (reduce 4, 5 to 2, 3 accordingly) */
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public fun getSimpleName(call: JsInvocation): JsName? {
|
|||||||
* @returns first name ident (iterating through qualifier chain)
|
* @returns first name ident (iterating through qualifier chain)
|
||||||
*/
|
*/
|
||||||
public fun getSimpleIdent(call: JsInvocation): String? {
|
public fun getSimpleIdent(call: JsInvocation): String? {
|
||||||
var qualifier = call.getQualifier()
|
var qualifier: JsExpression? = call.getQualifier()
|
||||||
|
|
||||||
while (qualifier != null) {
|
while (qualifier != null) {
|
||||||
when (qualifier) {
|
when (qualifier) {
|
||||||
|
|||||||
Reference in New Issue
Block a user