M module

Support.module:Class

Functions

Helper function to iterate through each prototype in the prototype chain TODO: move to support/object

Parameters

obj : Object

The object to traverse the prototype chain of

fn : function

Function to call for each prototype in the chain

Extends a class with a superclass and adds attributes

Parameters

name : string

The name for the new class

superClass : function

The class to extend from

newConstructor : function

The constructor function for the new class

staticAttributes : Object optional

Static attributes to add to the class

instanceAttributes : Object optional

Instance attributes to add to the class prototype

Returns

function

The extended class

Iterates over the prototype chain for a specified property in each prototype

Parameters

obj : Object

The object to climb the property chain with

key : string

The property name to find on each prototype

Returns

Array
  • An array consisting of the property for each prototype