Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 292371

Loose checking for calling JavaScript theme function

$
0
0

Problem/Motivation

JavaScript theme functions are defined on each library and Drupal.theme() checks property existence. But, a type of property value is not checked so that if a JavaScript theme function is defined other than function, tries to execute as function and occurs an error.

Drupal.theme.test = true;

Drupal.theme.test2 = function() {
	// Try to execute Drupal.theme.test() as a function but an error is occurred.
	return Drupal.theme('test', false);
}

Proposed resolution

Checks property value type using typeof operator.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 292371

Trending Articles