Arlolra has uploaded a new change for review.

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

Change subject: Move page docs closer to where it's being used
......................................................................

Move page docs closer to where it's being used

Change-Id: I75a84f253cb399158cdd2e6cd882350dd76ee243
---
M lib/config/MWParserEnvironment.js
1 file changed, 48 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid 
refs/changes/79/292379/1

diff --git a/lib/config/MWParserEnvironment.js 
b/lib/config/MWParserEnvironment.js
index 12f9f72..0bda396 100644
--- a/lib/config/MWParserEnvironment.js
+++ b/lib/config/MWParserEnvironment.js
@@ -27,17 +27,56 @@
  */
 var MWParserEnvironment = function(parsoidConfig, options) {
        options = options || {};
+       var self = this;
 
        // page information
-       this.page = {
-               name: this.defaultPageName,
-               relativeLinkPrefix: '',
-               id: null,
-               src: null,  // start as null to distinguish the empty string
-               dom: null,
-               ns: null,
-               title: null,  // a full Title object
-       };
+       this.page = (function() {
+               var Page = function() {};
+
+               /**
+                * @property {String} name
+                */
+               Page.prototype.name = self.defaultPageName;
+
+               /**
+                * Any leading ..?/ strings that will be necessary for building 
links.
+                *
+                * @property {String} relativeLinkPrefix
+                */
+               Page.prototype.relativeLinkPrefix = '';
+
+               /**
+                * The revision ID we want to use for the page.
+                *
+                * @property {Number|null} id
+                */
+               Page.prototype.id = null;
+
+               /**
+                * Start as null to distinguish the empty string.
+                *
+                * @property {String|null} src
+                */
+               Page.prototype.src = null;
+
+               /**
+                * @property {Node|null} dom
+                */
+               Page.prototype.dom = null;
+
+               /**
+                * @property {Number|null} ns
+                */
+               Page.prototype.ns = null;
+
+               /**
+                * A full Title object.
+                * @property {Object|null} dom
+                */
+               Page.prototype.title = null;
+
+               return new Page();
+       })();
 
        // A passed-in cookie, if any
        this.cookie = options.cookie || null;
@@ -157,17 +196,6 @@
 
 // Cache for wiki configurations, shared between requests.
 MWParserEnvironment.prototype.confCache = {};
-
-/**
- * @property {Object} page
- * @property {String} page.name
- * @property {String|null} page.src
- * @property {Node|null} page.dom
- * @property {String} page.relativeLinkPrefix
- *   Any leading ..?/ strings that will be necessary for building links.
- * @property {Number|null} page.id
- *   The revision ID we want to use for the page.
- */
 
 /**
  * @method

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I75a84f253cb399158cdd2e6cd882350dd76ee243
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Arlolra <[email protected]>

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

Reply via email to