| 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 class _Utils { | 5 class _Utils { |
| 6 static List convertToList(List list) { | 6 static List convertToList(List list) { |
| 7 // FIXME: [possible optimization]: do not copy the array if Dart_IsArray is
fine w/ it. | 7 // FIXME: [possible optimization]: do not copy the array if Dart_IsArray is
fine w/ it. |
| 8 final length = list.length; | 8 final length = list.length; |
| 9 List result = new List(length); | 9 List result = new List(length); |
| 10 result.copyFrom(list, 0, 0, length); | 10 result.copyFrom(list, 0, 0, length); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 80 |
| 81 class _LocationCrossFrameImpl extends _DOMWrapperBase implements Location { | 81 class _LocationCrossFrameImpl extends _DOMWrapperBase implements Location { |
| 82 _LocationCrossFrameImpl(); | 82 _LocationCrossFrameImpl(); |
| 83 | 83 |
| 84 // Fields. | 84 // Fields. |
| 85 void set href(String) native "Location_href_Setter"; | 85 void set href(String) native "Location_href_Setter"; |
| 86 | 86 |
| 87 // Implementation support. | 87 // Implementation support. |
| 88 String get typeName() => "Location"; | 88 String get typeName() => "Location"; |
| 89 } | 89 } |
| 90 |
| 91 class _DOMStringMapImpl extends _DOMWrapperBase implements Map<String, String> { |
| 92 _DOMStringMapImpl(); |
| 93 |
| 94 bool containsValue(String value) => Maps.containsValue(this, value); |
| 95 bool containsKey(String key) native "DOMStringMap_containsKey_Callback"; |
| 96 String operator [](String key) native "DOMStringMap_item_Callback"; |
| 97 void operator []=(String key, String value) native "DOMStringMap_setItem_Callb
ack"; |
| 98 String putIfAbsent(String key, String ifAbsent()) => Maps.putIfAbsent(this, ke
y, ifAbsent); |
| 99 String remove(String key) native "DOMStringMap_remove_Callback"; |
| 100 void clear() => Maps.clear(this); |
| 101 void forEach(void f(String key, String value)) => Maps.forEach(this, f); |
| 102 Collection<String> getKeys() native "DOMStringMap_getKeys_Callback"; |
| 103 Collection<String> getValues() => Maps.getValues(this); |
| 104 int get length() => Maps.length(this); |
| 105 bool isEmpty() => Maps.isEmpty(this); |
| 106 } |
| OLD | NEW |