以下代码引发内部 Dartium 异常。
<!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提交了一个问题,但我的代码可能有问题?