Version 0.8.10.5
svn merge -c 29848 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 29863 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 29883 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 29885 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 29887 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 29888 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 29894 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 29897 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 29901 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 29902 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 29904 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 29905 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 29906 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 29907 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 29908 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 29909 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 29910 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 29911 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
Review URL: https://codereview.chromium.org//60293003
git-svn-id: http://dart.googlecode.com/svn/trunk@29917 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/runtime/bin/socket.cc b/runtime/bin/socket.cc
index 4dfbe50..48acaf3 100644
--- a/runtime/bin/socket.cc
+++ b/runtime/bin/socket.cc
@@ -235,13 +235,24 @@
if (Dart_IsError(err)) Dart_PropagateError(err);
OSError os_error;
intptr_t port = 0;
- ASSERT(INET6_ADDRSTRLEN >= INET_ADDRSTRLEN);
- char host[INET6_ADDRSTRLEN];
- if (Socket::GetRemotePeer(socket, host, &port)) {
+ SocketAddress* addr = Socket::GetRemotePeer(socket, &port);
+ if (addr != NULL) {
Dart_Handle list = Dart_NewList(2);
- Dart_ListSetAt(list, 0, Dart_NewStringFromCString(host));
+
+ Dart_Handle entry = Dart_NewList(3);
+ Dart_ListSetAt(entry, 0, Dart_NewInteger(addr->GetType()));
+ Dart_ListSetAt(entry, 1, Dart_NewStringFromCString(addr->as_string()));
+
+ RawAddr raw = addr->addr();
+ intptr_t data_length = SocketAddress::GetAddrLength(&raw);
+ Dart_Handle data = Dart_NewTypedData(Dart_TypedData_kUint8, data_length);
+ Dart_ListSetAsBytes(data, 0, reinterpret_cast<uint8_t*>(&raw), data_length);
+ Dart_ListSetAt(entry, 2, data);
+
+ Dart_ListSetAt(list, 0, entry);
Dart_ListSetAt(list, 1, Dart_NewInteger(port));
Dart_SetReturnValue(args, list);
+ delete addr;
} else {
Dart_SetReturnValue(args, DartUtils::NewDartOSError());
}
diff --git a/runtime/bin/socket.h b/runtime/bin/socket.h
index 63fc5ef..ce94c5e 100644
--- a/runtime/bin/socket.h
+++ b/runtime/bin/socket.h
@@ -163,7 +163,7 @@
static intptr_t CreateConnect(RawAddr addr,
const intptr_t port);
static intptr_t GetPort(intptr_t fd);
- static bool GetRemotePeer(intptr_t fd, char* host, intptr_t* port);
+ static SocketAddress* GetRemotePeer(intptr_t fd, intptr_t* port);
static void GetError(intptr_t fd, OSError* os_error);
static int GetType(intptr_t fd);
static intptr_t GetStdioHandle(intptr_t num);
diff --git a/runtime/bin/socket_android.cc b/runtime/bin/socket_android.cc
index 38c1c7f..02aed0b 100644
--- a/runtime/bin/socket_android.cc
+++ b/runtime/bin/socket_android.cc
@@ -136,7 +136,7 @@
}
-bool Socket::GetRemotePeer(intptr_t fd, char *host, intptr_t *port) {
+SocketAddress* Socket::GetRemotePeer(intptr_t fd, intptr_t* port) {
ASSERT(fd >= 0);
RawAddr raw;
socklen_t size = sizeof(raw);
@@ -148,23 +148,10 @@
char error_message[kBufferSize];
strerror_r(errno, error_message, kBufferSize);
Log::PrintErr("Error getpeername: %s\n", error_message);
- return false;
- }
- if (TEMP_FAILURE_RETRY(getnameinfo(&raw.addr,
- size,
- host,
- INET6_ADDRSTRLEN,
- NULL,
- 0,
- NI_NUMERICHOST)) != 0) {
- const int kBufferSize = 1024;
- char error_message[kBufferSize];
- strerror_r(errno, error_message, kBufferSize);
- Log::PrintErr("Error getnameinfo: %s\n", error_message);
- return false;
+ return NULL;
}
*port = SocketAddress::GetAddrPort(&raw);
- return true;
+ return new SocketAddress(&raw.addr);
}
diff --git a/runtime/bin/socket_linux.cc b/runtime/bin/socket_linux.cc
index b9431e1..c3c01cc 100644
--- a/runtime/bin/socket_linux.cc
+++ b/runtime/bin/socket_linux.cc
@@ -137,7 +137,7 @@
}
-bool Socket::GetRemotePeer(intptr_t fd, char *host, intptr_t *port) {
+SocketAddress* Socket::GetRemotePeer(intptr_t fd, intptr_t* port) {
ASSERT(fd >= 0);
RawAddr raw;
socklen_t size = sizeof(raw);
@@ -149,23 +149,10 @@
char error_buf[kBufferSize];
Log::PrintErr("Error getpeername: %s\n",
strerror_r(errno, error_buf, kBufferSize));
- return false;
- }
- if (TEMP_FAILURE_RETRY(getnameinfo(&raw.addr,
- size,
- host,
- INET6_ADDRSTRLEN,
- NULL,
- 0,
- NI_NUMERICHOST)) != 0) {
- const int kBufferSize = 1024;
- char error_buf[kBufferSize];
- Log::PrintErr("Error getnameinfo: %s\n",
- strerror_r(errno, error_buf, kBufferSize));
- return false;
+ return NULL;
}
*port = SocketAddress::GetAddrPort(&raw);
- return true;
+ return new SocketAddress(&raw.addr);
}
diff --git a/runtime/bin/socket_macos.cc b/runtime/bin/socket_macos.cc
index be7beca..4b6ead6 100644
--- a/runtime/bin/socket_macos.cc
+++ b/runtime/bin/socket_macos.cc
@@ -137,7 +137,7 @@
}
-bool Socket::GetRemotePeer(intptr_t fd, char *host, intptr_t *port) {
+SocketAddress* Socket::GetRemotePeer(intptr_t fd, intptr_t* port) {
ASSERT(fd >= 0);
RawAddr raw;
socklen_t size = sizeof(raw);
@@ -149,23 +149,10 @@
char error_message[kBufferSize];
strerror_r(errno, error_message, kBufferSize);
Log::PrintErr("Error getpeername: %s\n", error_message);
- return false;
- }
- if (TEMP_FAILURE_RETRY(getnameinfo(&raw.addr,
- size,
- host,
- INET6_ADDRSTRLEN,
- NULL,
- 0,
- NI_NUMERICHOST)) != 0) {
- const int kBufferSize = 1024;
- char error_message[kBufferSize];
- strerror_r(errno, error_message, kBufferSize);
- Log::PrintErr("Error getnameinfo: %s\n", error_message);
- return false;
+ return NULL;
}
*port = SocketAddress::GetAddrPort(&raw);
- return true;
+ return new SocketAddress(&raw.addr);
}
diff --git a/runtime/bin/socket_patch.dart b/runtime/bin/socket_patch.dart
index e57d193..fb93b8b 100644
--- a/runtime/bin/socket_patch.dart
+++ b/runtime/bin/socket_patch.dart
@@ -440,8 +440,10 @@
return nativeGetRemotePeer()[1];
}
- String get remoteHost {
- return nativeGetRemotePeer()[0];
+ InternetAddress get remoteAddress {
+ var result = nativeGetRemotePeer()[0];
+ var type = new InternetAddressType._from(result[0]);
+ return new _InternetAddress(type, result[1], "", result[2]);
}
// Multiplexes socket events to the socket handlers.
@@ -841,7 +843,7 @@
InternetAddress get address => _socket.address;
- String get remoteHost => _socket.remoteHost;
+ InternetAddress get remoteAddress => _socket.remoteAddress;
bool get readEventsEnabled => _readEventsEnabled;
void set readEventsEnabled(bool value) {
@@ -1112,7 +1114,7 @@
}
int get port => _raw.port;
- String get remoteHost => _raw.remoteHost;
+ InternetAddress get remoteAddress => _raw.remoteAddress;
int get remotePort => _raw.remotePort;
Future _detachRaw() {
diff --git a/runtime/bin/socket_win.cc b/runtime/bin/socket_win.cc
index a5d55a9..32b690d 100644
--- a/runtime/bin/socket_win.cc
+++ b/runtime/bin/socket_win.cc
@@ -85,7 +85,7 @@
}
-bool Socket::GetRemotePeer(intptr_t fd, char *host, intptr_t *port) {
+SocketAddress* Socket::GetRemotePeer(intptr_t fd, intptr_t* port) {
ASSERT(reinterpret_cast<Handle*>(fd)->is_socket());
SocketHandle* socket_handle = reinterpret_cast<SocketHandle*>(fd);
RawAddr raw;
@@ -94,23 +94,13 @@
&raw.addr,
&size)) {
Log::PrintErr("Error getpeername: %d\n", WSAGetLastError());
- return false;
+ return NULL;
}
*port = SocketAddress::GetAddrPort(&raw);
// Clear the port before calling WSAAddressToString as WSAAddressToString
// includes the port in the formatted string.
SocketAddress::SetAddrPort(&raw, 0);
- DWORD len = INET6_ADDRSTRLEN;
- int err = WSAAddressToStringA(&raw.addr,
- sizeof(raw),
- NULL,
- host,
- &len);
- if (err != 0) {
- Log::PrintErr("Error WSAAddressToString: %d\n", WSAGetLastError());
- return false;
- }
- return true;
+ return new SocketAddress(&raw.addr);
}
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index 52f7fb0..1877a5c 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -1666,6 +1666,9 @@
}
RemoveEnvironment();
flow_graph->CopyDeoptTarget(this, comp);
+ // Unlink environment from the comparison since it is copied to the
+ // branch instruction.
+ comp->RemoveEnvironment();
comp->RemoveFromGraph();
SetComparison(comp);
diff --git a/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart b/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
index e7d3b79..121193a 100644
--- a/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
+++ b/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
@@ -114,21 +114,33 @@
Node right = assignment.arguments.head;
value =
compileNodeWithDefinitions(right, definitions, isConst: isConst);
- if (compiler.enableTypeAssertions
- && value != null
- && element.isField()) {
+ if (compiler.enableTypeAssertions &&
+ value != null &&
+ element.isField()) {
DartType elementType = element.computeType(compiler);
- DartType constantType = value.computeType(compiler);
- if (!constantSystem.isSubtype(compiler, constantType, elementType)) {
+ if (elementType.kind == TypeKind.MALFORMED_TYPE && !value.isNull()) {
if (isConst) {
+ ErroneousElement element = elementType.element;
compiler.reportFatalError(
- node, MessageKind.NOT_ASSIGNABLE.error,
- {'fromType': constantType, 'toType': elementType});
+ node, element.messageKind, element.messageArguments);
} else {
- // If the field cannot be lazily initialized, we will throw
- // the exception at runtime.
+ // We need to throw an exception at runtime.
value = null;
}
+ } else {
+ DartType constantType = value.computeType(compiler);
+ if (!constantSystem.isSubtype(compiler,
+ constantType, elementType)) {
+ if (isConst) {
+ compiler.reportFatalError(
+ node, MessageKind.NOT_ASSIGNABLE.error,
+ {'fromType': constantType, 'toType': elementType});
+ } else {
+ // If the field cannot be lazily initialized, we will throw
+ // the exception at runtime.
+ value = null;
+ }
+ }
}
}
}
diff --git a/sdk/lib/_internal/compiler/implementation/elements/elements.dart b/sdk/lib/_internal/compiler/implementation/elements/elements.dart
index f994bf4..1d7ecf8 100644
--- a/sdk/lib/_internal/compiler/implementation/elements/elements.dart
+++ b/sdk/lib/_internal/compiler/implementation/elements/elements.dart
@@ -599,6 +599,7 @@
abstract class ErroneousElement extends Element implements FunctionElement {
MessageKind get messageKind;
Map get messageArguments;
+ String get message;
}
/// An [Element] whose usage should cause a warning.
diff --git a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
index 1bb6491..b10064e 100644
--- a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
+++ b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
@@ -345,9 +345,9 @@
computeTargetType(Compiler compiler, InterfaceType newType) => unsupported();
- String toString() {
- return '<$name: ${messageKind.message(messageArguments)}>';
- }
+ String get message => '${messageKind.message(messageArguments)}';
+
+ String toString() => '<$name: $message>';
}
/// A message attached to a [WarnOnUseElementX].
diff --git a/sdk/lib/_internal/compiler/implementation/inferrer/container_tracer.dart b/sdk/lib/_internal/compiler/implementation/inferrer/container_tracer.dart
index a134ac6..5663714 100644
--- a/sdk/lib/_internal/compiler/implementation/inferrer/container_tracer.dart
+++ b/sdk/lib/_internal/compiler/implementation/inferrer/container_tracer.dart
@@ -200,7 +200,13 @@
visitPhiElementTypeInformation(PhiElementTypeInformation info) {}
visitElementInContainerTypeInformation(
ElementInContainerTypeInformation info) {}
- visitContainerTypeInformation(ContainerTypeInformation info) {}
+
+ visitContainerTypeInformation(ContainerTypeInformation info) {
+ if (container != info) {
+ bailout('Stored in a container');
+ }
+ }
+
visitConcreteTypeInformation(ConcreteTypeInformation info) {}
visitClosureCallSiteTypeInformation(ClosureCallSiteTypeInformation info) {
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
index 2fb385f..59274b7 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
@@ -35,6 +35,17 @@
}
}
+class MalformedCheckedModeHelper extends CheckedModeHelper {
+ const MalformedCheckedModeHelper(String name) : super(name);
+
+ void generateAdditionalArguments(SsaCodeGenerator codegen,
+ HTypeConversion node,
+ List<jsAst.Expression> arguments) {
+ ErroneousElement element = node.typeExpression.element;
+ arguments.add(js.string(element.message));
+ }
+}
+
class PropertyCheckedModeHelper extends CheckedModeHelper {
const PropertyCheckedModeHelper(String name) : super(name);
@@ -338,6 +349,7 @@
/// All the checked mode helpers.
static const checkedModeHelpers = const [
+ const MalformedCheckedModeHelper('checkMalformedType'),
const CheckedModeHelper('voidTypeCheck'),
const CheckedModeHelper('stringTypeCast'),
const CheckedModeHelper('stringTypeCheck'),
@@ -988,6 +1000,9 @@
}
}
bool isTypeVariable = type.kind == TypeKind.TYPE_VARIABLE;
+ if (type.kind == TypeKind.MALFORMED_TYPE) {
+ enqueueInResolution(getThrowTypeError(), elements);
+ }
if (!type.treatAsRaw || type.containsTypeVariables) {
enqueueInResolution(getSetRuntimeTypeInfo(), elements);
enqueueInResolution(getGetRuntimeTypeInfo(), elements);
@@ -1323,6 +1338,11 @@
{bool typeCast,
bool nativeCheckOnly}) {
assert(type.kind != TypeKind.TYPEDEF);
+ if (type.kind == TypeKind.MALFORMED_TYPE) {
+ // The same error is thrown for type test and type cast of a malformed
+ // type so we only need one check method.
+ return 'checkMalformedType';
+ }
Element element = type.element;
bool nativeCheck = nativeCheckOnly ||
emitter.nativeEmitter.requiresNativeIsCheck(element);
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
index 9fc4daf..6bd3a04 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
@@ -2912,13 +2912,16 @@
} else if ("as" == op.source) {
visit(node.receiver);
HInstruction expression = pop();
- Node argument = node.arguments.head;
- TypeAnnotation typeAnnotation = argument.asTypeAnnotation();
- DartType type = elements.getType(typeAnnotation);
- HInstruction converted = buildTypeConversion(
- expression, type, HTypeConversion.CAST_TYPE_CHECK);
- if (converted != expression) add(converted);
- stack.add(converted);
+ DartType type = elements.getType(node.typeAnnotationFromIsCheckOrCast);
+ if (type.kind == TypeKind.MALFORMED_TYPE) {
+ ErroneousElement element = type.element;
+ generateTypeError(node, element.message);
+ } else {
+ HInstruction converted = buildTypeConversion(
+ expression, type, HTypeConversion.CAST_TYPE_CHECK);
+ if (converted != expression) add(converted);
+ stack.add(converted);
+ }
} else {
visit(node.receiver);
visit(node.argumentsNode);
@@ -3023,6 +3026,11 @@
pushInvokeStatic(node, helper, inputs, backend.boolType);
HInstruction call = pop();
return new HIs.compound(type, expression, call, backend.boolType);
+ } else if (type.kind == TypeKind.MALFORMED_TYPE) {
+ ErroneousElement element = type.element;
+ generateTypeError(node, element.message);
+ HInstruction call = pop();
+ return new HIs.compound(type, expression, call, backend.boolType);
} else {
if (backend.hasDirectCheckFor(type)) {
return new HIs.direct(type, expression, backend.boolType);
@@ -4171,7 +4179,10 @@
// TODO(5346): Try to avoid the need for calling [declaration] before
// creating an [HStatic].
List<HInstruction> inputs = <HInstruction>[];
- if (backend.isInterceptedSelector(selector)) {
+ if (backend.isInterceptedSelector(selector) &&
+ // Fields don't need an interceptor; consider generating HFieldGet/Set
+ // instead.
+ element.kind != ElementKind.FIELD) {
inputs.add(invokeInterceptor(receiver));
}
inputs.add(receiver);
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
index ffd4236..d77bd2b 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
@@ -1617,9 +1617,11 @@
world.registerStaticUse(superMethod);
ClassElement superClass = superMethod.getEnclosingClass();
if (superMethod.kind == ElementKind.FIELD) {
- String fieldName = node.caller.isShadowedByField(superMethod)
- ? backend.namer.shadowedFieldName(superMethod)
- : backend.namer.instanceFieldName(superMethod);
+ String fieldName = superMethod.hasFixedBackendName()
+ ? superMethod.fixedBackendName()
+ : node.caller.isShadowedByField(superMethod)
+ ? backend.namer.shadowedFieldName(superMethod)
+ : backend.namer.instanceFieldName(superMethod);
use(node.inputs[0]);
js.PropertyAccess access =
new js.PropertyAccess.field(pop(), fieldName);
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart b/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
index cdc75a2..426d329 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
@@ -1204,7 +1204,7 @@
// available.
assert(type.kind != TypeKind.TYPE_VARIABLE);
assert(type.treatAsRaw || type.kind == TypeKind.FUNCTION);
- if (type.treatAsDynamic) return this;
+ if (type.isDynamic) return this;
// The type element is either a class or the void element.
Element element = type.element;
if (identical(element, compiler.objectClass)) return this;
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart b/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
index c9878c9..1a16f4c 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
@@ -594,6 +594,11 @@
HInstruction value = node.inputs[0];
DartType type = node.typeExpression;
if (type != null) {
+ if (type.kind == TypeKind.MALFORMED_TYPE) {
+ // Malformed types are treated as dynamic statically, but should
+ // throw a type error at runtime.
+ return node;
+ }
if (!type.treatAsRaw || type.kind == TypeKind.TYPE_VARIABLE) {
return node;
}
diff --git a/sdk/lib/_internal/lib/js_helper.dart b/sdk/lib/_internal/lib/js_helper.dart
index b9da42c..b4d4b4a 100644
--- a/sdk/lib/_internal/lib/js_helper.dart
+++ b/sdk/lib/_internal/lib/js_helper.dart
@@ -1921,6 +1921,11 @@
throw new TypeErrorImplementation(value, 'void');
}
+checkMalformedType(value, message) {
+ if (value == null) return value;
+ throw new TypeErrorImplementation.fromMessage(message);
+}
+
/**
* Special interface recognized by the compiler and implemented by DOM
* objects that support integer indexing. This interface is not
diff --git a/sdk/lib/io/http.dart b/sdk/lib/io/http.dart
index 2d31161..aa000ff 100644
--- a/sdk/lib/io/http.dart
+++ b/sdk/lib/io/http.dart
@@ -1537,7 +1537,7 @@
* [HttpClientResponse] connection.
*/
abstract class HttpConnectionInfo {
- String get remoteHost;
+ InternetAddress get remoteAddress;
int get remotePort;
int get localPort;
}
diff --git a/sdk/lib/io/http_impl.dart b/sdk/lib/io/http_impl.dart
index 2fd3659..07ef4fe 100644
--- a/sdk/lib/io/http_impl.dart
+++ b/sdk/lib/io/http_impl.dart
@@ -2201,7 +2201,7 @@
if (socket == null) return null;
try {
_HttpConnectionInfo info = new _HttpConnectionInfo();
- info.remoteHost = socket.remoteHost;
+ info.remoteAddress = socket.remoteAddress;
info.remotePort = socket.remotePort;
info.localPort = socket.port;
return info;
@@ -2209,7 +2209,7 @@
return null;
}
- String remoteHost;
+ InternetAddress remoteAddress;
int remotePort;
int localPort;
}
@@ -2268,7 +2268,7 @@
InternetAddress get address => _socket.address;
- String get remoteHost => _socket.remoteHost;
+ InternetAddress get remoteAddress => _socket.remoteAddress;
int get remotePort => _socket.remotePort;
diff --git a/sdk/lib/io/secure_socket.dart b/sdk/lib/io/secure_socket.dart
index 8ad69d3..7d8c685 100644
--- a/sdk/lib/io/secure_socket.dart
+++ b/sdk/lib/io/secure_socket.dart
@@ -603,7 +603,7 @@
int get port => _socket.port;
- String get remoteHost => _socket.remoteHost;
+ InternetAddress get remoteAddress => _socket.remoteAddress;
int get remotePort => _socket.remotePort;
diff --git a/sdk/lib/io/socket.dart b/sdk/lib/io/socket.dart
index ce8ace5..f821d8b 100644
--- a/sdk/lib/io/socket.dart
+++ b/sdk/lib/io/socket.dart
@@ -381,9 +381,9 @@
InternetAddress get address;
/**
- * Returns the remote host connected to by this socket.
+ * Returns the remote [InternetAddress] connected to by this socket.
*/
- String get remoteHost;
+ InternetAddress get remoteAddress;
/**
* Closes the socket. Returns a Future that completes with [this] when the
@@ -427,9 +427,9 @@
}
/**
- * A high-level class for communicating over a TCP socket.
+ * A high-level class for communicating over a TCP socket.
*
- * The [Socket] exposes both a [Stream] and a [IOSink] interface, making it
+ * The [Socket] exposes both a [Stream] and a [IOSink] interface, making it
* ideal for using together with other [Stream]s.
*/
abstract class Socket implements Stream<List<int>>, IOSink {
@@ -478,9 +478,9 @@
InternetAddress get address;
/**
- * Returns the remote host connected to by this socket.
+ * Returns the remote [InternetAddress] connected to by this socket.
*/
- String get remoteHost;
+ InternetAddress get remoteAddress;
}
diff --git a/tests/co19/co19-co19.status b/tests/co19/co19-co19.status
index 91fe674..f6dd40e 100644
--- a/tests/co19/co19-co19.status
+++ b/tests/co19/co19-co19.status
@@ -271,6 +271,24 @@
Language/14_Libraries_and_Scripts/4_Scripts_A03_t03: MissingRuntimeError, OK # co19 issue 638
+[ $compiler == dart2js ]
+Language/10_Generics/10_Generics_A05_t01: Fail # Co19 issue 655
+Language/12_Expressions/32_Type_Test_A04_t01: Fail # Co19 issue 655
+Language/12_Expressions/32_Type_Test_A04_t02: Fail # Co19 issue 655
+Language/12_Expressions/33_Type_Cast_A03_t01: Fail # Co19 issue 655
+Language/12_Expressions/33_Type_Cast_A03_t03: Fail # Co19 issue 655
+Language/14_Libraries_and_Scripts/1_Imports_A03_t05: Fail # Co19 issue 655
+
+[ $compiler == dart2js && $unchecked ]
+Language/15_Types/1_Static_Types_A03_t01: Fail # Co19 issue 655
+
+[ $compiler == dart2js && $checked ]
+Language/10_Generics/10_Generics_A05_t02: Fail # Co19 issue 655
+Language/14_Libraries_and_Scripts/1_Imports_A03_t31: Fail # Co19 issue 655
+Language/15_Types/1_Static_Types_A03_t02: Fail # Co19 issue 655
+Language/15_Types/1_Static_Types_A03_t03: Fail # Co19 issue 655
+Language/15_Types/1_Static_Types_A03_t04: Fail # Co19 issue 655
+
### CHECKED MODE FAILURES ###
[ ($runtime == vm || $runtime == dartium || $compiler == dart2js) && $checked]
diff --git a/tests/co19/co19-dart2js.status b/tests/co19/co19-dart2js.status
index d7b2a5e..f9355da 100644
--- a/tests/co19/co19-dart2js.status
+++ b/tests/co19/co19-dart2js.status
@@ -282,8 +282,6 @@
[ $compiler == dart2js ]
Language/07_Classes/6_Constructors/1_Generative_Constructors_A13_t01: RuntimeError # compiler cancelled: cannot resolve type T
-Language/03_Overview/2_Privacy_A01_t06: RuntimeError # cannot resolve type _inaccessibleFuncType
-
[ $compiler == dart2js && $jscl ]
LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterEscape_A06_t02: RuntimeError # IllegalJSRegExpException: '\c(' 'SyntaxError: Invalid regular expression: /\c(/: Unterminated group'
LibTest/core/RegExp/Pattern_semantics/firstMatch_DecimalEscape_A01_t02: RuntimeError # Expect.fail('Some exception expected')
diff --git a/tests/co19/co19-dartium.status b/tests/co19/co19-dartium.status
index d816a73..72af666 100644
--- a/tests/co19/co19-dartium.status
+++ b/tests/co19/co19-dartium.status
@@ -6,7 +6,6 @@
*: Skip # running co19 tests on content_shell would make our dartium cycle-times very long
[ $compiler == none && $runtime == dartium ]
-Language/13_Statements/04_Local_Function_Declaration_A04_t01: Fail, MissingCompileTimeError # co19-roll r607: Please triage this failure
Language/07_Classes/6_Constructors/1_Generative_Constructors_A09_t01: Pass, Fail # Issue 13719: Please triage this failure.
Language/12_Expressions/12_Spawning_an_Isolate_A01_t01: Fail # Issue 13921
Language/14_Libraries_and_Scripts/3_Parts_A02_t02: Pass, Timeout # Issue 13719: Please triage this failure.
diff --git a/tests/compiler/dart2js_native/dart2js_native.status b/tests/compiler/dart2js_native/dart2js_native.status
index 439af70..c8e3e7f 100644
--- a/tests/compiler/dart2js_native/dart2js_native.status
+++ b/tests/compiler/dart2js_native/dart2js_native.status
@@ -10,7 +10,6 @@
native_no_such_method_exception5_frog_test: Fail # Issue 9631
subclassing_super_field_1_test: Fail # Issue 14096
subclassing_super_field_2_test: Fail # Issue 14096
-subclassing_super_call_test: Fail # Issue 14739
[ $compiler == dart2js && $unminified ]
fake_thing_test: Fail # Issue 13010
diff --git a/tests/compiler/dart2js_native/subclassing_super_call_test.dart b/tests/compiler/dart2js_native/subclassing_super_call_test.dart
index ed1157e..f13a42e 100644
--- a/tests/compiler/dart2js_native/subclassing_super_call_test.dart
+++ b/tests/compiler/dart2js_native/subclassing_super_call_test.dart
@@ -15,13 +15,13 @@
class N2 extends N1 native "N2" {
N2.init();
- var text;
+ String text;
foo() native;
}
class AA extends N2 {
AA.init() : super.init();
- var afield;
+ String afield;
afun() => 'afun:$afield';
}
@@ -63,8 +63,8 @@
JS('', '#(#)', constructor, b1);
JS('', '#(#)', constructor, b2);
- b1.text = 'one';
- b2.text = 'two';
+ b1.text = inscrutable('one');
+ b2.text = inscrutable('two');
print('b1.text ${inscrutable(b1).text}');
print('b2.text ${inscrutable(b2).text}');
@@ -73,16 +73,16 @@
print('b2.foo() ${inscrutable(b2).foo()}');
Expect.equals('one', b1.text);
- Expect.equals('two', b1.text);
+ Expect.equals('two', b2.text);
Expect.equals('foo:one', b1.foo());
Expect.equals('foo:two', b2.foo());
- inscrutable(b1).text = 'three';
- inscrutable(b2).text = 'four';
+ inscrutable(b1).text = inscrutable('three');
+ inscrutable(b2).text = inscrutable('four');
Expect.equals('three', inscrutable(b1).text);
- Expect.equals('four', inscrutable(b1).text);
+ Expect.equals('four', inscrutable(b2).text);
Expect.equals('foo:three', inscrutable(b1).foo());
Expect.equals('foo:four', inscrutable(b2).foo());
@@ -97,8 +97,8 @@
JS('', '#(#)', constructor, b1);
JS('', '#(#)', constructor, b2);
- b1.afield = 'one';
- b2.afield = 'two';
+ b1.afield = inscrutable('one');
+ b2.afield = inscrutable('two');
print('b1.afield ${inscrutable(b1).afield}');
print('b2.afield ${inscrutable(b2).afield}');
@@ -107,17 +107,17 @@
print('b2.afun() ${inscrutable(b2).afun()}');
Expect.equals('one', b1.afield);
- Expect.equals('two', b1.afield);
+ Expect.equals('two', b2.afield);
Expect.equals('afun:one', b1.afun());
Expect.equals('afun:two', b2.afun());
- inscrutable(b1).afield = 'three';
- inscrutable(b2).afield = 'four';
+ inscrutable(b1).afield = inscrutable('three');
+ inscrutable(b2).afield = inscrutable('four');
Expect.equals('three', inscrutable(b1).afield);
- Expect.equals('four', inscrutable(b1).afield);
+ Expect.equals('four', inscrutable(b2).afield);
Expect.equals('afun:three', inscrutable(b1).afun());
Expect.equals('afun:four', inscrutable(b2).afun());
diff --git a/tests/html/html.status b/tests/html/html.status
index 946e119..aca5635 100644
--- a/tests/html/html.status
+++ b/tests/html/html.status
@@ -417,7 +417,6 @@
element_test: StaticWarning
events_test: StaticWarning
htmlelement_test: StaticWarning
-isolates_test: StaticWarning
localstorage_test: StaticWarning
mutationobserver_test: StaticWarning
track_element_constructor_test: StaticWarning
diff --git a/tests/html/isolates_test.dart b/tests/html/isolates_test.dart
index fe35c20..f0da5f0 100644
--- a/tests/html/isolates_test.dart
+++ b/tests/html/isolates_test.dart
@@ -1,6 +1,7 @@
library IsolatesTest;
import '../../pkg/unittest/lib/unittest.dart';
import '../../pkg/unittest/lib/html_config.dart';
+import 'dart:async';
import 'dart:html';
import 'dart:convert';
import 'dart:isolate' as isolate;
diff --git a/tests/language/div_with_power_of_two2_test.dart b/tests/language/div_with_power_of_two2_test.dart
index 936aadf..03a83ca 100644
--- a/tests/language/div_with_power_of_two2_test.dart
+++ b/tests/language/div_with_power_of_two2_test.dart
@@ -100,6 +100,6 @@
}
Expect.throws(() => divBy0(4),
(e) => e is IntegerDivisionByZeroException
- || e is RuntimeError);
+ || e is UnsupportedError);
}
}
diff --git a/tests/language/dynamic_prefix_core_test.dart b/tests/language/dynamic_prefix_core_test.dart
index 1aba87f..4a5362a 100644
--- a/tests/language/dynamic_prefix_core_test.dart
+++ b/tests/language/dynamic_prefix_core_test.dart
@@ -9,9 +9,9 @@
void main() {
// Should still be available because it is not a member of dart:core.
- Expect.isTrue(dynamic is Type);
-
- Expect.throws(() => mycore.dynamic is Type,
- (e) => e is NoSuchMethodError,
+ Expect.isTrue(dynamic is mycore.Type);
+
+ Expect.throws(() => mycore.dynamic is mycore.Type,
+ (e) => e is mycore.NoSuchMethodError,
'dynamic is not a member of dart:core');
}
diff --git a/tests/language/instanceof3_test.dart b/tests/language/instanceof3_test.dart
index 746c8bf..ccc00e4 100644
--- a/tests/language/instanceof3_test.dart
+++ b/tests/language/instanceof3_test.dart
@@ -6,7 +6,8 @@
import "package:expect/expect.dart";
// In the type test 'e is T', if T does not denote a type available in the
-// current lexical scope, then T is mapped to dynamic and the test succeeds.
+// current lexical scope, then T is mapped to dynamic. Direct tests against
+// T cause a dynamic type error though.
isCheckedMode() {
try {
@@ -27,8 +28,8 @@
} on TypeError catch (error) {
got_type_error = true;
}
- // No type error.
- Expect.isFalse(got_type_error);
+ // Type error.
+ Expect.isTrue(got_type_error);
}
{
bool got_type_error = false;
@@ -38,8 +39,8 @@
} on TypeError catch (error) {
got_type_error = true;
}
- // No type error.
- Expect.isFalse(got_type_error);
+ // Type error.
+ Expect.isTrue(got_type_error);
}
{
bool got_type_error = false;
diff --git a/tests/language/is_not_class2_test.dart b/tests/language/is_not_class2_test.dart
index 710c72d..4766fb2 100644
--- a/tests/language/is_not_class2_test.dart
+++ b/tests/language/is_not_class2_test.dart
@@ -2,9 +2,10 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// Dart test program for catch that we expect a class after an 'is'. This is
-// not a negative test since 'aa' is a malformed type and therefore should be
-// treated as dynamic.
+// Dart test program for catch that we expect a class after an 'is'. 'aa' is a
+// malformed type and a type error should be thrown upon test.
+
+import 'package:expect/expect.dart';
class A {
const A();
@@ -23,5 +24,5 @@
}
main() {
- IsNotClass2NegativeTest.testMain();
+ Expect.throws(IsNotClass2NegativeTest.testMain, (e) => e is TypeError);
}
diff --git a/tests/language/isnot_malformed_type_test.dart b/tests/language/isnot_malformed_type_test.dart
index 11abe66..867e9f7 100644
--- a/tests/language/isnot_malformed_type_test.dart
+++ b/tests/language/isnot_malformed_type_test.dart
@@ -5,10 +5,10 @@
import 'package:expect/expect.dart';
f(obj) {
- // 'Baz' is not loaded, mapped to dynamic.
+ // 'Baz' is not loaded, throws a type error on test.
return (obj is !Baz);
}
main () {
- Expect.isFalse(f(null));
+ Expect.throws(() => f(null), (e) => e is TypeError);
}
diff --git a/tests/language/language.status b/tests/language/language.status
index fe6ff4e..7c6ac29 100644
--- a/tests/language/language.status
+++ b/tests/language/language.status
@@ -10,6 +10,12 @@
mixin_super_constructor_positionals_test: Fail # Issue 12631
built_in_identifier_prefix_test: Fail # Issue 6970
f_bounded_equality_test: RuntimeError # Issue 14000
+instanceof3_test: Fail # Issue 14768
+is_not_class2_test: Fail # Issue 14768
+isnot_malformed_type_test: Fail # Issue 14768
+library_ambiguous_test/04: Fail # Issue 14768
+malformed2_test/00: Fail # Issue 14768
+on_catch_malformed_type_test: Fail # Issue 14768
# These bugs refer currently ongoing language discussions.
constructor_initializer_test/none: Fail # Issue 12633
@@ -27,6 +33,13 @@
[ $compiler == none && $checked ]
type_variable_bounds4_test/01: Fail # Issue 14006
+type_parameter_test/01: Fail # Issue 14768
+type_parameter_test/02: Fail # Issue 14768
+type_parameter_test/03: Fail # Issue 14768
+type_parameter_test/04: Fail # Issue 14768
+type_parameter_test/05: Fail # Issue 14768
+type_parameter_test/06: Fail # Issue 14768
+
[ $compiler == none && $unchecked ]
# Only checked mode reports an error on type assignment
# problems in compile time constants.
@@ -43,6 +56,7 @@
compile_time_constant_checked3_test/04: Fail, OK
compile_time_constant_checked3_test/05: Fail, OK
compile_time_constant_checked3_test/06: Fail, OK
+malformed2_test/01: Fail, OK
[ $runtime == vm || (($runtime == drt || $runtime == dartium) && $compiler == none) ]
call_test: Fail # Issue 12602
diff --git a/tests/language/language_analyzer.status b/tests/language/language_analyzer.status
index 2b8d307d..50eb8a4 100644
--- a/tests/language/language_analyzer.status
+++ b/tests/language/language_analyzer.status
@@ -206,7 +206,6 @@
crash_6725_test: StaticWarning
default_factory_library_test: StaticWarning
default_factory_test: StaticWarning
-div_with_power_of_two2_test: StaticWarning
double_to_string_as_exponential2_test: StaticWarning
double_to_string_as_fixed2_test: StaticWarning
double_to_string_as_precision2_test: StaticWarning
@@ -301,6 +300,7 @@
malbounded_type_cast_test: StaticWarning
malbounded_type_literal_test: StaticWarning
malformed_type_test: StaticWarning
+malformed2_test/01: MissingCompileTimeError
map_literal11_test: StaticWarning
map_literal2_negative_test: CompileTimeError
map_literal3_test: StaticWarning
diff --git a/tests/language/language_analyzer2.status b/tests/language/language_analyzer2.status
index 5723b00..9f967f0 100644
--- a/tests/language/language_analyzer2.status
+++ b/tests/language/language_analyzer2.status
@@ -206,7 +206,6 @@
crash_6725_test: StaticWarning
default_factory_library_test: StaticWarning
default_factory_test: StaticWarning
-div_with_power_of_two2_test: StaticWarning
double_to_string_as_exponential2_test: StaticWarning
double_to_string_as_fixed2_test: StaticWarning
double_to_string_as_precision2_test: StaticWarning
@@ -301,6 +300,7 @@
malbounded_type_cast_test: StaticWarning
malbounded_type_literal_test: StaticWarning
malformed_type_test: StaticWarning
+malformed2_test/01: MissingCompileTimeError
map_literal11_test: StaticWarning
map_literal2_negative_test: CompileTimeError
map_literal3_test: StaticWarning
diff --git a/tests/language/language_dart2js.status b/tests/language/language_dart2js.status
index a77739b..a96f2e3 100644
--- a/tests/language/language_dart2js.status
+++ b/tests/language/language_dart2js.status
@@ -70,6 +70,7 @@
compile_time_constant_checked3_test/04: MissingCompileTimeError, OK
compile_time_constant_checked3_test/05: MissingCompileTimeError, OK
compile_time_constant_checked3_test/06: MissingCompileTimeError, OK
+malformed2_test/01: MissingCompileTimeError, OK
generic_test: RuntimeError, OK
named_parameters_type_test/01: MissingRuntimeError, OK
named_parameters_type_test/02: MissingRuntimeError, OK
@@ -194,6 +195,13 @@
factory3_test: Fail # Issue 13077
type_checks_in_factory_method_test: Fail # Issue 12747
+instanceof3_test: Fail # Issue 14768
+is_not_class2_test: Fail # Issue 14768
+isnot_malformed_type_test: Fail # Issue 14768
+library_ambiguous_test/04: Fail # Issue 14768
+malformed2_test/00: Fail # Issue 14768
+on_catch_malformed_type_test: Fail # Issue 14768
+
# Mixins fail on the VM.
mixin_forwarding_constructor2_test: Fail # Issue 13641
@@ -275,6 +283,7 @@
compile_time_constant_checked3_test/04: Fail, OK
compile_time_constant_checked3_test/05: Fail, OK
compile_time_constant_checked3_test/06: Fail, OK
+malformed2_test/01: Fail, OK
[ $compiler == dart2dart && $checked ]
# Dart VM problems
@@ -282,6 +291,13 @@
malbounded_type_test_test/01: Fail # Issue 14131
malbounded_instantiation_test/01: Fail # Issue 14132
+type_parameter_test/01: Fail # Issue 14768
+type_parameter_test/02: Fail # Issue 14768
+type_parameter_test/03: Fail # Issue 14768
+type_parameter_test/04: Fail # Issue 14768
+type_parameter_test/05: Fail # Issue 14768
+type_parameter_test/06: Fail # Issue 14768
+
[ $compiler == dart2dart && $minified ]
super_getter_setter_test: Fail # Issue 11065.
f_bounded_quantification4_test: Fail # Issue 12605.
diff --git a/tests/language/library_ambiguous_test.dart b/tests/language/library_ambiguous_test.dart
index 1584b24..011f041 100644
--- a/tests/language/library_ambiguous_test.dart
+++ b/tests/language/library_ambiguous_test.dart
@@ -17,7 +17,7 @@
print(bar()); /// 01: runtime error
print(baz()); /// 02: runtime error
print(bay()); /// 03: runtime error
- print(main is bax); /// 04: static type warning
+ print(main is bax); /// 04: static type warning, runtime error
var x = new X(); /// 05: continued
print("No error expected if ambiguous definitions are not used.");
}
diff --git a/tests/language/list_tracer_in_list_test.dart b/tests/language/list_tracer_in_list_test.dart
new file mode 100644
index 0000000..643f8ad
--- /dev/null
+++ b/tests/language/list_tracer_in_list_test.dart
@@ -0,0 +1,11 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+main() {
+ var a = [[]];
+ a[0].add(42);
+ if (a[0].length != 1) {
+ throw 'Test failed';
+ }
+}
diff --git a/tests/language/malformed2_lib.dart b/tests/language/malformed2_lib.dart
new file mode 100644
index 0000000..50155a3
--- /dev/null
+++ b/tests/language/malformed2_lib.dart
@@ -0,0 +1,57 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+part of malformed_test;
+
+/// [o] is either `null` or `new List<String>()`.
+void testValue(var o) {
+ assert(o == null || o is List<String>);
+
+ test(true, () => o is Unresolved, "$o is Unresolved");
+ test(false, () => o is List<Unresolved>, "$o is List<Unresolved>");
+ test(true, () => o is! Unresolved, "$o is! Unresolved");
+ test(false, () => o is! List<Unresolved>, "$o is List<Unresolved>");
+
+ test(true, () => o as Unresolved, "$o as Unresolved");
+ test(false, () => o as List<Unresolved>, "$o as List<Unresolved>");
+
+ test(false, () {
+ try {
+ } on Unresolved catch (e) {
+ } catch (e) {
+ }
+ }, "on Unresolved catch: Nothing thrown.");
+ test(true, () {
+ try {
+ throw o;
+ } on Unresolved catch (e) {
+ } catch (e) {
+ }
+ }, "on Unresolved catch ($o)");
+ test(false, () {
+ try {
+ throw o;
+ } on List<String> catch (e) {
+ } on NullThrownError catch (e) {
+ } on Unresolved catch (e) {
+ } catch (e) {
+ }
+ }, "on List<String>/NullThrowError catch ($o)");
+ test(false, () {
+ try {
+ throw o;
+ } on List<Unresolved> catch (e) {
+ } on NullThrownError catch (e) {
+ } on Unresolved catch (e) {
+ } catch (e) {
+ }
+ }, "on List<Unresolved>/NullThrowError catch ($o)");
+
+ test(o != null && inCheckedMode(),
+ () { Unresolved u = o; },
+ "Unresolved u = $o;");
+ test(false,
+ () { List<Unresolved> u = o; },
+ "List<Unresolved> u = $o;");
+}
\ No newline at end of file
diff --git a/tests/language/malformed2_test.dart b/tests/language/malformed2_test.dart
new file mode 100644
index 0000000..cab3aba
--- /dev/null
+++ b/tests/language/malformed2_test.dart
@@ -0,0 +1,59 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library malformed_test;
+
+// This part includes the actual tests.
+part 'malformed2_lib.dart'; /// 00: static type warning
+
+bool inCheckedMode() {
+ try {
+ var i = 42;
+ String s = i;
+ } on TypeError catch (e) {
+ return true;
+ }
+ return false;
+}
+
+bool hasFailed = false;
+
+void fail(String message) {
+ try {
+ throw message;
+ } catch (e, s) {
+ print(e);
+ print(s);
+ }
+ hasFailed = true;
+}
+
+void checkFailures() {
+ if (hasFailed) throw 'Test failed.';
+}
+
+test(bool expectTypeError, f(), [String message]) {
+ message = message != null ? ' for $message' : '';
+ try {
+ f();
+ if (expectTypeError) {
+ fail('Missing type error$message.');
+ }
+ } on TypeError catch (e) {
+ if (expectTypeError) {
+ print('Type error$message: $e');
+ } else {
+ fail('Unexpected type error$message: $e');
+ }
+ }
+}
+
+const Unresolved c1 = 0; /// 01: static type warning, compile-time error
+
+void main() {
+ print(c1); /// 01: continued
+ testValue(new List<String>()); /// 00: continued
+ testValue(null); /// 00: continued
+ checkFailures();
+}
diff --git a/tests/language/on_catch_malformed_type_test.dart b/tests/language/on_catch_malformed_type_test.dart
index a7e18ef..e4c1f86 100644
--- a/tests/language/on_catch_malformed_type_test.dart
+++ b/tests/language/on_catch_malformed_type_test.dart
@@ -3,8 +3,9 @@
// BSD-style license that can be found in the LICENSE file.
// Check that malformed types in on-catch are handled correctly, that is,
-// are treated as dynamic and thus catches all in bith production and checked
-// mode.
+// throws a type error in both production and checked mode.
+
+import 'package:expect/expect.dart';
catchUnresolvedBefore() {
try {
@@ -18,15 +19,17 @@
}
catchUnresolvedAfter() {
- try {
- throw "foo";
- Expect.fail("This code shouldn't be executed");
- } on Unavailable catch(ex) {
- // This is tested before the catch block below.
- // In both production and checked mode the test is always true.
- } on String catch(oks) {
- Expect.fail("This code shouldn't be executed");
- }
+ Expect.throws(() {
+ try {
+ throw "foo";
+ Expect.fail("This code shouldn't be executed");
+ } on Unavailable catch(ex) {
+ // This is tested before the catch block below.
+ // In both production and checked mode the test causes a type error.
+ } on String catch(oks) {
+ Expect.fail("This code shouldn't be executed");
+ }
+ }, (e) => e is TypeError);
}
main() {
diff --git a/tests/language/type_parameter_test.dart b/tests/language/type_parameter_test.dart
index 7a39eeb..9493e22 100644
--- a/tests/language/type_parameter_test.dart
+++ b/tests/language/type_parameter_test.dart
@@ -17,28 +17,28 @@
}
static
- T /// 01: static type warning
+ T /// 01: static type warning, dynamic type error
staticMethod(
- T /// 02: static type warning
+ T /// 02: static type warning, dynamic type error
a) {
final
- T /// 03: static type warning
+ T /// 03: static type warning, dynamic type error
a = "not_null";
print(a);
return a;
}
static final
- T /// 04: static type warning
+ T /// 04: static type warning, dynamic type error
staticFinalField = "not_null";
static const
- T /// 05: static type warning
+ T /// 05: static type warning, dynamic type error
staticConstField = "not_null";
static not_null() => "not_null";
static final
- T /// 06: static type warning
+ T /// 06: static type warning, dynamic type error
staticFinalField2 = not_null();
// Assigning null to a malformed type is not a dynamic error.
diff --git a/tests/standalone/io/http_connection_info_test.dart b/tests/standalone/io/http_connection_info_test.dart
index 0d4caa4..e503803 100644
--- a/tests/standalone/io/http_connection_info_test.dart
+++ b/tests/standalone/io/http_connection_info_test.dart
@@ -11,8 +11,8 @@
server.listen((request) {
var response = request.response;
- Expect.isTrue(request.connectionInfo.remoteHost is String);
- Expect.isTrue(response.connectionInfo.remoteHost is String);
+ Expect.isTrue(request.connectionInfo.remoteAddress is InternetAddress);
+ Expect.isTrue(response.connectionInfo.remoteAddress is InternetAddress);
Expect.equals(request.connectionInfo.localPort, server.port);
Expect.equals(response.connectionInfo.localPort, server.port);
Expect.isNotNull(clientPort);
@@ -26,7 +26,8 @@
HttpClient client = new HttpClient();
client.get("127.0.0.1", server.port, "/")
.then((request) {
- Expect.isTrue(request.connectionInfo.remoteHost is String);
+ Expect.isTrue(
+ request.connectionInfo.remoteAddress is InternetAddress);
Expect.equals(request.connectionInfo.remotePort, server.port);
clientPort = request.connectionInfo.localPort;
return request.close();
diff --git a/tests/standalone/io/socket_info_test.dart b/tests/standalone/io/socket_info_test.dart
index 395b6e4..7a5a20f 100644
--- a/tests/standalone/io/socket_info_test.dart
+++ b/tests/standalone/io/socket_info_test.dart
@@ -13,8 +13,8 @@
Expect.equals(socket.port, server.port);
Expect.equals(clientSocket.port, socket.remotePort);
Expect.equals(clientSocket.remotePort, socket.port);
- Expect.equals(socket.remoteHost, "127.0.0.1");
- Expect.equals(clientSocket.remoteHost, "127.0.0.1");
+ Expect.equals(socket.remoteAddress.address, "127.0.0.1");
+ Expect.equals(clientSocket.remoteAddress.address, "127.0.0.1");
server.close();
});
diff --git a/tools/VERSION b/tools/VERSION
index 48bb6d6..cfe7916 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -1,4 +1,4 @@
MAJOR 0
MINOR 8
BUILD 10
-PATCH 4
+PATCH 5
diff --git a/tools/dartium/download_file.dart b/tools/dartium/download_file.dart
new file mode 100644
index 0000000..6339ae8
--- /dev/null
+++ b/tools/dartium/download_file.dart
@@ -0,0 +1,48 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:async';
+import 'dart:io';
+
+Future downloadFile(Uri url, String destination) {
+ var client = new HttpClient();
+ return client.getUrl(url)
+ .then((HttpClientRequest request) => request.close())
+ .then((HttpClientResponse response) {
+ if (response.statusCode != HttpStatus.OK) {
+ throw new Exception("Http status code (${response.statusCode}) "
+ "was not 200. Aborting.");
+ }
+ var sink = new File(destination).openWrite();
+ return response.pipe(sink).then((_) {
+ client.close();
+ });
+ });
+}
+
+void main(List<String> arguments) {
+ die(String message) {
+ print(message);
+ exit(1);
+ }
+
+ if (arguments.length != 2) {
+ var scriptName = Platform.script.pathSegments.last;
+ die("Usage dart $scriptName <url> <destination-file>");
+ }
+
+ var url = Uri.parse(arguments[0]);
+ var destination = arguments[1];
+
+ if (!['http', 'https'].contains(url.scheme)) {
+ die("Unsupported scheme in uri $url");
+ }
+
+ print("Downloading $url to $destination.");
+ downloadFile(url, destination).then((_) {
+ print("Download finished.");
+ }).catchError((error) {
+ die("An unexpected error occured: $error.");
+ });
+}
diff --git a/tools/dartium/download_shellscript_template.bat b/tools/dartium/download_shellscript_template.bat
new file mode 100644
index 0000000..d41951d
--- /dev/null
+++ b/tools/dartium/download_shellscript_template.bat
@@ -0,0 +1,16 @@
+@REM Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+@REM for details. All rights reserved. Use of this source code is governed by a
+@REM BSD-style license that can be found in the LICENSE file.
+
+@REM This script will download VAR_DOWNLOAD_URL to VAR_DESTINATION in the
+@REM current working directory.
+
+@echo off
+
+set "CHROMIUM_DIR=%~dp0"
+set "SDK_BIN=%CHROMIUM_DIR%\..\dart-sdk\bin"
+
+set "DART=%SDK_BIN%\dart.exe"
+set "DOWNLOAD_SCRIPT=%CHROMIUM_DIR%\download_file.dart"
+
+"%DART%" "%DOWNLOAD_SCRIPT%" "VAR_DOWNLOAD_URL" "VAR_DESTINATION"
diff --git a/tools/dartium/download_shellscript_template.sh b/tools/dartium/download_shellscript_template.sh
new file mode 100644
index 0000000..3399945
--- /dev/null
+++ b/tools/dartium/download_shellscript_template.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+# Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+# This script will download VAR_DOWNLOAD_URL to VAR_DESTINATION in the current
+# working directory.
+
+CHROMIUM_DIR="$(dirname $BASH_SOURCE)"
+SDK_BIN="$CHROMIUM_DIR/../dart-sdk/bin"
+
+DART="$SDK_BIN/dart"
+DOWNLOAD_SCRIPT="$CHROMIUM_DIR/download_file.dart"
+
+"$DART" "$DOWNLOAD_SCRIPT" "VAR_DOWNLOAD_URL" "VAR_DESTINATION"