At DefaultSettings.php#L3709, there is
if ( window.wgRestrictionEdit ) { ... }
and
if ( mw.config.exists('wgRestrictionEdit') ) { ... }
However this variable is an array, not a boolean (see T133289), so it should be checking the length of the array instead:
if ( mw.config.exists('wgRestrictionEdit').length ) { ... }