Drupal.theme未解之谜

Drupal = {};
Drupal.theme = function (func) {
  console.log(arguments);
  var args = Array.prototype.slice.apply(arguments,['1']);
  console.log(args);
  return (Drupal.theme[func] || Drupal.theme.prototype[func]).apply(this, args);
};
Drupal.theme.prototype = {
  placeholder: function (str) {
    return '<em class="placeholder">' + str + '</em>';
  }
};
console.log('1111');
var a = Drupal.theme('placeholder', 'aaaa')
console.log(a);

为什么placeholder可以做为参数传到Drupal.theme里面
难以理解

原文地址:https://www.cnblogs.com/qinqiu/p/5088434.html