Cscott has uploaded a new change for review.
https://gerrit.wikimedia.org/r/232183
Change subject: doc: fix jsduck @param markup, using new jscs checker.
......................................................................
doc: fix jsduck @param markup, using new jscs checker.
Change-Id: Ibfcab06e7a53eb0674c2e0e08fbcfb8bb7bf32d5
---
M .jscsrc
M api/utils.js
M lib/ParsoidLogger.js
M lib/domTraverser.js
M lib/ext.core.ExtensionHandler.js
M lib/ext.core.TemplateHandler.js
M lib/ext.core.TokenStreamPatcher.js
M lib/jsapi.js
M lib/mediawiki.ApiRequest.js
M lib/mediawiki.Batcher.js
M lib/mediawiki.DOMPostProcessor.js
M lib/mediawiki.DOMUtils.js
M lib/mediawiki.HTML5TreeBuilder.node.js
M lib/mediawiki.TokenTransformManager.js
M lib/mediawiki.Util.js
M lib/mediawiki.WikiConfig.js
M lib/mediawiki.parser.defines.js
M lib/mediawiki.parser.environment.js
M lib/mediawiki.tokenizer.peg.js
M tests/parserTests.js
20 files changed, 166 insertions(+), 67 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid
refs/changes/83/232183/1
diff --git a/.jscsrc b/.jscsrc
index f47eded..8b2e6a5 100644
--- a/.jscsrc
+++ b/.jscsrc
@@ -3,7 +3,8 @@
"jsDoc": {
"checkAnnotations": {
"preset": "jsduck5"
- }
+ },
+ "checkParamNames": true
},
"requireCurlyBraces": [
"if",
diff --git a/api/utils.js b/api/utils.js
index e1bb8e1..125c90b 100644
--- a/api/utils.js
+++ b/api/utils.js
@@ -14,8 +14,14 @@
var PHPParseRequest = ApiRequest.PHPParseRequest;
+/**
+ * @class apiUtils
+ * @singleton
+ */
var apiUtils = module.exports = {
+ /** @property {string} */
WIKITEXT_CONTENT_TYPE:
'text/plain;profile=mediawiki.org/specs/wikitext/1.0.0;charset=utf-8',
+ /** @property {string} */
HTML_CONTENT_TYPE:
'text/html;profile=mediawiki.org/specs/html/1.1.0;charset=utf-8',
};
@@ -25,6 +31,8 @@
* (Returns if a response has already been sent.)
* This is not strictly HTTP spec conformant, but works in most clients. More
* importantly, it works both behind proxies and on the internal network.
+ * @method
+ * @param {Object} args
*/
apiUtils.relativeRedirect = function(args) {
if (!args.code) {
@@ -45,9 +53,8 @@
* Set header, but only if response hasn't been sent.
*
* @method
- * @param {MWParserEnvironment} env
* @param {Response} res The response object from our routing function.
- * @property {Function} Serializer
+ * @param {MWParserEnvironment} env
*/
apiUtils.setHeader = function(res, env) {
if (env.responseSent) {
@@ -61,9 +68,8 @@
* End response, but only if response hasn't been sent.
*
* @method
- * @param {MWParserEnvironment} env
* @param {Response} res The response object from our routing function.
- * @property {Function} Serializer
+ * @param {MWParserEnvironment} env
*/
apiUtils.endResponse = function(res, env) {
if (env.responseSent) {
@@ -79,9 +85,8 @@
* Send response, but only if response hasn't been sent.
*
* @method
- * @param {MWParserEnvironment} env
* @param {Response} res The response object from our routing function.
- * @property {Function} Serializer
+ * @param {MWParserEnvironment} env
*/
apiUtils.sendResponse = function(res, env) {
if (env.responseSent) {
@@ -94,6 +99,10 @@
/**
* Render response, but only if response hasn't been sent.
+ * @param {Response} res The response object from our routing function.
+ * @param {MWParserEnvironment} env
+ * @param template
+ * @param data
*/
apiUtils.renderResponse = function(res, env, template, data) {
if (env.responseSent) {
@@ -104,6 +113,13 @@
}
};
+/**
+ * Send JSON response, but only if response hasn't been sent.
+ *
+ * @method
+ * @param {Response} res The response object from our routing function.
+ * @param {MWParserEnvironment} env
+ */
apiUtils.jsonResponse = function(res, env) {
if (env.responseSent) {
return;
@@ -128,6 +144,9 @@
*
* The above is susceptible false positives. Node spins one event loop, so
* multiple asynchronous requests will interfere with each others' timing.
+ * @method
+ * @param {MWParserEnvironment} env
+ * @param {Error} err
*/
apiUtils.timeoutResp = function(env, err) {
@@ -149,6 +168,11 @@
// Cluster support was very experimental and missing methods in v0.8.x
var sufficientNodeVersion = !/^v0\.[0-8]\./.test(process.version);
+/**
+ * @method
+ * @param {Promise} p
+ * @param {Response} res The response object from our routing function.
+ */
apiUtils.cpuTimeout = function(p, res) {
var CPU_TIMEOUT = res.local('env').conf.parsoid.timeouts.cpu;
var timeoutId = res.local('timeoutId');
diff --git a/lib/ParsoidLogger.js b/lib/ParsoidLogger.js
index b6df3e1..d7dc9af 100644
--- a/lib/ParsoidLogger.js
+++ b/lib/ParsoidLogger.js
@@ -6,6 +6,10 @@
var coreutil = require('util');
+/**
+ * @class
+ * @constructor
+ */
function LocationData(wiki, title, meta, reqId) {
this.wiki = wiki;
this.title = title;
@@ -21,6 +25,11 @@
};
+/**
+ * @class
+ * @extends LogData
+ * @constructor
+ */
function ParsoidLogData(logType, logObject, locationData) {
this.locationData = locationData;
LogData.call(this, logType, logObject);
diff --git a/lib/domTraverser.js b/lib/domTraverser.js
index 0705d92..f19f5ab 100644
--- a/lib/domTraverser.js
+++ b/lib/domTraverser.js
@@ -24,11 +24,15 @@
/**
* Add a handler to the DOM traversal
*
- * @param {Function} action A callback, called on each node we
- * traverse that matches nodeName. First argument is the DOM
- * node. Return false if you want to stop any further callbacks from
- * being called on the node. Return the new node if you need to replace
- * it or change its siblings; traversal will continue with the new node.
+ * @param {string} nodeName
+ * @param {Function} action
+ * A callback, called on each node we traverse that matches nodeName.
+ * @param {Node} action.node
+ * The DOM node.
+ * @param {boolean|Node} action.return
+ * Return false if you want to stop any further callbacks from being
+ * called on the node. Return the new node if you need to replace it or
+ * change its siblings; traversal will continue with the new node.
*/
DOMTraverser.prototype.addHandler = function(nodeName, action) {
var handler = {
diff --git a/lib/ext.core.ExtensionHandler.js b/lib/ext.core.ExtensionHandler.js
index f02687a..7cf4bd2 100644
--- a/lib/ext.core.ExtensionHandler.js
+++ b/lib/ext.core.ExtensionHandler.js
@@ -12,6 +12,11 @@
var EndTagTk = defines.EndTagTk;
+/**
+ * @class
+ * @extends TemplateHandler
+ * @constructor
+ */
function ExtensionHandler(manager, options) {
TemplateHandler.apply(this, arguments);
}
diff --git a/lib/ext.core.TemplateHandler.js b/lib/ext.core.TemplateHandler.js
index 1405fd2..3b63ae3 100644
--- a/lib/ext.core.TemplateHandler.js
+++ b/lib/ext.core.TemplateHandler.js
@@ -30,6 +30,10 @@
var EndTagTk = defines.EndTagTk;
+/**
+ * @class
+ * @constructor
+ */
function TemplateHandler(manager, options) {
this.manager = manager;
this.env = manager.env;
diff --git a/lib/ext.core.TokenStreamPatcher.js
b/lib/ext.core.TokenStreamPatcher.js
index ecc438e..81ba030 100644
--- a/lib/ext.core.TokenStreamPatcher.js
+++ b/lib/ext.core.TokenStreamPatcher.js
@@ -24,7 +24,11 @@
var EndTagTk = defines.EndTagTk;
var KV = defines.KV;
-
+/**
+ * @class
+ * @extends TemplateHandler
+ * @constructor
+ */
function TokenStreamPatcher(manager, options) {
TemplateHandler.apply(this, arguments);
this.tokenizer = new PegTokenizer(this.env);
diff --git a/lib/jsapi.js b/lib/jsapi.js
index d0f9add..d83cdc4 100644
--- a/lib/jsapi.js
+++ b/lib/jsapi.js
@@ -173,6 +173,12 @@
/**
* @method
* @private
+ * @param {Array} result
+ * A result array to append new items to as they are found
+ * @param {string} selector
+ * CSS-style selector for the nodes of interest
+ * @param {Function} func
+ * Function to apply to every non-template match
* @param {Object} [opts]
* @param {boolean} [opts.recursive]
* Set to `false` to avoid recursing into templates.
diff --git a/lib/mediawiki.ApiRequest.js b/lib/mediawiki.ApiRequest.js
index 62f865f..aefb44f 100644
--- a/lib/mediawiki.ApiRequest.js
+++ b/lib/mediawiki.ApiRequest.js
@@ -597,10 +597,10 @@
*
* @constructor
* @param {MWParserEnvironment} env
- * @param {string} title The title of the page to use as context
+ * @param {string} name The title of the page to use as context
* @param {string} text
- * @param {boolean} onlypst (optional) Pass onlypst to PHP parser
- * @param {string} hash The queue key
+ * @param {boolean} [onlypst] Pass onlypst to PHP parser
+ * @param {string} [hash] The queue key
*/
function PHPParseRequest(env, name, text, onlypst, hash) {
ApiRequest.call(this, env, name);
diff --git a/lib/mediawiki.Batcher.js b/lib/mediawiki.Batcher.js
index b99310d..15eae28 100644
--- a/lib/mediawiki.Batcher.js
+++ b/lib/mediawiki.Batcher.js
@@ -31,8 +31,8 @@
/**
* Internal function for adding a generic work item.
*
- * @param {Object} dims
- * @param {Function} item callback
+ * @param {Object} params
+ * @param {Function} cb item callback
*/
Batcher.prototype.pushGeneric = function(params, cb) {
var hash = params.hash;
diff --git a/lib/mediawiki.DOMPostProcessor.js
b/lib/mediawiki.DOMPostProcessor.js
index ebaf5d8..1967a23 100644
--- a/lib/mediawiki.DOMPostProcessor.js
+++ b/lib/mediawiki.DOMPostProcessor.js
@@ -90,6 +90,13 @@
document.head.appendChild(elt);
}
+/**
+ * @class
+ * @extends EventEmitter
+ * @constructor
+ * @param {MWParserEnvironment} env
+ * @param {Object} options
+ */
function DOMPostProcessor(env, options) {
events.EventEmitter.call(this);
this.env = env;
diff --git a/lib/mediawiki.DOMUtils.js b/lib/mediawiki.DOMUtils.js
index c0cf98c..80307b9 100644
--- a/lib/mediawiki.DOMUtils.js
+++ b/lib/mediawiki.DOMUtils.js
@@ -363,6 +363,7 @@
/**
* Get an object from a JSON-encoded XML attribute on a node.
*
+ * @param {Node} node
* @param {String} name Name of the attribute
* @param {Mixed} defaultVal What should be returned if we fail to find
a valid JSON structure
*/
@@ -387,9 +388,10 @@
/**
* Set an attribute on a node to a JSON-encoded object.
*
- * @param {Node} n
+ * @param {Node} node
* @param {string} name Name of the attribute
* @param {Object} obj
+ * @return {Node} The `node` parameter
*/
setJSONAttribute: function(node, name, obj) {
node.setAttribute(name, JSON.stringify(obj));
@@ -442,6 +444,7 @@
/**
* Get the attributes on a node in an array of KV objects.
*
+ * @param {Node} node
* @return {KV[]}
*/
getAttributeKVArray: function(node) {
@@ -458,6 +461,7 @@
* Build path from a node to its passed-in ancestor.
* Doesn't include the ancestor in the returned path.
*
+ * @param {Node} node
* @param {Node} ancestor Should be an ancestor of `node`
* @return {Node[]}
*/
@@ -483,6 +487,7 @@
/**
* Build path from a node to its passed-in sibling.
*
+ * @param {Node} node
* @param {Node} sibling
* @param {boolean} left Whether to go backwards, i.e., use
previousSibling instead of nextSibling.
* @return {Node[]} Will not include the passed-in sibling.
@@ -827,8 +832,8 @@
* are guaranteed to be marked and nested content might not
* necessarily be marked.
*
- * @param {MWParserEnvironment} env
* @param {Node} node
+ * @return {boolean}
*/
isTplOrExtToplevelNode: function(node) {
if (DU.isElt(node)) {
@@ -867,7 +872,9 @@
* This should come close to matching Util.isSolTransparent(), but with
* the single line caveat.
*
+ * @param {MWParserEnvironment} env
* @param {Node} node
+ * @param {boolean} [wt2htmlMode]
*/
emitsSolTransparentSingleLineWT: function(env, node, wt2htmlMode) {
if (DU.isText(node)) {
@@ -1815,9 +1822,6 @@
* @param {Node[]} expansion.nodes
* Outermost nodes of the HTML
*
- * @param {Function} addAttrsCB
- * Callback that adds additional attributes to the generated tokens.
- *
* @param {Object} [opts]
* @param {String} opts.aboutId
* The about-id to set on the generated tokens.
@@ -2246,7 +2250,7 @@
var XMLSerializer = new XMLSerializer();
/**
- * @method serializeNode
+ * @method
*
* Serialize a HTML DOM3 document to XHTML
* The output is identical to standard XHTML5 DOM serialization, as given by
@@ -2257,8 +2261,12 @@
* result in more compact output than the standard double-quoted serialization.
*
* @param {Node} doc
- * @param {Object} options: flags smartQuote, innerXML, captureOffsets
+ * @param {Object} [options]
+ * @param {boolean} [options.smartQuote=true]
+ * @param {boolean} [options.innerXML=false]
+ * @param {boolean} [options.captureOffsets=false]
* @return {Object}
+ * @return {string} return.str
*/
DOMUtils.serializeNode = function(doc, options) {
if (!options) { options = {}; }
@@ -2277,7 +2285,7 @@
};
/**
- * @method serializeChildren
+ * @method
*
* Serialize the children of a HTML DOM3 node to XHTML
* The output is identical to standard XHTML5 DOM serialization, as given by
@@ -2288,7 +2296,9 @@
* result in more compact output than the standard double-quoted serialization.
*
* @param {Node} node
- * @param {Object} options: flags smartQuote, innerHTML
+ * @param {Object} [options]
+ * @param {boolean} [options.smartQuote]
+ * @param {boolean} [options.captureOffsets]
* @return {string}
*/
DOMUtils.serializeChildren = function(node, options) {
@@ -2302,7 +2312,7 @@
};
/**
- * @method normalizeIEW
+ * @method
*
* Normalize newlines in IEW to spaces instead.
*
@@ -2424,7 +2434,7 @@
};
/**
- * @method normalizeHTML
+ * @method
*
* Normalize the expected parser output by parsing it using a HTML5 parser and
* re-serializing it to HTML. Ideally, the parser would normalize inter-tag
@@ -2471,7 +2481,7 @@
};
/**
- * @method normalizeOut
+ * @method
*
* Specialized normalization of the wiki parser output, mostly to ignore a few
* known-ok differences. If parsoidOnly is true-ish, then we allow more
@@ -2548,7 +2558,7 @@
};
/**
- * @method parseHTML
+ * @method
*
* Parse HTML, return the tree.
*
@@ -2587,7 +2597,7 @@
};
/**
- * @method encodeXml
+ * @method
*
* Little helper function for encoding XML entities
*
@@ -2598,8 +2608,10 @@
return entities.encodeXML(string);
};
+var WikitextSerializer;
+var SelectiveSerializer;
/**
- * @method serializeDOM
+ * @method
*
* The main serializer handler.
*
@@ -2608,8 +2620,6 @@
* @param {Boolean} useSelser Use the selective serializer, or not.
* @param {Function} cb Optional callback.
*/
-var WikitextSerializer;
-var SelectiveSerializer;
DOMUtils.serializeDOM = function(env, body, useSelser, cb) {
// Circular refs
if (!WikitextSerializer) {
diff --git a/lib/mediawiki.HTML5TreeBuilder.node.js
b/lib/mediawiki.HTML5TreeBuilder.node.js
index 51a3b29..984d146 100644
--- a/lib/mediawiki.HTML5TreeBuilder.node.js
+++ b/lib/mediawiki.HTML5TreeBuilder.node.js
@@ -22,6 +22,11 @@
var EndTagTk = defines.EndTagTk;
+/**
+ * @class
+ * @extends EventEmitter
+ * @constructor
+ */
function TreeBuilder(env) {
events.EventEmitter.call(this);
this.env = env;
diff --git a/lib/mediawiki.TokenTransformManager.js
b/lib/mediawiki.TokenTransformManager.js
index bc7aad0..39e6c7a 100644
--- a/lib/mediawiki.TokenTransformManager.js
+++ b/lib/mediawiki.TokenTransformManager.js
@@ -59,6 +59,7 @@
* Base class for token transform managers
*
* @class
+ * @extends EventEmitter
* @constructor
* @param {MWParserEnvironment} env
* @param {Object} options
@@ -98,7 +99,7 @@
* XXX: Perform registration directly in the constructor?
*
* @method
- * @param {Object} EventEmitter token even emitter.
+ * @param {EventEmitter} tokenEmitter token event emitter.
*/
TokenTransformManager.prototype.addListenersOn = function(tokenEmitter) {
tokenEmitter.addListener('chunk', this.onChunk.bind(this));
@@ -124,12 +125,16 @@
* @param {Token[]} transformation.cb.result.tokens
* @param {Object} transformation.return
* @param {Token[]} transformation.return.tokens
- * @param {string} Debug string to identify the transformer in a trace.
- * @param {number} rank, [0,3) with [0,1) in-order on input token stream,
- * [1,2) out-of-order and [2,3) in-order on output token stream
- * @param {string} type, one of 'tag', 'text', 'newline', 'comment', 'end',
- * 'martian' (unknown token), 'any' (any token, matched before other matches).
- * @param {string} tag name for tags, omitted for non-tags
+ * @param {string} debugName
+ * Debug string to identify the transformer in a trace.
+ * @param {number} rank
+ * [0,3) with [0,1) in-order on input token stream,
+ * [1,2) out-of-order and [2,3) in-order on output token stream
+ * @param {string} type
+ * one of 'tag', 'text', 'newline', 'comment', 'end',
+ * 'martian' (unknown token), 'any' (any token, matched before other
matches).
+ * @param {string} name
+ * tag name for tags, omitted for non-tags
*/
TokenTransformManager.prototype.addTransform = function(transformation,
debugName, rank, type, name) {
var t = {
@@ -168,12 +173,14 @@
* Remove a transform registration
*
* @method
- * @param {Function} transform.
- * @param {Number} rank, [0,3) with [0,1) in-order on input token stream,
- * [1,2) out-of-order and [2,3) in-order on output token stream
- * @param {string} type, one of 'tag', 'text', 'newline', 'comment', 'end',
- * 'martian' (unknown token), 'any' (any token, matched before other matches).
- * @param {string} tag name for tags, omitted for non-tags
+ * @param {Number} rank
+ * [0,3) with [0,1) in-order on input token stream,
+ * [1,2) out-of-order and [2,3) in-order on output token stream
+ * @param {string} type
+ * one of 'tag', 'text', 'newline', 'comment', 'end',
+ * 'martian' (unknown token), 'any' (any token, matched before other
matches).
+ * @param {string} name
+ * tag name for tags, omitted for non-tags
*/
TokenTransformManager.prototype.removeTransform = function(rank, type, name) {
function removeMatchingTransform(transformers, rank) {
@@ -205,6 +212,7 @@
/**
* Get all transforms for a given token
+ * @private
*/
TokenTransformManager.prototype._getTransforms = function(token, minRank) {
var tkType =
TokenTransformManager.tkConstructorToTkTypeMap[token.constructor.name];
@@ -852,7 +860,7 @@
*
* @method
* @private
- * @param {Token[]}
+ * @param {Token[]} tokens
*/
SyncTokenTransformManager.prototype.onChunk = function(tokens) {
@@ -1291,7 +1299,7 @@
* Append tokens to an accumulator
*
* @method
- * @param {Token} token
+ * @param {Token[]} tokens
*/
TokenAccumulator.prototype.append = function(tokens) {
// Treat tokens append as a token-receive from a sibling
diff --git a/lib/mediawiki.Util.js b/lib/mediawiki.Util.js
index 9e5d5ab..95b6686 100644
--- a/lib/mediawiki.Util.js
+++ b/lib/mediawiki.Util.js
@@ -93,10 +93,10 @@
* @method
*
* Split a tracing / debugging flag string into individual flags
- * and assign them to an objFlags property.
+ * and return them.
*
- * @param {Object} objFlags The flags property to modify
- * @param {Object} opts The original flag string
+ * @param {Object} origFlag The original flag string
+ * @return {Array}
*/
splitFlags: function(origFlag) {
var objFlags = origFlag.split(",");
@@ -232,7 +232,9 @@
* This allows --debug=no and --debug=false to mean the same as
* --no-debug.
*
- * @param {Boolean} a boolean, or a string naming a boolean value.
+ * @param {boolean|string} val
+ * a boolean, or a string naming a boolean value.
+ * @return {boolean}
*/
booleanOption: function(val) {
if (!val) { return false; }
@@ -1314,7 +1316,7 @@
'---੯ੴ-ჱ-ẼẾ-\u200d-‒—-‗‚‛”--\ufffd\ufffd]+$');
/**
- * @method isLinkTrail
+ * @method
*
* Check whether some text is a valid link trail.
*
@@ -1330,7 +1332,7 @@
};
/**
- * @method stripPipeTrickChars
+ * @method
*
* Strip pipe trick chars off a link target
*
@@ -1338,7 +1340,7 @@
*
* Used by the LinkHandler and the WikitextSerializer.
*
- * @param {string} target
+ * @param {string} text The link target
* @return {string}
*/
Util.stripPipeTrickChars = function(text) {
@@ -1369,13 +1371,13 @@
};
/**
- * @method normalizeNamespaceName
+ * @method
*
* Cannonicalizes a namespace name.
*
* Used by WikiConfig.
*
- * @param {string} non-normalized namespace name
+ * @param {string} name non-normalized namespace name
* @return {string}
*/
Util.normalizeNamespaceName = function(name) {
@@ -1384,7 +1386,7 @@
/**
- * @method decodeEntity
+ * @method
*
* Decode HTML5 entities in text.
*
@@ -1397,7 +1399,7 @@
/**
- * @method escapeEntities
+ * @method
*
* Entity-escape anything that would decode to a valid HTML entity
*
diff --git a/lib/mediawiki.WikiConfig.js b/lib/mediawiki.WikiConfig.js
index ec39fc9..da1555c 100644
--- a/lib/mediawiki.WikiConfig.js
+++ b/lib/mediawiki.WikiConfig.js
@@ -19,10 +19,11 @@
* Per-wiki configuration object.
*
* @constructor
+ * @param {MWParserEnvironment} env
* @param {Object} resultConf The configuration object from a MediaWiki API
request. See the #ConfigRequest class in lib/mediawiki.ApiRequest.js for
information about how we get this object. If null, we use the contents of
lib/mediawiki.BaseConfig.json instead.
* @param {string} prefix The interwiki prefix this config will represent.
Will be used for caching elsewhere in the code.
* @param {string} apiURI The URI that represents this wiki's API endpoint.
Usually ends in api.php.
- * @param {string} apiProxy (optional) The proxy that should be used to access
apiURI.
+ * @param {string} [apiProxy] The proxy that should be used to access apiURI.
*/
function WikiConfig(env, resultConf, prefix, apiURI, apiProxy) {
var nsid, name;
diff --git a/lib/mediawiki.parser.defines.js b/lib/mediawiki.parser.defines.js
index e43a3e7..038d8d8 100644
--- a/lib/mediawiki.parser.defines.js
+++ b/lib/mediawiki.parser.defines.js
@@ -634,7 +634,7 @@
*
* @extends Token
* @constructor
- * @param {Array} The TSR of the newline(s).
+ * @param {Array} tsr The TSR of the newline(s).
*/
function NlTk(tsr) {
if (tsr) {
diff --git a/lib/mediawiki.parser.environment.js
b/lib/mediawiki.parser.environment.js
index e7fb009..e94d678 100644
--- a/lib/mediawiki.parser.environment.js
+++ b/lib/mediawiki.parser.environment.js
@@ -151,7 +151,7 @@
* "* ": // actual source text --> copied to this.page.src
* }
* }
- * @param {String|Object} page source or metadata
+ * @param {String|Object} srcOrMetadata page source or metadata
*/
MWParserEnvironment.prototype.setPageSrcInfo = function(srcOrMetadata) {
if (typeof (srcOrMetadata) === 'string' || srcOrMetadata === null) {
diff --git a/lib/mediawiki.tokenizer.peg.js b/lib/mediawiki.tokenizer.peg.js
index 9be7047..2457c86 100644
--- a/lib/mediawiki.tokenizer.peg.js
+++ b/lib/mediawiki.tokenizer.peg.js
@@ -37,6 +37,13 @@
PegTokenizer: null,
};
+/**
+ * @class
+ * @extends EventEmitter
+ * @constructor
+ * @param {MWParserEnvironment} env
+ * @param {Object} options
+ */
function PegTokenizer(env, options) {
events.EventEmitter.call(this);
this.env = env;
diff --git a/tests/parserTests.js b/tests/parserTests.js
index 72ca5b1..f84c30f 100755
--- a/tests/parserTests.js
+++ b/tests/parserTests.js
@@ -878,6 +878,7 @@
* @method
* @param {Object} item
* @param {Object} options
+ * @param {string} mode
* @param {Function} endCb
*/
ParserTests.prototype.processTest = function(item, options, mode, endCb) {
@@ -1051,7 +1052,7 @@
* @param {Object} item
* @param {Object} options
* @param {string} mode
- * @param {Node} doc
+ * @param {Node} body
* @param {Function} cb
*/
ParserTests.prototype.processParsedHTML = function(item, options, mode, body,
cb) {
@@ -1072,7 +1073,7 @@
* @param {Object} item
* @param {Object} options
* @param {string} mode
- * @param {Node} doc
+ * @param {string} wikitext
* @param {Function} cb
*/
ParserTests.prototype.processSerializedWT = function(item, options, mode,
wikitext, cb) {
@@ -1206,10 +1207,11 @@
/**
* @method
* @param {string} title
+ * @param {Object} options
* @param {string} mode
* @param {boolean} expectSuccess Whether this success was expected (or was
this test blacklisted?)
* @param {boolean} isWhitelist Whether this success was due to a whitelisting
- * @param {boolean} shouldReport Whether we should actually output this
result, or just count it
+ * @param {Object} item
*/
ParserTests.prototype.printSuccess = function(title, options, mode,
expectSuccess, isWhitelist, item) {
var quiet = booleanOption(options.quiet);
--
To view, visit https://gerrit.wikimedia.org/r/232183
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibfcab06e7a53eb0674c2e0e08fbcfb8bb7bf32d5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Cscott <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits