mirror of
https://github.com/dart-lang/sdk
synced 2024-09-04 16:03:44 +00:00
Fix library prefixes on top-level elements. Update status file to reflect reality on library prefixes.
Review URL: https://chromereviews.googleplex.com/3521018 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
parent
78d16cca6c
commit
a717c9b7c1
|
@ -2431,6 +2431,8 @@ public class GenerateJavascriptAST {
|
|||
mangledName = mangler.mangleMethod((MethodElement) element, unitLibrary);
|
||||
if (element.getModifiers().isStatic()) {
|
||||
qualifier = referenceName(element.getEnclosingElement(), x.getTarget());
|
||||
} else if (Elements.isTopLevel(element)) {
|
||||
qualifier = null;
|
||||
} else {
|
||||
qualifier = (JsExpression) generate(x.getTarget());
|
||||
}
|
||||
|
|
|
@ -776,10 +776,17 @@ public class Resolver {
|
|||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case LIBRARY:
|
||||
// Library prefix, lookup the element in the reference library.
|
||||
element = ((LibraryElement) target).getScope().findElement(x.getFunctionNameString());
|
||||
if (element == null) {
|
||||
diagnoseErrorInMethodInvocation(x, null, null);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
checkInvocationTarget(x, currentMethod, target);
|
||||
// TODO(ngeoffray): handle library prefix
|
||||
visit(x.getArgs());
|
||||
return recordElement(x, element);
|
||||
}
|
||||
|
|
|
@ -96,6 +96,7 @@ import com.google.dart.compiler.resolver.CoreTypeProvider;
|
|||
import com.google.dart.compiler.resolver.CyclicDeclarationException;
|
||||
import com.google.dart.compiler.resolver.DuplicatedInterfaceException;
|
||||
import com.google.dart.compiler.resolver.Element;
|
||||
import com.google.dart.compiler.resolver.Elements;
|
||||
import com.google.dart.compiler.resolver.ElementKind;
|
||||
import com.google.dart.compiler.resolver.EnclosingElement;
|
||||
import com.google.dart.compiler.resolver.FieldElement;
|
||||
|
@ -657,7 +658,8 @@ public class TypeAnalyzer implements DartCompilationPhase {
|
|||
public Type visitMethodInvocation(DartMethodInvocation node) {
|
||||
String name = node.getFunctionNameString();
|
||||
Element element = (Element) node.getTargetSymbol();
|
||||
if (element != null && element.getModifiers().isStatic()) {
|
||||
if (element != null && (element.getModifiers().isStatic()
|
||||
|| Elements.isTopLevel(element))) {
|
||||
return checkInvocation(node, node, name, element.getType());
|
||||
}
|
||||
Type receiver = nonVoidTypeOf(node.getTarget());
|
||||
|
@ -1021,7 +1023,8 @@ public class TypeAnalyzer implements DartCompilationPhase {
|
|||
@Override
|
||||
public Type visitPropertyAccess(DartPropertyAccess node) {
|
||||
Element element = node.getTargetSymbol();
|
||||
if (element != null && element.getModifiers().isStatic()) {
|
||||
if (element != null && (element.getModifiers().isStatic()
|
||||
|| Elements.isTopLevel(element))) {
|
||||
return element.getType();
|
||||
}
|
||||
DartNode qualifier = node.getQualifier();
|
||||
|
|
|
@ -63,24 +63,8 @@ Switch3NegativeTest: Crash # Bug 5318228
|
|||
|
||||
|
||||
[ $arch == dartc || $arch == chromium ]
|
||||
Prefix1NegativeTest: Skip # Bug 5406175
|
||||
Prefix2NegativeTest: Skip # Bug 5406175
|
||||
Prefix3NegativeTest: Skip # Bug 5406175
|
||||
Prefix4NegativeTest: Skip # Bug 5406175
|
||||
Prefix5NegativeTest: Skip # Bug 5406175
|
||||
Prefix6NegativeTest: Skip # Bug 5406175
|
||||
Prefix7NegativeTest: Skip # Bug 5406175
|
||||
Prefix8NegativeTest: Skip # Bug 5406175
|
||||
Prefix9NegativeTest: Skip # Bug 5406175
|
||||
Prefix10NegativeTest: Skip # Bug 5406175
|
||||
Prefix11NegativeTest: Skip # Bug 5406175
|
||||
Prefix12NegativeTest: Skip # Bug 5406175
|
||||
PrefixTest: Skip # Bug 5406175
|
||||
Prefix10Test: Skip # Bug 5406175
|
||||
Prefix11Test: Skip # Bug 5406175
|
||||
Prefix12Test: Skip # Bug 5406175
|
||||
LibraryPrefixesTest: Skip # Bug 5406175
|
||||
TopLevelNonPrefixedLibraryTest: Skip # Bug 5406175
|
||||
Prefix11NegativeTest: Fail # Bug 5406175
|
||||
Prefix12NegativeTest: Fail,Crash # Bug 5406175
|
||||
DefaultFactoryTest: Fail # Bug 5009110
|
||||
FunctionTypeParameterNegativeTest: Fail # Bug 4568007
|
||||
ImplicitScopeTest: FAIL # Nested statements can be declarations
|
||||
|
@ -170,6 +154,25 @@ TopLevelEntryTest: Fail # Bug 5145731
|
|||
PrivateTest: Fail # Bug 5145731
|
||||
Private3Test: Fail # Bug 5145731
|
||||
|
||||
Prefix1NegativeTest: Skip # Bug 5406175
|
||||
Prefix2NegativeTest: Skip # Bug 5406175
|
||||
Prefix3NegativeTest: Skip # Bug 5406175
|
||||
Prefix4NegativeTest: Skip # Bug 5406175
|
||||
Prefix5NegativeTest: Skip # Bug 5406175
|
||||
Prefix6NegativeTest: Skip # Bug 5406175
|
||||
Prefix7NegativeTest: Skip # Bug 5406175
|
||||
Prefix8NegativeTest: Skip # Bug 5406175
|
||||
Prefix9NegativeTest: Skip # Bug 5406175
|
||||
Prefix10NegativeTest: Skip # Bug 5406175
|
||||
Prefix11NegativeTest: Skip # Bug 5406175
|
||||
Prefix12NegativeTest: Skip # Bug 5406175
|
||||
PrefixTest: Crash,Fail # Bug 5406175
|
||||
Prefix10Test: Crash,Fail # Bug 5406175
|
||||
Prefix11Test: Crash,Fail # Bug 5406175
|
||||
Prefix12Test: Crash,Fail # Bug 5406175
|
||||
LibraryPrefixesTest: Fail # Bug 5406175
|
||||
TopLevelNonPrefixedLibraryTest: Fail # Bug 5406175
|
||||
|
||||
[ $arch == chromium && $mode == release ]
|
||||
Instanceof2Test: Fail, Pass # Bug 5275232
|
||||
|
||||
|
|
Loading…
Reference in a new issue