jenkins-bot has submitted this change and it was merged.

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(-)

Approvals:
  Krinkle: Looks good to me, approved
  jenkins-bot: Verified



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: merged
Gerrit-Change-Id: I34db90601112af972959c120487ae8fad76c467c
Gerrit-PatchSet: 2
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to