<commit_before>'use strict';

var _ = require('lodash');
var util = require('util');

/**
 * The base metaclass constructor. The metaclass is used to build new classes.
 * The created classes can be used like normal classes, but they have an
 * associated metaclass prototype chain that makes them behave like objects
 * as well. For instance:
 *
 *     var Person = Class.extend();
 *     var Student = Class.extend();
 *
 *     var john = Person.create();
 *     var susan = Student.create();
 *
 * In this example, `john` is an instance of the `Person` class and `susan`
 * is an instance of the `Student` class. This is nothing new. The metaclasses,
 * however allow static methods:
 *
 *     Person.prototype.staticMethod = function() {};
 *     Student.staticMethod();
 *
 * These static methods are usually defined using {@link Class.reopenClass}.
 *
 * @private
 * @function Class~Meta
 */
var Meta = function() {};

Meta.prototype = Object.create(Function.prototype);
Meta.prototype.constructor = Meta;

/**
 * The identity class object. It's a basic identity property for any class. For
 * instance `Person.__identity__ === Person`, however it can be useful when
 * implementing static methods. In that case, `this.__identity__` will return
 * the class object on which the method was called. This property is also
 * available for instances of the created class.
 *
 * @name Class.__identity__
 * @public
 * @since 1.0
 */

/**
 * The super class object. This object is similar to
 * {@link Class.\_\_identity\_\_}, but gets the parent class object rather than
 * the current one. This property is also available for instances of the
 * created class.
 *
 * @name Class.__super__
 * @public
 * @since 1.0
 */

/**
 * The constructor used to create instances. This is different from
 * {@link Class.\_\_identity\_\_} in that it's not the class object, just a
 * normal function/constructor. This property is also available for instances
 * of the created class.
 *
 * @name Class.__class__
 * @public
 * @since 1.0
 */

/**
 * The class used to create class objects. This property is also available for
 * instances of the created class.
 *
 * @private
 * @name Class.__metaclass__
 */

/**
 * The underlying constructor for the instances of a class object. This type is
 * only used internally for clarifying documentation.
 *
 * @typedef {Function} ClassConstructor
 * @private
 */

/**
 * The underlying constructor for a class object. This type is only used
 * internally for clarifying documentation.
 *
 * @typedef {Function} MetaClassConstructor
 * @private
 */

var wrap = { super: {} };

/**
 * Wrap a function so it supports calling a super function.
 *
 * @name wrap.super.fn
 * @private
 * @param {Function} fn The function to wrap.
 * @param {Function} superFunction The super function that the wrapper
 * should call.
 * @return {Function} The wrapped function.
 */
wrap.super.fn = function(fn, superFunction) {
  var wrapper = function() {
    var result;
    var currentSuper = this && this.__superFunction;
    if (this) { this.__superFunction = superFunction; }
    result = fn.apply(this, arguments);
    if (this) { this.__superFunction = currentSuper; }
    return result;<commit_msg>Expecting that `this` will always be defined for methods using super.<commit_after>'use strict';

var _ = require('lodash');
var util = require('util');

/**
 * The base metaclass constructor. The metaclass is used to build new classes.
 * The created classes can be used like normal classes, but they have an
 * associated metaclass prototype chain that makes them behave like objects
 * as well. For instance:
 *
 *     var Person = Class.extend();
 *     var Student = Class.extend();
 *
 *     var john = Person.create();
 *     var susan = Student.create();
 *
 * In this example, `john` is an instance of the `Person` class and `susan`
 * is an instance of the `Student` class. This is nothing new. The metaclasses,
 * however allow static methods:
 *
 *     Person.prototype.staticMethod = function() {};
 *     Student.staticMethod();
 *
 * These static methods are usually defined using {@link Class.reopenClass}.
 *
 * @private
 * @function Class~Meta
 */
var Meta = function() {};

Meta.prototype = Object.create(Function.prototype);
Meta.prototype.constructor = Meta;

/**
 * The identity class object. It's a basic identity property for any class. For
 * instance `Person.__identity__ === Person`, however it can be useful when
 * implementing static methods. In that case, `this.__identity__` will return
 * the class object on which the method was called. This property is also
 * available for instances of the created class.
 *
 * @name Class.__identity__
 * @public
 * @since 1.0
 */

/**
 * The super class object. This object is similar to
 * {@link Class.\_\_identity\_\_}, but gets the parent class object rather than
 * the current one. This property is also available for instances of the
 * created class.
 *
 * @name Class.__super__
 * @public
 * @since 1.0
 */

/**
 * The constructor used to create instances. This is different from
 * {@link Class.\_\_identity\_\_} in that it's not the class object, just a
 * normal function/constructor. This property is also available for instances
 * of the created class.
 *
 * @name Class.__class__
 * @public
 * @since 1.0
 */

/**
 * The class used to create class objects. This property is also available for
 * instances of the created class.
 *
 * @private
 * @name Class.__metaclass__
 */

/**
 * The underlying constructor for the instances of a class object. This type is
 * only used internally for clarifying documentation.
 *
 * @typedef {Function} ClassConstructor
 * @private
 */

/**
 * The underlying constructor for a class object. This type is only used
 * internally for clarifying documentation.
 *
 * @typedef {Function} MetaClassConstructor
 * @private
 */

var wrap = { super: {} };

/**
 * Wrap a function so it supports calling a super function.
 *
 * @name wrap.super.fn
 * @private
 * @param {Function} fn The function to wrap.
 * @param {Function} superFunction The super function that the wrapper
 * should call.
 * @return {Function} The wrapped function.
 */
wrap.super.fn = function(fn, superFunction) {
  var wrapper = function() {
    var result;
    var currentSuper = this && this.__superFunction;
    this.__superFunction = superFunction;
    result = fn.apply(this, arguments);
    this.__superFunction = currentSuper;
    return result;
{'fraction_non_alphanumeric': 0.10452152369154537, 'fraction_numerical': 0.0018581604211830288, 'mean_word_length': 3.535814606741573, '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': '6566285', 'n_tokens_mistral': 1748, 'n_tokens_neox': 1716, 'n_words': 747}