mediawiki.user: Fix missing array initialization in generateRandomSessionId
authorTimo Tijhof <krinklemail@gmail.com>
Fri, 31 Aug 2018 19:44:17 +0000 (20:44 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Sat, 1 Sep 2018 00:13:30 +0000 (01:13 +0100)
commit49f95250b754c7603d5414ba198fdda7cf47546e
treead8399231177049f6672703ddfa54595cda41cc7
parent34d866d7e4041f2320e440cd6701871a1baac121
mediawiki.user: Fix missing array initialization in generateRandomSessionId

Array was not properly initialized and thus browsers
that do not support Crypto API where displaying an error
on console.

The tests failed to catch this because assigning window.crypto
to `undefined` does not work (it is a read-only property). This
"fallback" test was actually testing the regular Crypto-based path
a second time.

Bug: T203275
Co-Authored-By: Timo Tijhof <krinklemail@gmail.com>
Change-Id: I8feecddf0878a739e560085f7897ebc3d8100c02
resources/src/mediawiki.user.js
tests/qunit/suites/resources/mediawiki/mediawiki.user.test.js