root.toDelta check replaced with assertion

pull/1964/head
Alspb 10 months ago
parent edc6a42bf7
commit b48cbf6e0a
  1. 6
      lib/src/models/documents/document.dart

@ -334,10 +334,7 @@ class Document {
} catch (e) { } catch (e) {
throw StateError('_delta compose failed'); throw StateError('_delta compose failed');
} }
assert(_delta == _root.toDelta(), 'Compose failed');
if (_delta != _root.toDelta()) {
throw StateError('Compose failed');
}
final change = DocChange(originalDelta, delta, changeSource); final change = DocChange(originalDelta, delta, changeSource);
documentChangeObserver.add(change); documentChangeObserver.add(change);
history.handleDocChange(change); history.handleDocChange(change);
@ -422,7 +419,6 @@ class Document {
doc.toString(), 'Document Delta cannot be empty.'); doc.toString(), 'Document Delta cannot be empty.');
} }
// print(doc.last.data.runtimeType);
assert((doc.last.data as String).endsWith('\n')); assert((doc.last.data as String).endsWith('\n'));
var offset = 0; var offset = 0;

Loading…
Cancel
Save