Bug 1441019 - Migrate cookie module docs to RST. r?whimboo draft
authorAndreas Tolfsen <ato@sny.no>
Mon, 26 Feb 2018 10:34:00 +0000
changeset 759874 0cbafc0c0fc05dd592dbd5c58e863c1d4597f488
parent 759873 985f13094ba1b93cc36e3412c445afea3de9b891
child 759875 de1c6aacd047b22d717b16c09c36d4df5fdae1c4
push id100500
push userbmo:ato@sny.no
push dateMon, 26 Feb 2018 19:31:26 +0000
reviewerswhimboo
bugs1441019
milestone60.0a1
Bug 1441019 - Migrate cookie module docs to RST. r?whimboo MozReview-Commit-ID: 7qGfHLoQ9At
testing/marionette/cookie.js
--- a/testing/marionette/cookie.js
+++ b/testing/marionette/cookie.js
@@ -26,27 +26,27 @@ this.cookie = {
  * @name Cookie
  *
  * @return {Object.<string, (number|boolean|string)>
  */
 
 /**
  * Unmarshal a JSON Object to a cookie representation.
  *
- * Effectively this will run validation checks on |json|, which will
- * produce the errors expected by WebDriver if the input is not valid.
+ * Effectively this will run validation checks on ``json``, which
+ * will produce the errors expected by WebDriver if the input is
+ * not valid.
  *
  * @param {Object.<string, (number|boolean|string)>} json
- *     Cookie to be deserialised. <var>name</var> and <var>value</var>
- *     are required fields which must be strings. The <var>path</var> and
- *     <var>domain</var> fields are optional, but must be a string if
- *     provided.
- *     The <var>secure</var>, and <var>httpOnly</var> are similarly
- *     optional, but must be booleans. Likewise, the <var>expiry</var> field
- *     is optional but must be unsigned integer.
+ *     Cookie to be deserialised. ``name`` and ``value`` are required
+ *     fields which must be strings.  The ``path`` and ``domain`` fields
+ *     are optional, but must be a string if provided.  The ``secure``,
+ *     and ``httpOnly`` are similarly optional, but must be booleans.
+ *     Likewise, the ``expiry`` field is optional but must be
+ *     unsigned integer.
  *
  * @return {Cookie}
  *     Valid cookie object.
  *
  * @throws {InvalidArgumentError}
  *     If any of the properties are invalid.
  */
 cookie.fromJSON = function(json) {
@@ -77,24 +77,24 @@ cookie.fromJSON = function(json) {
 };
 
 /**
  * Insert cookie to the cookie store.
  *
  * @param {Cookie} newCookie
  *     Cookie to add.
  * @param {string=} restrictToHost
- *     Perform test that <var>newCookie</var>'s domain matches this.
+ *     Perform test that ``newCookie``'s domain matches this.
  *
  * @throws {TypeError}
- *     If <var>name</var>, <var>value</var>, or <var>domain</var> are
- *     not present and of the correct type.
+ *     If ``name``, ``value``, or ``domain`` are not present and
+ *     of the correct type.
  * @throws {InvalidCookieDomainError}
- *     If <var>restrictToHost</var> is set and <var>newCookie</var>'s
- *     domain does not match.
+ *     If ``restrictToHost`` is set and ``newCookie``'s domain does
+ *     not match.
  * @throws {UnableToSetCookieError}
  *     If an error occurred while trying to save the cookie.
  */
 cookie.add = function(newCookie, {restrictToHost = null} = {}) {
   assert.string(newCookie.name, "Cookie name must be string");
   assert.string(newCookie.value, "Cookie value must be string");
 
   if (typeof newCookie.path == "undefined") {
@@ -185,26 +185,25 @@ cookie.remove = function(toDelete) {
       toDelete.domain,
       toDelete.name,
       toDelete.path,
       false,
       {} /* originAttributes */);
 };
 
 /**
- * Iterates over the cookies for the current <var>host</var>.  You may
- * optionally filter for specific paths on that <var>host</var> by
- * specifying a path in <var>currentPath</var>.
+ * Iterates over the cookies for the current ``host``.  You may
+ * optionally filter for specific paths on that ``host`` by specifying
+ * a path in ``currentPath``.
  *
  * @param {string} host
  *     Hostname to retrieve cookies for.
  * @param {string=} [currentPath="/"] currentPath
- *     Optionally filter the cookies for <var>host</var> for the
- *     specific path.  Defaults to "<tt>/</tt>", meaning all cookies
- *     for <var>host</var> are included.
+ *     Optionally filter the cookies for ``host`` for the specific path.
+ *     Defaults to ``/``, meaning all cookies for ``host`` are included.
  *
  * @return {Iterable.<Cookie>}
  *     Iterator.
  */
 cookie.iter = function* (host, currentPath = "/") {
   assert.string(host, "host must be string");
   assert.string(currentPath, "currentPath must be string");