JS: refactor code that exports local declaration from current module

This commit is contained in:
Alexey Andreev
2016-10-25 16:28:39 +03:00
parent f244bbaae3
commit cc38bd3146
5 changed files with 134 additions and 189 deletions
@@ -27,7 +27,6 @@ import org.jetbrains.kotlin.js.inline.util.CollectUtilsKt;
import java.util.Map;
import static org.jetbrains.kotlin.js.inline.util.CollectUtilsKt.collectNamedFunctions;
import static org.jetbrains.kotlin.js.inline.util.CollectUtilsKt.collectJsProperties;
public class AstSearchUtil {
@NotNull
@@ -37,13 +36,6 @@ public class AstSearchUtil {
return function;
}
@NotNull
public static JsExpression getProperty(@NotNull JsNode searchRoot, @NotNull String name) {
JsExpression property = findByIdent(collectJsProperties(searchRoot), name);
assert property != null: "Property `" + name + "` was not found";
return property;
}
@NotNull
public static JsExpression getMetadataOrFunction(@NotNull JsNode searchRoot, @NotNull String name) {
JsExpression property = findByIdent(CollectUtilsKt.collectNamedFunctionsOrMetadata(searchRoot), name);