Loading core/misc/drupal.js +3 −15 Original line number Diff line number Diff line Loading @@ -370,12 +370,7 @@ window.Drupal = { behaviors: {}, locale: {} }; options.context = options.context || ''; // Fetch the localized version of the string. if ( typeof drupalTranslations !== 'undefined' && drupalTranslations.strings && drupalTranslations.strings[options.context] && drupalTranslations.strings[options.context][str] ) { if (drupalTranslations?.strings?.[options.context]?.[str]) { str = drupalTranslations.strings[options.context][str]; } Loading Loading @@ -518,10 +513,7 @@ window.Drupal = { behaviors: {}, locale: {} }; let index = 0; // Determine the index of the plural form. if ( typeof drupalTranslations !== 'undefined' && drupalTranslations.pluralFormula ) { if (drupalTranslations?.pluralFormula) { index = count in drupalTranslations.pluralFormula ? drupalTranslations.pluralFormula[count] Loading Loading @@ -562,11 +554,7 @@ window.Drupal = { behaviors: {}, locale: {} }; * @see https://www.drupal.org/core/deprecation#javascript */ Drupal.deprecationError = ({ message }) => { if ( drupalSettings.suppressDeprecationErrors === false && typeof console !== 'undefined' && console.warn ) { if (drupalSettings.suppressDeprecationErrors === false && console?.warn) { console.warn(`[Deprecation] ${message}`); } }; Loading core/modules/block/js/block.js +1 −4 Original line number Diff line number Diff line Loading @@ -78,10 +78,7 @@ Drupal.behaviors.blockDrag = { attach(context, settings) { // tableDrag is required and we should be on the blocks admin page. if ( typeof Drupal.tableDrag === 'undefined' || typeof Drupal.tableDrag.blocks === 'undefined' ) { if (typeof Drupal?.tableDrag?.blocks === 'undefined') { return; } Loading core/modules/system/tests/modules/js_testing_log_test/js/js_testing_log.js +1 −1 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ * Support code for testing JavaScript error handling in functional tests. */ (function () { if (typeof console !== 'undefined' && console.warn) { if (console?.warn) { const originalWarnFunction = console.warn; console.warn = (warning) => { const warnings = JSON.parse( Loading core/modules/views_ui/js/views-admin.js +1 −2 Original line number Diff line number Diff line Loading @@ -1332,8 +1332,7 @@ attach(context) { // Only act on the rearrange filter form. if ( typeof Drupal.tableDrag === 'undefined' || typeof Drupal.tableDrag['views-rearrange-filters'] === 'undefined' typeof Drupal?.tableDrag?.['views-rearrange-filters'] === 'undefined' ) { return; } Loading Loading
core/misc/drupal.js +3 −15 Original line number Diff line number Diff line Loading @@ -370,12 +370,7 @@ window.Drupal = { behaviors: {}, locale: {} }; options.context = options.context || ''; // Fetch the localized version of the string. if ( typeof drupalTranslations !== 'undefined' && drupalTranslations.strings && drupalTranslations.strings[options.context] && drupalTranslations.strings[options.context][str] ) { if (drupalTranslations?.strings?.[options.context]?.[str]) { str = drupalTranslations.strings[options.context][str]; } Loading Loading @@ -518,10 +513,7 @@ window.Drupal = { behaviors: {}, locale: {} }; let index = 0; // Determine the index of the plural form. if ( typeof drupalTranslations !== 'undefined' && drupalTranslations.pluralFormula ) { if (drupalTranslations?.pluralFormula) { index = count in drupalTranslations.pluralFormula ? drupalTranslations.pluralFormula[count] Loading Loading @@ -562,11 +554,7 @@ window.Drupal = { behaviors: {}, locale: {} }; * @see https://www.drupal.org/core/deprecation#javascript */ Drupal.deprecationError = ({ message }) => { if ( drupalSettings.suppressDeprecationErrors === false && typeof console !== 'undefined' && console.warn ) { if (drupalSettings.suppressDeprecationErrors === false && console?.warn) { console.warn(`[Deprecation] ${message}`); } }; Loading
core/modules/block/js/block.js +1 −4 Original line number Diff line number Diff line Loading @@ -78,10 +78,7 @@ Drupal.behaviors.blockDrag = { attach(context, settings) { // tableDrag is required and we should be on the blocks admin page. if ( typeof Drupal.tableDrag === 'undefined' || typeof Drupal.tableDrag.blocks === 'undefined' ) { if (typeof Drupal?.tableDrag?.blocks === 'undefined') { return; } Loading
core/modules/system/tests/modules/js_testing_log_test/js/js_testing_log.js +1 −1 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ * Support code for testing JavaScript error handling in functional tests. */ (function () { if (typeof console !== 'undefined' && console.warn) { if (console?.warn) { const originalWarnFunction = console.warn; console.warn = (warning) => { const warnings = JSON.parse( Loading
core/modules/views_ui/js/views-admin.js +1 −2 Original line number Diff line number Diff line Loading @@ -1332,8 +1332,7 @@ attach(context) { // Only act on the rearrange filter form. if ( typeof Drupal.tableDrag === 'undefined' || typeof Drupal.tableDrag['views-rearrange-filters'] === 'undefined' typeof Drupal?.tableDrag?.['views-rearrange-filters'] === 'undefined' ) { return; } Loading