| 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 part of html; | 5 part of html; |
| 6 | 6 |
| 7 class _Utils { | 7 class _Utils { |
| 8 static double dateTimeToDouble(DateTime dateTime) => | 8 static double dateTimeToDouble(DateTime dateTime) => |
| 9 dateTime.millisecondsSinceEpoch.toDouble(); | 9 dateTime.millisecondsSinceEpoch.toDouble(); |
| 10 static DateTime doubleToDateTime(double dateTime) { | 10 static DateTime doubleToDateTime(double dateTime) { |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 _DOMStringMap.internal(); | 119 _DOMStringMap.internal(); |
| 120 | 120 |
| 121 bool containsValue(String value) => Maps.containsValue(this, value); | 121 bool containsValue(String value) => Maps.containsValue(this, value); |
| 122 bool containsKey(String key) native "DOMStringMap_containsKey_Callback"; | 122 bool containsKey(String key) native "DOMStringMap_containsKey_Callback"; |
| 123 String operator [](String key) native "DOMStringMap_item_Callback"; | 123 String operator [](String key) native "DOMStringMap_item_Callback"; |
| 124 void operator []=(String key, String value) native "DOMStringMap_setItem_Callb
ack"; | 124 void operator []=(String key, String value) native "DOMStringMap_setItem_Callb
ack"; |
| 125 String putIfAbsent(String key, String ifAbsent()) => Maps.putIfAbsent(this, ke
y, ifAbsent); | 125 String putIfAbsent(String key, String ifAbsent()) => Maps.putIfAbsent(this, ke
y, ifAbsent); |
| 126 String remove(String key) native "DOMStringMap_remove_Callback"; | 126 String remove(String key) native "DOMStringMap_remove_Callback"; |
| 127 void clear() => Maps.clear(this); | 127 void clear() => Maps.clear(this); |
| 128 void forEach(void f(String key, String value)) => Maps.forEach(this, f); | 128 void forEach(void f(String key, String value)) => Maps.forEach(this, f); |
| 129 Collection<String> get keys native "DOMStringMap_getKeys_Callback"; | 129 Iterable<String> get keys native "DOMStringMap_getKeys_Callback"; |
| 130 Collection<String> get values => Maps.getValues(this); | 130 Iterable<String> get values => Maps.getValues(this); |
| 131 int get length => Maps.length(this); | 131 int get length => Maps.length(this); |
| 132 bool get isEmpty => Maps.isEmpty(this); | 132 bool get isEmpty => Maps.isEmpty(this); |
| 133 } | 133 } |
| 134 | 134 |
| 135 final Future<SendPort> __HELPER_ISOLATE_PORT = | 135 final Future<SendPort> __HELPER_ISOLATE_PORT = |
| 136 spawnDomFunction(_helperIsolateMain); | 136 spawnDomFunction(_helperIsolateMain); |
| 137 | 137 |
| 138 // Tricky part. | 138 // Tricky part. |
| 139 // Once __HELPER_ISOLATE_PORT gets resolved, it will still delay in .then | 139 // Once __HELPER_ISOLATE_PORT gets resolved, it will still delay in .then |
| 140 // and to delay Timer.run is used. However, Timer.run will try to register | 140 // and to delay Timer.run is used. However, Timer.run will try to register |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 } | 240 } |
| 241 | 241 |
| 242 _send(msg) { | 242 _send(msg) { |
| 243 _sendToHelperIsolate(msg, _sendPort); | 243 _sendToHelperIsolate(msg, _sendPort); |
| 244 } | 244 } |
| 245 } | 245 } |
| 246 | 246 |
| 247 get _pureIsolateTimerFactoryClosure => | 247 get _pureIsolateTimerFactoryClosure => |
| 248 ((int milliSeconds, void callback(Timer time), bool repeating) => | 248 ((int milliSeconds, void callback(Timer time), bool repeating) => |
| 249 new _PureIsolateTimer(milliSeconds, callback, repeating)); | 249 new _PureIsolateTimer(milliSeconds, callback, repeating)); |
| OLD | NEW |