Version 1.8.2
svn merge -c 41962 https://dart.googlecode.com/svn/branches/bleeding_edge 1.8
svn merge -c 41968 https://dart.googlecode.com/svn/branches/bleeding_edge 1.8
svn merge -c 41976 https://dart.googlecode.com/svn/branches/bleeding_edge 1.8
svn merge -c 41980 https://dart.googlecode.com/svn/branches/bleeding_edge 1.8
svn merge -c 41981 https://dart.googlecode.com/svn/branches/bleeding_edge 1.8
R=kasperl@google.com
Review URL: https://codereview.chromium.org//772443002
git-svn-id: http://dart.googlecode.com/svn/branches/1.8@42032 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/runtime/vm/ast_transformer.cc b/runtime/vm/ast_transformer.cc
index bb04f29..bbc26e1 100644
--- a/runtime/vm/ast_transformer.cc
+++ b/runtime/vm/ast_transformer.cc
@@ -380,6 +380,7 @@
for (intptr_t i = 0; i < node->length(); i++) {
new_args->Add(Transform(node->NodeAt(i)));
}
+ new_args->set_names(node->names());
result_ = new_args;
}
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 524db36..63b2e68 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -9183,7 +9183,7 @@
bool consume_cascades,
SequenceNode** await_preamble) {
TRACE_PARSER("ParseAwaitableExpr");
- parsed_function()->reset_have_seen_await();
+ BoolScope saved_seen_await(&parsed_function()->have_seen_await_expr_, false);
AstNode* expr = ParseExpr(require_compiletime_const, consume_cascades);
if (parsed_function()->have_seen_await()) {
// Make sure we do not reuse the scope to avoid creating contexts that we
@@ -9201,7 +9201,6 @@
} else {
*await_preamble = preamble;
}
- parsed_function()->reset_have_seen_await();
return result;
}
return expr;
diff --git a/runtime/vm/parser.h b/runtime/vm/parser.h
index 19c7f61..90f5b5c 100644
--- a/runtime/vm/parser.h
+++ b/runtime/vm/parser.h
@@ -27,6 +27,7 @@
class LocalVariable;
class SourceLabel;
template <typename T> class GrowableArray;
+class Parser;
struct CatchParamDesc;
class ClassDesc;
@@ -131,10 +132,7 @@
void AllocateVariables();
- void record_await() {
- have_seen_await_expr_ = true;
- }
- void reset_have_seen_await() { have_seen_await_expr_ = false; }
+ void record_await() { have_seen_await_expr_ = true; }
bool have_seen_await() const { return have_seen_await_expr_; }
void set_saved_try_ctx(LocalVariable* saved_try_ctx) {
@@ -178,6 +176,7 @@
Isolate* isolate_;
+ friend class Parser;
DISALLOW_COPY_AND_ASSIGN(ParsedFunction);
};
diff --git a/sdk/lib/io/http_impl.dart b/sdk/lib/io/http_impl.dart
index da5d2b6..5c49c2f 100644
--- a/sdk/lib/io/http_impl.dart
+++ b/sdk/lib/io/http_impl.dart
@@ -1329,8 +1329,11 @@
proxy,
_httpClient,
this);
+ // For the Host header an IPv6 address must be enclosed in []'s.
+ var host = uri.host;
+ if (host.contains(':')) host = "[$host]";
request.headers
- ..host = uri.host
+ ..host = host
..port = port
.._add(HttpHeaders.ACCEPT_ENCODING, "gzip");
if (_httpClient.userAgent != null) {
diff --git a/tests/language/await_regression_test.dart b/tests/language/await_regression_test.dart
new file mode 100644
index 0000000..d21e175
--- /dev/null
+++ b/tests/language/await_regression_test.dart
@@ -0,0 +1,38 @@
+// Copyright (c) 2014, 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.
+//
+// VMOptions=--enable_async
+//
+
+
+import 'dart:async';
+import 'package:expect/expect.dart';
+
+later(vodka) => new Future.value(vodka);
+
+manana(tequila) async => tequila;
+
+// Regression test for issue 21536.
+testNestedFunctions() async {
+ var a = await later('Asterix').then((tonic) {
+ return later(tonic);
+ });
+ var o = await manana('Obelix').then(manana);
+ Expect.equals("$a and $o", "Asterix and Obelix");
+}
+
+addLater({a, b}) => new Future.value(a + b);
+
+// Regression test for issue 21480.
+testNamedArguments() async {
+ var sum = await addLater(a:5, b:10);
+ Expect.equals(sum, 15);
+ sum = await addLater(b:11, a:-11);
+ Expect.equals(sum, 0);
+}
+
+main() async {
+ testNestedFunctions();
+ testNamedArguments();
+}
diff --git a/tests/standalone/io/http_ipv6_test.dart b/tests/standalone/io/http_ipv6_test.dart
new file mode 100644
index 0000000..b0d2acf
--- /dev/null
+++ b/tests/standalone/io/http_ipv6_test.dart
@@ -0,0 +1,47 @@
+// (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.
+
+// VMOptions=
+// VMOptions=--short_socket_read
+// VMOptions=--short_socket_write
+// VMOptions=--short_socket_read --short_socket_write
+
+import "dart:async";
+import "dart:io";
+
+import "package:async_helper/async_helper.dart";
+import "package:expect/expect.dart";
+
+// Client makes a HTTP 1.0 request without connection keep alive. The
+// server sets a content length but still needs to close the
+// connection as there is no keep alive.
+void testHttpIPv6() {
+ asyncStart();
+ HttpServer.bind("::", 0).then((server) {
+ server.listen((HttpRequest request) {
+ Expect.equals(request.headers["host"][0], "[::1]:${server.port}");
+ Expect.equals(request.requestedUri.host, "::1");
+ request.response.close();
+ });
+
+ var client = new HttpClient();
+ var url = Uri.parse('http://[::1]:${server.port}/xxx');
+ Expect.equals(url.host, '::1');
+ client.openUrl('GET', url)
+ .then((request) => request.close())
+ .then((response) {
+ Expect.equals(response.statusCode, HttpStatus.OK);
+ }).whenComplete(() {
+ server.close();
+ client.close();
+ asyncEnd();
+ });
+ });
+}
+
+
+
+void main() {
+ testHttpIPv6();
+}
diff --git a/tools/VERSION b/tools/VERSION
index 2335548..591703c 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -26,6 +26,6 @@
CHANNEL stable
MAJOR 1
MINOR 8
-PATCH 1
+PATCH 2
PRERELEASE 0
PRERELEASE_PATCH 0