JavaScript aggregation_info function

A JavaScript equivalent of PHP’s aggregation_info
function aggregation_info (obj) {
  // http://kevin.vanzonneveld.net
  // +   original by: Brett Zamir (http://brett-zamir.me)
  // -    depends on: aggregate_info
  // *     example 1: var A = function () {};
  // *     example 1: A.prop = 5;
  // *     example 1: A.prototype.someMethod = function () {};
  // *     example 1: var b = {};
  // *     example 1: aggregate(b, 'A');
  // *     example 1: aggregation_info(b);
  // *     returns 1: {'A':{methods:['someMethod'], properties:['prop']}}

  return this.aggregate_info(obj);
}

Example 1
var A = function () {};
A.prop = 5;
A.prototype.someMethod = function () {};
var b = {};
aggregate(b, 'A');
aggregation_info(b);

Should return
{'A':{methods:['someMethod'], properties:['prop']}}
Теги:
aggregation_info
Добавлено: 27 Июля 2018 19:55:04 Добавил: Андрей Ковальчук Нравится 0
Добавить
Комментарии:
Нету комментариев для вывода...