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 if (this === window.localStorage) |
| 18 return window._dartLocalStorageLocalStorage; |
| 19 else if (this === window.sessionStorage) |
| 20 return window._dartSessionStorageLocalStorage; |
| 21 else |
| 22 throw new UnsupportedOperationException('Cannot dartObjectLocalStorage for
unknown Storage object.'); |
| 23 """; |
| 24 |
| 25 void set dartObjectLocalStorage(var value) native """ |
| 26 if (this === window.localStorage) |
| 27 window._dartLocalStorageLocalStorage = value; |
| 28 else if (this === window.sessionStorage) |
| 29 window._dartSessionStorageLocalStorage = value; |
| 30 else |
| 31 throw new UnsupportedOperationException('Cannot dartObjectLocalStorage for
unknown Storage object.'); |
| 32 """; |
17 | 33 |
18 String get typeName() native; | 34 String get typeName() native; |
19 } | 35 } |
OLD | NEW |