Skip to content
Snippets Groups Projects
Verified Commit f1139711 authored by Théodore Biadala's avatar Théodore Biadala
Browse files

Issue #3487449 by tom konda: Prefer to replace some of typeof obj !==...

Issue #3487449 by tom konda: Prefer to replace some of typeof obj !== 'undefined' with optional chaining

(cherry picked from commit 1c33460a)
parent 695911c0
No related branches found
No related tags found
28 merge requests!12227Issue #3181946 by jonmcl, mglaman,!12079Issue #3523476 by matthiasm11: Add empty check on operator,!12024Fix: DocBlock comment for return value of Drupal\Core\Database\Connection::transactionManager(),!11974Draft: Issue #3495165 by catch, joeyroth, berdir, texas-bronius: Better warning...,!11934Issue #3520997: DefaultLazyPluginCollection unnecessarily instantiates plugins when sorting collection,!11887Issue #3520065: The migrate Row class API is incomplete,!11636Draft: Issue #3515643 by macsim: fieldNameExists method is inconsistent,!11515Issue #3480419 by mondrake, smustgrave, catch: Method...,!11380Issue #3490698 by catch, spokje: Bump MINIMUM_STABILITY back to 'stable' when...,!11281Use Drupal Core Leadership terminology in MAINTAINERS.txt,!11239Issue #3507548: Allow workspace changes listing to show all items, without a pager,!11238Fix issue #3051797,!11213Issue #3506743 by tomislav.matokovic: Increasing the color contrast for the navigation block title against the background of the navigation sidebar to at least 4.5:1,!11147Draft: Try to avoid manually setting required cache contexts,!11108Issue #3490298 by nicxvan: Profiles can be missed in OOP hooks,!11093Drupal on MongoDB 11.1.x,!11017Issue #3502540: Add date filter for moderated content.,!11009Issue #3486972 migrate feed icon,!10999Cleaning up Taxonomy hooks and updating baseline.,!10977Issue #3501457: Fix path used in a A11y Test Admin,!10881Issue #3489329 by mfb, casey: symfony/http-foundation commit 32310ff breaks PathValidator,!10570Issue #3494197: Convert Twig engine hooks,!10567Issue #3494154: Index is not added if entity doesn't support revisions,!10548Revert "Issue #3478621 by catch, longwave, nicxvan: Add filecache to OOP hook attribute parsing",!10404Margin has been added,!10391Issue #3485117 by nexusnovaz, godotislate, nicxvan: Fix return type on...,!10388Issue #3485117 by nexusnovaz, godotislate, nicxvan: Fix return type on...,!10376Issue #3485117 by nexusnovaz, godotislate, nicxvan: Fix return type on...
Pipeline #345204 passed
Pipeline: drupal

#345205

    ......@@ -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];
    }
    ......@@ -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]
    ......@@ -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}`);
    }
    };
    ......
    ......@@ -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;
    }
    ......
    ......@@ -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(
    ......
    ......@@ -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;
    }
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment