<commit_before># Joint

Joint abstract class.
A Joint represents a node in the hierarchy.


## on()
`public method` _on(event, fn, [context])_

Adds a listener for an upcast or broadcast event.
Duplicate listeners for the same event will be discarded.

**Parameters**   
event:String - The event name.   
fn:Function - The handler.   
context:Object (optional) - The context to be used to call the handler, defaults to the joint instance.

**Returns**   
Joint - The instance itself to allow chaining.


## once()
`public method` _once(event, fn, [context])_

Adds a one time listener for an upcast or broadcast event.
Duplicate listeners for the same event will be discarded.

**Parameters**   
event:String - The event name.   
fn:Function - The handler.   
context:Object (optional) - The context to be used to call the handler, defaults to the joint instance.

**Returns**   
Joint - The instance itself to allow chaining.


## off()
`public method` _off(event, fn, [context])_

Removes a previously added listener.

**Parameters**   
event:String - The event name.   
fn:Function - The handler.   
context:Object (optional) - The context passed to the on() method.

**Returns**   
Joint - The instance itself to allow chaining.


## destroy()
`public method` _destroy()_

Destroys the instance, releasing all of its resources.
Note that all downlinks will also be destroyed.


## _link()
`protected method` __link(joint)_

Creates a link between this joint and another one.

**Parameters**   
joint:Joint - Another joint to link to this one.

**Returns**   
Joint - The joint passed in as the argument.


## _unlink()
`protected method` __unlink(joint)_

Removes a previously created link between a joint and another one.

**Parameters**   
joint:Joint - Another joint to link to this one.

**Returns**   
Joint - The instance itself to allow chaining.


## _upcast()
`protected method` __upcast(event, [args])_

Fires an event upwards the chain.

**Parameters**   
event:String - The event name.   
args:...mixed (optional) - The arguments to pass along with the event.

**Returns**   
Joint - The instance itself to allow chaining.


## _broadcast()
`protected method` __broadcast(event, [args])_

Fires an event to all the joints.

**Parameters**   
event:String - The event name.   
args:...mixed (optional) - The arguments to pass along with the event.

**Returns**   
Joint - The instance itself to allow chaining.


## _onDestroy()
`protected method` __onDestroy()_

Method called after calling destroy().
Subclasses should override this method to release additional resources.   
The default implementation will also destroy any linked joints.
<commit_msg>Tweak joint md.<commit_after># Joint

A Joint represents a node in the hierarchy.


## on()

`public method` _on(event, fn, [context])_

Adds a listener for an upcast or broadcast event.   
Duplicate listeners for the same event will be discarded.

**Parameters**:

- event:String - The event name.   
- fn:Function - The handler.   
- context:Object (optional) - The context to be used to call the handler, defaults to the joint instance.

**Returns**   
Joint - The instance itself to allow chaining.


## once()

`public method` _once(event, fn, [context])_

Adds a one time listener for an upcast or broadcast event.   
Duplicate listeners for the same event will be discarded.

**Parameters**:

- event:String - The event name.   
- fn:Function - The handler.   
- context:Object (optional) - The context to be used to call the handler, defaults to the joint instance.

**Returns**   
Joint - The instance itself to allow chaining.


## off()

`public method` _off(event, fn, [context])_

Removes a previously added listener.

**Parameters**:

- event:String - The event name.   
- fn:Function - The handler.   
- context:Object (optional) - The context passed to the on() method.

**Returns**   
Joint - The instance itself to allow chaining.


## destroy()

`public method` _destroy()_

Destroys the instance, releasing all of its resources.   
Note that all downlinks will also be destroyed.

Internally calls `_onDestroy()` only once, even on consecutive calls to `destroy()`.


## _link()
`protected method` __link(joint)_

Creates a link between this joint and another one.

**Parameters**:

- joint:Joint - Another joint to link to this one.

**Returns**   
Joint - The joint passed in as the argument.


## _unlink()

`protected method` __unlink(joint)_

Removes a previously created link between a joint and another one.

**Parameters**:
- joint:Joint - Another joint to link to this one.

**Returns**   
Joint - The instance itself to allow chaining.


## _upcast()

`protected method` __upcast(event, [args])_

Fires an event upwards the chain.

**Parameters**:

- event:String - The event name.   
- args:...mixed (optional) - The arguments to pass along with the event.

**Returns**   
Joint - The instance itself to allow chaining.


## _broadcast()

`protected method` __broadcast(event, [args])_

Fires an event to all the joints.

**Parameters**:

- event:String - The event name.   
- args:...mixed (optional) - The arguments to pass along with the event.

**Returns**   
Joint - The instance itself to allow chaining.


## _onDestroy()

`protected method` __onDestroy()_

Method called after calling destroy().
Subclasses should override this method to release additional resources.   
The default implementation will also destroy any linked joints.

{'fraction_non_alphanumeric': 0.09700532794414844, 'fraction_numerical': 0.0, 'mean_word_length': 3.7545851528384278, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4300265', 'n_tokens_mistral': 1568, 'n_tokens_neox': 1511, 'n_words': 694}