Verified Commit 480738f3 authored by Théodore Biadala's avatar Théodore Biadala
Browse files

Issue #3513443 by tom konda, smustgrave: Loose checking for calling JavaScript theme function

parent 679a1b2b
Loading
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -616,9 +616,13 @@ window.Drupal = { behaviors: {}, locale: {} };
   *   but also a complex object.
   */
  Drupal.theme = function (func, ...args) {
    if (func in Drupal.theme) {
    if (typeof Drupal.theme?.[func] === 'function') {
      return Drupal.theme[func](...args);
    }

    Drupal.throwError(
      new TypeError(`Drupal.theme.${func} must be function type.`),
    );
  };

  /**