mediawiki.cookie: Remove false documentation for options.expiry as number
authorTimo Tijhof <krinklemail@gmail.com>
Fri, 23 Jan 2015 00:35:26 +0000 (16:35 -0800)
committerBartosz Dziewoński <matma.rex@gmail.com>
Fri, 23 Jan 2015 02:18:41 +0000 (02:18 +0000)
Follows-up 7c585b5. There was never an implementation for
supporting an offset from now in seconds. The code and tests
account for no such thing.

When passed a number, it will actually end up being passed to
$.cookie, which interprets it as an offset in days (!).

Change-Id: I5d8ed8cb432ca550c62cf415077ffffd91fe2bbd

resources/src/mediawiki/mediawiki.cookie.js
tests/qunit/suites/resources/mediawiki/mediawiki.cookie.test.js

index 6f9f0ab..1b86b61 100644 (file)
@@ -30,8 +30,7 @@
                 * @param {Date|null} [options.expires=wgCookieExpiration] The expiry date of the cookie.
                 *
                 *   Default cookie expiration is based on `wgCookieExpiration`.  If `wgCookieExpiration` is
-                *   0, a session cookie is set (expires when the browser is closed). For non-zero values of
-                *   `wgCookieExpiration`, the cookie expires `wgCookieExpiration` seconds from now.
+                *   0, a session cookie is set (expires when the browser is closed).
                 *
                 *   If options.expires is null, then a session cookie is set.
                 * @param {string} [options.prefix=wgCookiePrefix] The prefix of the key
index c9653da..c6aa3b7 100644 (file)
                assert.strictEqual( key, 'barfoo' );
        } );
 
-} ( mediaWiki, jQuery ) );
+}( mediaWiki, jQuery ) );