| Index: compiler/java/com/google/dart/compiler/resolver/Elements.java
|
| diff --git a/compiler/java/com/google/dart/compiler/resolver/Elements.java b/compiler/java/com/google/dart/compiler/resolver/Elements.java
|
| index 01ef8d560cb57458cade19fd36eb7a9183e27e38..34cb6f7f695c6ce61f76abc5053de4bb47aaa316 100644
|
| --- a/compiler/java/com/google/dart/compiler/resolver/Elements.java
|
| +++ b/compiler/java/com/google/dart/compiler/resolver/Elements.java
|
| @@ -713,6 +713,21 @@ static FieldElementImplementation fieldFromNode(DartField node,
|
| }
|
| return false;
|
| }
|
| +
|
| + /**
|
| + * @return <code>true</code> if given {@link Source} represents library with given name.
|
| + */
|
| + public static boolean isDart2JsLibrarySource(Source source) {
|
| + if (source instanceof DartSource) {
|
| + DartSource dartSource = (DartSource) source;
|
| + LibrarySource library = dartSource.getLibrary();
|
| + if (library != null) {
|
| + String libraryName = library.getName();
|
| + return libraryName.contains("lib/compiler/implementation/");
|
| + }
|
| + }
|
| + return false;
|
| + }
|
|
|
| /**
|
| * @return <code>true</code> if given {@link Source} represents code library declaration or
|
|
|