Version 1.3.1

svn merge -c 35000 https://dart.googlecode.com/svn/branches/bleeding_edge 1.3
svn merge -c 35003 https://dart.googlecode.com/svn/branches/bleeding_edge 1.3
Merge bleeding edge revision 34868 by applying:
https://codereview.chromium.org/230583002
Cherry pick dartium blink revision 171516 by moving to 1847_stable branch at revision 171707

git-svn-id: http://dart.googlecode.com/svn/branches/1.3@35103 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart b/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart
index 231035a..0099ae3 100644
--- a/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart
@@ -948,6 +948,13 @@
     int cmp1 = isConstantInlinedOrAlreadyEmitted(a) ? 0 : 1;
     int cmp2 = isConstantInlinedOrAlreadyEmitted(b) ? 0 : 1;
     if (cmp1 + cmp2 < 2) return cmp1 - cmp2;
+
+    // Emit constant interceptors first. Constant intercpetors for primitives
+    // might be used by code that builds other constants.  See Issue 19183.
+    if (a.isInterceptor != b.isInterceptor) {
+      return a.isInterceptor ? -1 : 1;
+    }
+
     // Sorting by the long name clusters constants with the same constructor
     // which compresses a tiny bit better.
     int r = namer.constantLongName(a).compareTo(namer.constantLongName(b));
diff --git a/sdk/lib/io/file_impl.dart b/sdk/lib/io/file_impl.dart
index 71e3ffe..5846131 100644
--- a/sdk/lib/io/file_impl.dart
+++ b/sdk/lib/io/file_impl.dart
@@ -452,13 +452,16 @@
 
   List<int> readAsBytesSync() {
     var opened = openSync();
-    var builder = new BytesBuilder();
-    var data;
-    while ((data = opened.readSync(_BLOCK_SIZE)).length > 0) {
-      builder.add(data);
+    try {
+      var builder = new BytesBuilder();
+      var data;
+      while ((data = opened.readSync(_BLOCK_SIZE)).length > 0) {
+        builder.add(data);
+      }
+      return builder.takeBytes();
+    } finally {
+      opened.closeSync();
     }
-    opened.closeSync();
-    return builder.takeBytes();
   }
 
   String _tryDecode(List<int> bytes, Encoding encoding) {
@@ -526,9 +529,12 @@
                         {FileMode mode: FileMode.WRITE,
                          bool flush: false}) {
     RandomAccessFile opened = openSync(mode: mode);
-    opened.writeFromSync(bytes, 0, bytes.length);
-    if (flush) opened.flushSync();
-    opened.closeSync();
+    try {
+      opened.writeFromSync(bytes, 0, bytes.length);
+      if (flush) opened.flushSync();
+    } finally {
+      opened.closeSync();
+    }
   }
 
   Future<File> writeAsString(String contents,
diff --git a/tests/lib/lib.status b/tests/lib/lib.status
index f55445e..4493d1a 100644
--- a/tests/lib/lib.status
+++ b/tests/lib/lib.status
@@ -177,7 +177,6 @@
 
 [ $compiler == dart2js && $checked ]
 convert/utf85_test: Pass, Slow # Issue 12029.
-mirrors/metadata_nested_constructor_call_test/none: RuntimeError # Issue 17187
 
 [ $compiler == dart2js ]
 convert/chunked_conversion_utf88_test: Slow, Pass
diff --git a/tools/VERSION b/tools/VERSION
index e01a52a..f1a388e 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -26,6 +26,6 @@
 CHANNEL stable
 MAJOR 1
 MINOR 3
-PATCH 0
+PATCH 1
 PRERELEASE 0
 PRERELEASE_PATCH 0