Check for numeric 0 when checking 'usecodeeditor' pref in JS

A recent core change caused zero-valued preferences to start being
returned as numeric 0 rather than string 0. See the linked bug for
details.

Bug: T161875
Change-Id: I183fd9944e65041b0a330725c41fec2b59ca8379
This commit is contained in:
Brad Jorsch 2017-03-31 08:57:28 -04:00 committed by Anomie
parent 9b6f81e832
commit fe072480d3

View file

@ -104,7 +104,8 @@
}
} );
context.codeEditorActive = mw.user.options.get( 'usecodeeditor' ) !== '0';
// Make sure to cast '0' to false
context.codeEditorActive = !!Number( mw.user.options.get( 'usecodeeditor' ) );
/**
* Internally used functions