[lodash-mixins] switch _(Class).inherits(Super) to new _.class mixin

This commit is contained in:
Spencer Alger 2015-06-10 15:02:01 -07:00
parent 5f7bca9f6a
commit 6331a24a70
54 changed files with 78 additions and 79 deletions

View file

@ -650,7 +650,7 @@ While you can do it with pure JS, a utility will remove a lot of boilerplate, an
```js
// uses a lodash inherits mixin
// inheritance is defined first - it's easier to read and the function will be hoisted
_(Square).inherits(Shape);
_.class(Square).inherits(Shape);
function Square(width, height) {
Square.Super.call(this);

View file

@ -7,7 +7,7 @@ define(function (require) {
var AggConfigResult = require('components/vis/_agg_config_result');
_(SplitAcr).inherits(AggConfigResult);
_.class(SplitAcr).inherits(AggConfigResult);
function SplitAcr(agg, parent, key) {
SplitAcr.Super.call(this, agg, parent, key, key);
}

View file

@ -26,7 +26,7 @@ define(function (require) {
* @extends IndexedArray
* @param {object[]} params - array of params that get new-ed up as AggParam objects as descibed above
*/
_(AggParams).inherits(IndexedArray);
_.class(AggParams).inherits(IndexedArray);
function AggParams(params) {
AggParams.Super.call(this, {
index: ['name'],

View file

@ -3,7 +3,7 @@ define(function (require) {
var _ = require('lodash');
var AggType = Private(require('components/agg_types/_agg_type'));
_(BucketAggType).inherits(AggType);
_.class(BucketAggType).inherits(AggType);
function BucketAggType(config) {
BucketAggType.Super.call(this, config);

View file

@ -4,7 +4,7 @@ define(function (require) {
var AggType = Private(require('components/agg_types/_agg_type'));
var fieldFormats = Private(require('registry/field_formats'));
_(MetricAggType).inherits(AggType);
_.class(MetricAggType).inherits(AggType);
function MetricAggType(config) {
MetricAggType.Super.call(this, config);

View file

@ -6,7 +6,7 @@ define(function (require) {
var BaseAggParam = Private(require('components/agg_types/param_types/base'));
var SavedObjectNotFound = require('errors').SavedObjectNotFound;
_(FieldAggParam).inherits(BaseAggParam);
_.class(FieldAggParam).inherits(BaseAggParam);
function FieldAggParam(config) {
FieldAggParam.Super.call(this, config);
}

View file

@ -5,7 +5,7 @@ define(function (require) {
var IndexedArray = require('utils/indexed_array/index');
var BaseAggParam = Private(require('components/agg_types/param_types/base'));
_(OptionedAggParam).inherits(BaseAggParam);
_.class(OptionedAggParam).inherits(BaseAggParam);
function OptionedAggParam(config) {
OptionedAggParam.Super.call(this, config);

View file

@ -5,7 +5,7 @@ define(function (require) {
var BaseAggParam = Private(require('components/agg_types/param_types/base'));
var editorHtml = require('text!components/agg_types/controls/raw_json.html');
_(RawJSONAggParam).inherits(BaseAggParam);
_.class(RawJSONAggParam).inherits(BaseAggParam);
function RawJSONAggParam(config) {
// force name override
config = _.defaults(config, { name: 'json' });

View file

@ -5,7 +5,7 @@ define(function (require) {
var BaseAggParam = Private(require('components/agg_types/param_types/base'));
var editorHtml = require('text!components/agg_types/controls/regular_expression.html');
_(RegexAggParam).inherits(BaseAggParam);
_.class(RegexAggParam).inherits(BaseAggParam);
function RegexAggParam(config) {
// Java RegExp flags
var flags = [

View file

@ -5,7 +5,7 @@ define(function (require) {
var editorHtml = require('text!components/agg_types/controls/string.html');
var BaseAggParam = Private(require('components/agg_types/param_types/base'));
_(ScriptAggParam).inherits(BaseAggParam);
_.class(ScriptAggParam).inherits(BaseAggParam);
function ScriptAggParam(config) {
ScriptAggParam.Super.call(this, config);
}

View file

@ -6,7 +6,7 @@ define(function (require) {
var SourceAbstract = Private(require('components/courier/data_source/_abstract'));
var DocRequest = Private(require('components/courier/fetch/request/doc'));
_(DocSource).inherits(SourceAbstract);
_.class(DocSource).inherits(SourceAbstract);
function DocSource(initialState) {
DocSource.Super.call(this, initialState);
}

View file

@ -8,7 +8,7 @@ define(function (require) {
var SegmentedRequest = Private(require('components/courier/fetch/request/segmented'));
var normalizeSortRequest = Private(require('components/courier/data_source/_normalize_sort_request'));
_(SearchSource).inherits(SourceAbstract);
_.class(SearchSource).inherits(SourceAbstract);
function SearchSource(initialState) {
SearchSource.Super.call(this, initialState);
}

View file

@ -14,7 +14,7 @@ define(function (require) {
*
* @param {SegmentedRequest} - req - the requst this handle relates to
*/
_(SegmentedHandle).inherits(Events);
_.class(SegmentedHandle).inherits(Events);
function SegmentedHandle(req) {
SegmentedHandle.Super.call(this);

View file

@ -5,7 +5,7 @@ define(function (require) {
var docStrategy = Private(require('components/courier/fetch/strategy/doc'));
var AbstractRequest = Private(require('components/courier/fetch/request/request'));
_(DocRequest).inherits(AbstractRequest);
_.class(DocRequest).inherits(AbstractRequest);
function DocRequest(source, defer) {
DocRequest.Super.call(this, source, defer);

View file

@ -5,7 +5,7 @@ define(function (require) {
var searchStrategy = Private(require('components/courier/fetch/strategy/search'));
var AbstractRequest = Private(require('components/courier/fetch/request/request'));
_(SearchReq).inherits(AbstractRequest);
_.class(SearchReq).inherits(AbstractRequest);
var Super = SearchReq.Super;
function SearchReq(source, defer) {
Super.call(this, source, defer);

View file

@ -9,7 +9,7 @@ define(function (require) {
location: 'Segmented Fetch'
});
_(SegmentedReq).inherits(SearchReq);
_.class(SegmentedReq).inherits(SearchReq);
function SegmentedReq(source, defer, initFn) {
SearchReq.call(this, source, defer);

View file

@ -1,7 +1,6 @@
define(function (require) {
var _ = require('lodash');
var angular = require('angular');
var inherits = require('lodash').inherits;
var canStack = (function () {
var err = new Error();
@ -24,7 +23,7 @@ define(function (require) {
}
}
errors.KbnError = KbnError;
inherits(KbnError, Error);
_.class(KbnError).inherits(Error);
/**
* HastyRefresh error class
@ -35,7 +34,7 @@ define(function (require) {
'Courier attempted to start a query before the previous had finished.',
errors.HastyRefresh);
};
inherits(errors.HastyRefresh, KbnError);
_.class(errors.HastyRefresh).inherits(KbnError);
/**
* SearchTimeout error class
@ -45,7 +44,7 @@ define(function (require) {
'All or part of your request has timed out. The data shown may be incomplete.',
errors.SearchTimeout);
};
inherits(errors.SearchTimeout, KbnError);
_.class(errors.SearchTimeout).inherits(KbnError);
/**
* Request Failure - When an entire mutli request fails
@ -62,7 +61,7 @@ define(function (require) {
this.origError = err;
this.resp = resp;
};
inherits(errors.RequestFailure, KbnError);
_.class(errors.RequestFailure).inherits(KbnError);
/**
* FetchFailure Error - when there is an error getting a doc or search within
@ -76,7 +75,7 @@ define(function (require) {
this.resp = resp;
};
inherits(errors.FetchFailure, KbnError);
_.class(errors.FetchFailure).inherits(KbnError);
/**
* ShardFailure Error - when one or more shards fail
@ -88,7 +87,7 @@ define(function (require) {
this.resp = resp;
};
inherits(errors.ShardFailure, KbnError);
_.class(errors.ShardFailure).inherits(KbnError);
/**
@ -102,7 +101,7 @@ define(function (require) {
this.resp = resp;
};
inherits(errors.VersionConflict, KbnError);
_.class(errors.VersionConflict).inherits(KbnError);
/**
@ -114,7 +113,7 @@ define(function (require) {
'Field "' + field + '" is defined with at least two different types in indices matching the pattern',
errors.MappingConflict);
};
inherits(errors.MappingConflict, KbnError);
_.class(errors.MappingConflict).inherits(KbnError);
/**
* a field mapping was using a restricted fields name
@ -126,7 +125,7 @@ define(function (require) {
KbnError.call(this, msg, errors.RestrictedMapping);
};
inherits(errors.RestrictedMapping, KbnError);
_.class(errors.RestrictedMapping).inherits(KbnError);
/**
* a non-critical cache write to elasticseach failed
@ -136,7 +135,7 @@ define(function (require) {
'A Elasticsearch cache write has failed.',
errors.CacheWriteFailure);
};
inherits(errors.CacheWriteFailure, KbnError);
_.class(errors.CacheWriteFailure).inherits(KbnError);
/**
* when a field mapping is requested for an unknown field
@ -147,7 +146,7 @@ define(function (require) {
'The ' + name + ' field was not found in the cached mappings',
errors.FieldNotFoundInCache);
};
inherits(errors.FieldNotFoundInCache, KbnError);
_.class(errors.FieldNotFoundInCache).inherits(KbnError);
/**
* when a mapping already exists for a field the user is attempting to add
@ -158,7 +157,7 @@ define(function (require) {
'The "' + name + '" field already exists in this mapping',
errors.DuplicateField);
};
inherits(errors.DuplicateField, KbnError);
_.class(errors.DuplicateField).inherits(KbnError);
/**
* A saved object was not found
@ -172,7 +171,7 @@ define(function (require) {
'Could not locate that ' + type + idMsg,
errors.SavedObjectNotFound);
};
inherits(errors.SavedObjectNotFound, KbnError);
_.class(errors.SavedObjectNotFound).inherits(KbnError);
/**
* Tried to call a method that relies on SearchSource having an indexPattern assigned
@ -182,7 +181,7 @@ define(function (require) {
'IndexPattern\'s configured pattern does not match any indices',
errors.IndexPatternMissingIndices);
};
inherits(errors.IndexPatternMissingIndices, KbnError);
_.class(errors.IndexPatternMissingIndices).inherits(KbnError);
/**
* Tried to call a method that relies on SearchSource having an indexPattern assigned
@ -192,7 +191,7 @@ define(function (require) {
'Define at least one index pattern to continue',
errors.NoDefinedIndexPatterns);
};
inherits(errors.NoDefinedIndexPatterns, KbnError);
_.class(errors.NoDefinedIndexPatterns).inherits(KbnError);
/**
@ -203,7 +202,7 @@ define(function (require) {
'Please specify a default index pattern',
errors.NoDefaultIndexPattern);
};
inherits(errors.NoDefaultIndexPattern, KbnError);
_.class(errors.NoDefaultIndexPattern).inherits(KbnError);
/**
@ -215,7 +214,7 @@ define(function (require) {
'This container is too small to render the visualization',
errors.ContainerTooSmall);
};
inherits(errors.ContainerTooSmall, KbnError);
_.class(errors.ContainerTooSmall).inherits(KbnError);
/**
* error thrown when user tries to render an chart with less
@ -225,7 +224,7 @@ define(function (require) {
errors.NotEnoughData = function NotEnoughData(message) {
KbnError.call(this, message, errors.NotEnoughData);
};
inherits(errors.NotEnoughData, KbnError);
_.class(errors.NotEnoughData).inherits(KbnError);
/**
* error thrown when no results are returned from an elasticsearch query
@ -235,7 +234,7 @@ define(function (require) {
'No results found',
errors.NoResults);
};
inherits(errors.NoResults, KbnError);
_.class(errors.NoResults).inherits(KbnError);
/**
* error thrown when no results are returned from an elasticsearch query
@ -245,7 +244,7 @@ define(function (require) {
'No results displayed because all values equal 0',
errors.PieContainsAllZeros);
};
inherits(errors.PieContainsAllZeros, KbnError);
_.class(errors.PieContainsAllZeros).inherits(KbnError);
/**
* error thrown when no results are returned from an elasticsearch query
@ -255,7 +254,7 @@ define(function (require) {
'Values less than 1 cannot be displayed on a log scale',
errors.InvalidLogScaleValues);
};
inherits(errors.InvalidLogScaleValues, KbnError);
_.class(errors.InvalidLogScaleValues).inherits(KbnError);
/** error thrown when wiggle chart is selected for non linear data */
errors.InvalidWiggleSelection = function InvalidWiggleSelection() {
@ -263,7 +262,7 @@ define(function (require) {
'In wiggle mode the area chart requires ordered values on the x-axis. Try using a Histogram or Date Histogram aggregation.',
errors.InvalidWiggleSelection);
};
inherits(errors.InvalidWiggleSelection, KbnError);
_.class(errors.InvalidWiggleSelection).inherits(KbnError);
return errors;
});

View file

@ -4,7 +4,7 @@ define(function (require) {
var IndexedArray = require('utils/indexed_array/index');
var _ = require('lodash');
_(FieldList).inherits(IndexedArray);
_.class(FieldList).inherits(IndexedArray);
function FieldList(indexPattern, specs) {
FieldList.Super.call(this, {
index: ['name'],

View file

@ -8,7 +8,7 @@ define(function (require) {
}());
// abstract error class
_(KibanaError).inherits(Error);
_.class(KibanaError).inherits(Error);
function KibanaError(msg, constructor) {
this.message = msg;
@ -65,7 +65,7 @@ define(function (require) {
'Unable to load ' + modules + ' because of ' + explain + '.',
errors.ScriptLoadFailure);
};
_(errors.ScriptLoadFailure).inherits(KibanaError);
_.class(errors.ScriptLoadFailure).inherits(KibanaError);
return errors;
});

View file

@ -11,7 +11,7 @@ define(function (require) {
var MOUSE_EVENTS = 'mouseup';
var WINDOW_EVENTS = 'resize';
_(ReflowWatcher).inherits(EventEmitter);
_.class(ReflowWatcher).inherits(EventEmitter);
/**
* Watches global activity which might hint at a change in the content, which
* in turn provides a hint to resizers that they should check their size

View file

@ -8,7 +8,7 @@ define(function (require) {
var State = Private(require('components/state_management/state'));
_(AppState).inherits(State);
_.class(AppState).inherits(State);
function AppState(defaults) {
AppState.Super.call(this, urlParam, defaults);
getAppState._set(this);

View file

@ -9,7 +9,7 @@ define(function (require) {
module.service('globalState', function (Private, $rootScope, $location) {
var State = Private(require('components/state_management/state'));
_(GlobalState).inherits(State);
_.class(GlobalState).inherits(State);
function GlobalState(defaults) {
GlobalState.Super.call(this, '_g', defaults);
}

View file

@ -8,7 +8,7 @@ define(function (require) {
return function StateProvider(Notifier, Private, $rootScope, $location) {
var Events = Private(require('factories/events'));
_(State).inherits(Events);
_.class(State).inherits(Events);
function State(urlParam, defaults) {
State.Super.call(this);

View file

@ -7,7 +7,7 @@ define(function (require) {
require('components/field_format_editor/pattern/pattern');
_(DateTime).inherits(FieldFormat);
_.class(DateTime).inherits(FieldFormat);
function DateTime(params) {
DateTime.Super.call(this, params);
}

View file

@ -3,7 +3,7 @@ define(function (require) {
var _ = require('lodash');
var FieldFormat = Private(require('components/index_patterns/_field_format/FieldFormat'));
_(Ip).inherits(FieldFormat);
_.class(Ip).inherits(FieldFormat);
function Ip(params) {
Ip.Super.call(this, params);
}

View file

@ -6,7 +6,7 @@ define(function (require) {
var template = _.template(noWhiteSpace(require('text!components/stringify/types/_source.html')));
var angular = require('angular');
_(Source).inherits(FieldFormat);
_.class(Source).inherits(FieldFormat);
function Source(params) {
Source.Super.call(this, params);
}

View file

@ -5,7 +5,7 @@ define(function (require) {
require('components/field_format_editor/samples/samples');
_(_String).inherits(FieldFormat);
_.class(_String).inherits(FieldFormat);
function _String(params) {
_String.Super.call(this, params);
}

View file

@ -5,7 +5,7 @@ define(function (require) {
var FieldFormat = Private(require('components/index_patterns/_field_format/FieldFormat'));
require('components/field_format_editor/pattern/pattern');
_(Url).inherits(FieldFormat);
_.class(Url).inherits(FieldFormat);
function Url(params) {
Url.Super.call(this, params);
this._compileTemplate = _.memoize(this._compileTemplate);

View file

@ -6,7 +6,7 @@ define(function (require) {
var numeral = require('numeral')();
require('components/field_format_editor/numeral/numeral');
_(Numeral).inherits(FieldFormat);
_.class(Numeral).inherits(FieldFormat);
function Numeral(params) {
Numeral.Super.call(this, params);
}
@ -23,7 +23,7 @@ define(function (require) {
Numeral.factory = function (opts) {
_(Class).inherits(Numeral);
_.class(Class).inherits(Numeral);
function Class(params) {
Class.Super.call(this, params);
}

View file

@ -17,7 +17,7 @@
return obj.isValid() ? obj : stringTime;
}
_(Timefilter).inherits(Events);
_.class(Timefilter).inherits(Events);
function Timefilter() {
Timefilter.Super.call(this);

View file

@ -6,7 +6,7 @@ define(function (require) {
AggConfig.aggTypes = Private(require('components/agg_types/index'));
_(AggConfigs).inherits(IndexedArray);
_.class(AggConfigs).inherits(IndexedArray);
function AggConfigs(vis, configStates) {
var self = this;
self.vis = vis;

View file

@ -13,7 +13,7 @@ define(function (require) {
* @param handler {Object} Reference to Handler Class Object
*/
_(Dispatch).inherits(SimpleEmitter);
_.class(Dispatch).inherits(SimpleEmitter);
function Dispatch(handler) {
if (!(this instanceof Dispatch)) {
return new Dispatch(handler);

View file

@ -24,7 +24,7 @@ define(function (require) {
* @class ResizeChecker
* @param {HtmlElement} el - the element to track the size of
*/
_(ResizeChecker).inherits(EventEmitter);
_.class(ResizeChecker).inherits(EventEmitter);
function ResizeChecker(el) {
ResizeChecker.Super.call(this);

View file

@ -17,7 +17,7 @@ define(function (require) {
* @param $el {HTMLElement} jQuery selected HTML element
* @param config {Object} Parameters that define the chart type and chart options
*/
_(Vis).inherits(Events);
_.class(Vis).inherits(Events);
function Vis($el, config) {
if (!(this instanceof Vis)) {
return new Vis($el, config);

View file

@ -6,7 +6,7 @@ define(function (require) {
var Tooltip = Private(require('components/vislib/components/tooltip/tooltip'));
var touchdownTmpl = _.template(require('text!components/vislib/partials/touchdown.tmpl.html'));
_(PointSeriesChart).inherits(Chart);
_.class(PointSeriesChart).inherits(Chart);
function PointSeriesChart(handler, chartEl, chartData) {
if (!(this instanceof PointSeriesChart)) {
return new PointSeriesChart(handler, chartEl, chartData);

View file

@ -19,7 +19,7 @@ define(function (require) {
* @param chartData {Object} Elasticsearch query results for this specific
* chart
*/
_(AreaChart).inherits(PointSeriesChart);
_.class(AreaChart).inherits(PointSeriesChart);
function AreaChart(handler, chartEl, chartData) {
if (!(this instanceof AreaChart)) {
return new AreaChart(handler, chartEl, chartData);

View file

@ -21,7 +21,7 @@ define(function (require) {
* @param el {HTMLElement} HTML element to which the chart will be appended
* @param chartData {Object} Elasticsearch query results for this specific chart
*/
_(ColumnChart).inherits(PointSeriesChart);
_.class(ColumnChart).inherits(PointSeriesChart);
function ColumnChart(handler, chartEl, chartData) {
if (!(this instanceof ColumnChart)) {
return new ColumnChart(handler, chartEl, chartData);

View file

@ -18,7 +18,7 @@ define(function (require) {
* @param el {HTMLElement} HTML element to which the chart will be appended
* @param chartData {Object} Elasticsearch query results for this specific chart
*/
_(LineChart).inherits(PointSeriesChart);
_.class(LineChart).inherits(PointSeriesChart);
function LineChart(handler, chartEl, chartData) {
if (!(this instanceof LineChart)) {
return new LineChart(handler, chartEl, chartData);

View file

@ -17,7 +17,7 @@ define(function (require) {
* @param el {HTMLElement} HTML element to which the chart will be appended
* @param chartData {Object} Elasticsearch query results for this specific chart
*/
_(PieChart).inherits(Chart);
_.class(PieChart).inherits(Chart);
function PieChart(handler, chartEl, chartData) {
if (!(this instanceof PieChart)) {
return new PieChart(handler, chartEl, chartData);

View file

@ -27,7 +27,7 @@ define(function (require) {
* @param chartEl {HTMLElement} HTML element to which the map will be appended
* @param chartData {Object} Elasticsearch query results for this map
*/
_(TileMap).inherits(Chart);
_.class(TileMap).inherits(Chart);
function TileMap(handler, chartEl, chartData) {
if (!(this instanceof TileMap)) {
return new TileMap(handler, chartEl, chartData);

View file

@ -5,7 +5,7 @@ define(function (require) {
var SimpleEmitter = require('utils/SimpleEmitter');
var notify = new Notifier({ location: 'EventEmitter' });
_(Events).inherits(SimpleEmitter);
_.class(Events).inherits(SimpleEmitter);
function Events() {
Events.Super.call(this);
this._listeners = {};

View file

@ -8,7 +8,7 @@ define(function (require) {
// SavedDashboard constructor. Usually you'd interact with an instance of this.
// ID is option, without it one will be generated on save.
_(SavedDashboard).inherits(courier.SavedObject);
_.class(SavedDashboard).inherits(courier.SavedObject);
function SavedDashboard(id) {
// Gives our SavedDashboard the properties of a SavedObject
courier.SavedObject.call(this, {

View file

@ -9,7 +9,7 @@ define(function (require) {
]);
module.factory('SavedSearch', function (courier) {
_(SavedSearch).inherits(courier.SavedObject);
_.class(SavedSearch).inherits(courier.SavedObject);
function SavedSearch(id) {
courier.SavedObject.call(this, {
type: SavedSearch.type,

View file

@ -3,7 +3,7 @@ define(function (require) {
var _ = require('lodash');
var Renderbot = Private(require('plugins/vis_types/_renderbot'));
_(TemplateRenderbot).inherits(Renderbot);
_.class(TemplateRenderbot).inherits(Renderbot);
function TemplateRenderbot(vis, $el) {
TemplateRenderbot.Super.call(this, vis, $el);

View file

@ -4,7 +4,7 @@ define(function (require) {
var VisType = Private(require('plugins/vis_types/_vis_type'));
var TemplateRenderbot = Private(require('plugins/vis_types/template/_template_renderbot'));
_(TemplateVisType).inherits(VisType);
_.class(TemplateVisType).inherits(VisType);
function TemplateVisType(opts) {
TemplateVisType.Super.call(this, opts);

View file

@ -4,7 +4,7 @@ define(function (require) {
var Renderbot = Private(require('plugins/vis_types/_renderbot'));
var buildChartData = Private(require('plugins/vis_types/vislib/_build_chart_data'));
_(VislibRenderbot).inherits(Renderbot);
_.class(VislibRenderbot).inherits(Renderbot);
function VislibRenderbot(vis, $el) {
VislibRenderbot.Super.call(this, vis, $el);
this._createVis();

View file

@ -12,7 +12,7 @@ define(function (require) {
require('plugins/vis_types/controls/line_interpolation_option');
require('plugins/vis_types/controls/point_series_options');
_(VislibVisType).inherits(VisType);
_.class(VislibVisType).inherits(VisType);
function VislibVisType(opts) {
opts = opts || {};

View file

@ -9,7 +9,7 @@ define(function (require) {
location: 'SavedVis'
});
_(SavedVis).inherits(courier.SavedObject);
_.class(SavedVis).inherits(courier.SavedObject);
function SavedVis(opts) {
var self = this;
opts = opts || {};

View file

@ -16,7 +16,7 @@ define(function (require) {
// esFactory automatically injects the AngularConnector to the config
// https://github.com/elastic/elasticsearch-js/blob/master/src/lib/connectors/angular.js
_(CustomAngularConnector).inherits(config.connectionClass);
_.class(CustomAngularConnector).inherits(config.connectionClass);
function CustomAngularConnector(host, config) {
CustomAngularConnector.Super.call(this, host, config);

View file

@ -8,7 +8,7 @@ define(function (require) {
*
* @class
*/
_(SimpleEmitter).inherits(BaseObject);
_.class(SimpleEmitter).inherits(BaseObject);
function SimpleEmitter() {
this._listeners = {};
}

View file

@ -27,7 +27,7 @@ define(function (require) {
* that this IndexedArray should not be modified. It's modification
* methods are also removed
*/
_(IndexedArray).inherits(Array);
_.class(IndexedArray).inherits(Array);
function IndexedArray(config) {
IndexedArray.Super.call(this);

View file

@ -6,7 +6,7 @@ define(function (require) {
var stub = sinon.spy(body || function () {
stub.Super && stub.Super.call(this);
});
if (parent) _(stub).inherits(parent);
if (parent) _.class(stub).inherits(parent);
return stub;
}

View file

@ -17,7 +17,7 @@ define(function (require) {
TestFormat.title = 'Test Format';
TestFormat.prototype._convert = _.asPrettyString;
_(TestFormat).inherits(FieldFormat);
_.class(TestFormat).inherits(FieldFormat);
}));
describe('params', function () {

View file

@ -35,7 +35,7 @@ define(function (require) {
});
it('should work with inherited objects', function () {
_(MyEventedObject).inherits(Events);
_.class(MyEventedObject).inherits(Events);
function MyEventedObject() {
MyEventedObject.Super.call(this);
}
@ -192,4 +192,4 @@ define(function (require) {
});
});
});
});
});