Catrope has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/203476

Change subject: Add ve.dm.Document#getLength
......................................................................

Add ve.dm.Document#getLength

Because getting the length shouldn't require reaching into
the .data property.

Change-Id: I34db90601112af972959c120487ae8fad76c467c
---
M src/dm/ve.dm.Document.js
1 file changed, 9 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/76/203476/1

diff --git a/src/dm/ve.dm.Document.js b/src/dm/ve.dm.Document.js
index fd2e23d..0fe7b5a 100644
--- a/src/dm/ve.dm.Document.js
+++ b/src/dm/ve.dm.Document.js
@@ -308,6 +308,15 @@
 };
 
 /**
+ * Get the length of the document. This is also the highest valid offset in 
the document.
+ *
+ * @return {number} Length of the document
+ */
+ve.dm.Document.prototype.getLength = function () {
+       return this.data.getLength();
+};
+
+/**
  * Apply a transaction's effects on the content data.
  *
  * @method

-- 
To view, visit https://gerrit.wikimedia.org/r/203476
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I34db90601112af972959c120487ae8fad76c467c
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to