OLD | NEW |
1 | 1 |
2 class Storage native "*Storage" { | 2 class Storage native "*Storage" { |
3 | 3 |
4 int length; | 4 int length; |
5 | 5 |
6 void clear() native; | 6 void clear() native; |
7 | 7 |
8 String getItem(String key) native; | 8 String getItem(String key) native; |
9 | 9 |
10 String key(int index) native; | 10 String key(int index) native; |
11 | 11 |
12 void removeItem(String key) native; | 12 void removeItem(String key) native; |
13 | 13 |
14 void setItem(String key, String data) native; | 14 void setItem(String key, String data) native; |
15 | 15 |
16 var dartObjectLocalStorage; | 16 var get dartObjectLocalStorage() native """ |
| 17 |
| 18 if (this === window.localStorage) |
| 19 return window._dartLocalStorageLocalStorage; |
| 20 else if (this === window.sessionStorage) |
| 21 return window._dartSessionStorageLocalStorage; |
| 22 else |
| 23 throw new UnsupportedOperationException('Cannot dartObjectLocalStorage for
unknown Storage object.'); |
| 24 |
| 25 """ { |
| 26 throw new UnsupportedOperationException(''); |
| 27 } |
| 28 |
| 29 void set dartObjectLocalStorage(var value) native """ |
| 30 |
| 31 if (this === window.localStorage) |
| 32 window._dartLocalStorageLocalStorage = value; |
| 33 else if (this === window.sessionStorage) |
| 34 window._dartSessionStorageLocalStorage = value; |
| 35 else |
| 36 throw new UnsupportedOperationException('Cannot dartObjectLocalStorage for
unknown Storage object.'); |
| 37 |
| 38 """ { |
| 39 throw new UnsupportedOperationException(''); |
| 40 } |
17 | 41 |
18 String get typeName() native; | 42 String get typeName() native; |
19 } | 43 } |
OLD | NEW |