다음 코드는 내부 Dartium Exception을 발생시킵니다.다트 indexed_db put() 오류
<!DOCTYPE html>
<html>
<head>
<script type="application/dart">
import 'dart:html';
import 'dart:indexed_db';
import 'dart:math';
Random random = new Random();
void main() {
window.indexedDB.open('myDB', version: 1, onUpgradeNeeded: _initDB).then((Database db) {
Transaction transaction = db.transaction('myStore', 'readwrite');
ObjectStore objectStore = transaction.objectStore('myStore');
Map data = {
'id': 'id' + random.nextInt(1000).toString(),
'name': 'name' + random.nextInt(1000).toString()
};
objectStore.put(data);
});
}
void _initDB(VersionChangeEvent e) {
(e.target as Request).result.createObjectStore('myStore');
}
</script>
<script src="packages/browser/dart.js"></script>
</head>
</html>
나는 http://www.dartbug.com/14256에 문제를 제기하지만, 어쩌면 뭔가 내 코드에서 잘못?
오류에 대한 추가 정보를 제공해 줄 수 있습니까? –
예, 여기 있습니다 http://www.dartbug.com/14256 – Leksat
MAP의 종류는 무엇입니까? 그게 문제가 될 것입니다. 아마지도 개체를 제대로 직렬화 할 수 없습니다. –