OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 // WARNING: Do not edit - generated code. | 5 // WARNING: Do not edit - generated code. |
6 | 6 |
7 class _DataTransferItemListWrappingImplementation extends DOMWrapperBase impleme
nts DataTransferItemList { | 7 class _DataTransferItemListWrappingImplementation extends DOMWrapperBase impleme
nts DataTransferItemList { |
8 _DataTransferItemListWrappingImplementation() : super() {} | 8 _DataTransferItemListWrappingImplementation() : super() {} |
9 | 9 |
10 static create__DataTransferItemListWrappingImplementation() native { | 10 static create__DataTransferItemListWrappingImplementation() native { |
11 return new _DataTransferItemListWrappingImplementation(); | 11 return new _DataTransferItemListWrappingImplementation(); |
12 } | 12 } |
13 | 13 |
14 int get length() { return _get_length(this); } | 14 int get length() { return _get_length(this); } |
15 static int _get_length(var _this) native; | 15 static int _get_length(var _this) native; |
16 | 16 |
17 void add(String data, String type) { | 17 void add(var data_OR_file, [String type = null]) { |
18 _add(this, data, type); | 18 if (data_OR_file is File) { |
19 return; | 19 if (type === null) { |
| 20 _add(this, data_OR_file); |
| 21 return; |
| 22 } |
| 23 } else { |
| 24 if (data_OR_file is String) { |
| 25 _add_2(this, data_OR_file, type); |
| 26 return; |
| 27 } |
| 28 } |
| 29 throw "Incorrect number or type of arguments"; |
20 } | 30 } |
21 static void _add(receiver, data, type) native; | 31 static void _add(receiver, data_OR_file) native; |
| 32 static void _add_2(receiver, data_OR_file, type) native; |
22 | 33 |
23 void clear() { | 34 void clear() { |
24 _clear(this); | 35 _clear(this); |
25 return; | 36 return; |
26 } | 37 } |
27 static void _clear(receiver) native; | 38 static void _clear(receiver) native; |
28 | 39 |
29 DataTransferItem item(int index) { | 40 DataTransferItem item(int index) { |
30 return _item(this, index); | 41 return _item(this, index); |
31 } | 42 } |
32 static DataTransferItem _item(receiver, index) native; | 43 static DataTransferItem _item(receiver, index) native; |
33 | 44 |
34 String get typeName() { return "DataTransferItemList"; } | 45 String get typeName() { return "DataTransferItemList"; } |
35 } | 46 } |
OLD | NEW |