From 2b2a1b4b3e18acb1be68841e8d490ac7f5be88d8 Mon Sep 17 00:00:00 2001 From: tdurieux Date: Tue, 7 Mar 2017 13:25:02 +0100 Subject: [PATCH] fixed files form Closure #117 --- .../javascript/jscomp/TypeValidator.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/projects/Closure/117/com/google/javascript/jscomp/TypeValidator.java b/projects/Closure/117/com/google/javascript/jscomp/TypeValidator.java index bcd024a..f57ae14 100644 --- a/projects/Closure/117/com/google/javascript/jscomp/TypeValidator.java +++ b/projects/Closure/117/com/google/javascript/jscomp/TypeValidator.java @@ -722,8 +722,20 @@ private String formatFoundRequired(String description, JSType found, * to an Object type, if possible. */ String getReadableJSTypeName(Node n, boolean dereference) { + JSType type = getJSType(n); + if (dereference) { + ObjectType dereferenced = type.dereference(); + if (dereferenced != null) { + type = dereferenced; + } + } // The best type name is the actual type name. + if (type.isFunctionPrototypeType() || + (type.toObjectType() != null && + type.toObjectType().getConstructor() != null)) { + return type.toString(); + } // If we're analyzing a GETPROP, the property may be inherited by the // prototype chain. So climb the prototype chain and find out where @@ -753,18 +765,6 @@ String getReadableJSTypeName(Node n, boolean dereference) { } } - JSType type = getJSType(n); - if (dereference) { - ObjectType dereferenced = type.dereference(); - if (dereferenced != null) { - type = dereferenced; - } - } - if (type.isFunctionPrototypeType() || - (type.toObjectType() != null && - type.toObjectType().getConstructor() != null)) { - return type.toString(); - } String qualifiedName = n.getQualifiedName(); if (qualifiedName != null) { return qualifiedName;