| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // Patch file for the dart:isolate library. | 5 // Patch file for the dart:isolate library. |
| 6 | 6 |
| 7 #import("dart:uri"); | 7 #import("dart:uri"); |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * Called by the compiler to support switching | 10 * Called by the compiler to support switching |
| (...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 848 // list.forEach(_dispatch); | 848 // list.forEach(_dispatch); |
| 849 list.forEach((e) => _dispatch(e)); | 849 list.forEach((e) => _dispatch(e)); |
| 850 } | 850 } |
| 851 | 851 |
| 852 visitMap(Map map) { | 852 visitMap(Map map) { |
| 853 final seen = _visited[map]; | 853 final seen = _visited[map]; |
| 854 if (seen != null) return; | 854 if (seen != null) return; |
| 855 | 855 |
| 856 _visited[map] = true; | 856 _visited[map] = true; |
| 857 // TODO(sigmund): replace with the following: (bug #1660) | 857 // TODO(sigmund): replace with the following: (bug #1660) |
| 858 // map.getValues().forEach(_dispatch); | 858 // map.values.forEach(_dispatch); |
| 859 map.getValues().forEach((e) => _dispatch(e)); | 859 map.values.forEach((e) => _dispatch(e)); |
| 860 } | 860 } |
| 861 | 861 |
| 862 visitSendPort(SendPort port) { | 862 visitSendPort(SendPort port) { |
| 863 if (port is _BufferingSendPort && port._port == null) { | 863 if (port is _BufferingSendPort && port._port == null) { |
| 864 ports.add(port._futurePort); | 864 ports.add(port._futurePort); |
| 865 } | 865 } |
| 866 } | 866 } |
| 867 } | 867 } |
| 868 | 868 |
| 869 /******************************************************** | 869 /******************************************************** |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1146 // TODO(floitsch): we are losing the generic type. | 1146 // TODO(floitsch): we are losing the generic type. |
| 1147 return ['list', id, jsArray]; | 1147 return ['list', id, jsArray]; |
| 1148 } | 1148 } |
| 1149 | 1149 |
| 1150 visitMap(Map map) { | 1150 visitMap(Map map) { |
| 1151 int copyId = _visited[map]; | 1151 int copyId = _visited[map]; |
| 1152 if (copyId != null) return ['ref', copyId]; | 1152 if (copyId != null) return ['ref', copyId]; |
| 1153 | 1153 |
| 1154 int id = _nextFreeRefId++; | 1154 int id = _nextFreeRefId++; |
| 1155 _visited[map] = id; | 1155 _visited[map] = id; |
| 1156 var keys = _serializeList(map.getKeys()); | 1156 var keys = _serializeList(map.keys); |
| 1157 var values = _serializeList(map.getValues()); | 1157 var values = _serializeList(map.values); |
| 1158 // TODO(floitsch): we are losing the generic type. | 1158 // TODO(floitsch): we are losing the generic type. |
| 1159 return ['map', id, keys, values]; | 1159 return ['map', id, keys, values]; |
| 1160 } | 1160 } |
| 1161 | 1161 |
| 1162 _serializeList(List list) { | 1162 _serializeList(List list) { |
| 1163 int len = list.length; | 1163 int len = list.length; |
| 1164 var result = new List(len); | 1164 var result = new List(len); |
| 1165 for (int i = 0; i < len; i++) { | 1165 for (int i = 0; i < len; i++) { |
| 1166 result[i] = _dispatch(list[i]); | 1166 result[i] = _dispatch(list[i]); |
| 1167 } | 1167 } |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1280 _window.clearTimeout(_handle); | 1280 _window.clearTimeout(_handle); |
| 1281 } else { | 1281 } else { |
| 1282 _window.clearInterval(_handle); | 1282 _window.clearInterval(_handle); |
| 1283 } | 1283 } |
| 1284 } | 1284 } |
| 1285 } | 1285 } |
| 1286 | 1286 |
| 1287 Timer _timerFactory(int millis, void callback(Timer timer), bool repeating) => | 1287 Timer _timerFactory(int millis, void callback(Timer timer), bool repeating) => |
| 1288 repeating ? new _Timer.repeating(millis, callback) | 1288 repeating ? new _Timer.repeating(millis, callback) |
| 1289 : new _Timer(millis, callback); | 1289 : new _Timer(millis, callback); |
| OLD | NEW |