From 04f812cdf31ca926ef71d9d9b9fafbbd1bac0af1 Mon Sep 17 00:00:00 2001 From: Jared Hanson Date: Fri, 26 May 2017 08:55:16 -0700 Subject: [PATCH] Rename Spec to Component. --- lib/component.js | 2 +- lib/patterns/constructor.js | 18 +++++++++--------- lib/patterns/factory.js | 20 ++++++++++---------- lib/patterns/literal.js | 18 +++++++++--------- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/lib/component.js b/lib/component.js index 59a5d3c..754c411 100644 --- a/lib/component.js +++ b/lib/component.js @@ -30,7 +30,7 @@ var debug = require('debug')('electrolyte') * @constructor * @param {string} id - The id of the component. * @param {object} mod - The module containing the component specification. - * @param {number} hs - The handle of the assembly from which the component was loaded. + * @param {number} asm - The assembly from which the component was loaded. * @protected */ function Component(id, mod, asm) { diff --git a/lib/patterns/constructor.js b/lib/patterns/constructor.js index ef4c52a..0480ae2 100644 --- a/lib/patterns/constructor.js +++ b/lib/patterns/constructor.js @@ -1,5 +1,5 @@ // Load modules. -var Spec = require('../component') +var Component = require('../component') , util = require('util') , debug = require('debug')('electrolyte') , InvalidArgumentError = require('../errors/invalidargument'); @@ -13,24 +13,24 @@ var Spec = require('../component') * * @constructor * @param {string} id - The id of the specification. - * @param {object} mod - The module containing the object factory. - * @param {number} hs - The handle of the source from which the spec was loaded. + * @param {object} mod - The module containing the object constructor. + * @param {number} asm - The assembly from which the component was loaded. * @protected */ -function ConstructorSpec(id, ctor, hs) { - Spec.call(this, id, ctor, hs); +function ConstructorComponent(id, ctor, hs) { + Component.call(this, id, ctor, hs); this._ctor = ctor; } -// Inherit from `Spec`. -util.inherits(ConstructorSpec, Spec); +// Inherit from `Component`. +util.inherits(ConstructorComponent, Component); /** * Instantiate an object from the specification. * * @private */ -ConstructorSpec.prototype.instantiate = function() { +ConstructorComponent.prototype.instantiate = function() { debug('instantiate %s', this.id); var args = [].slice.call(arguments) , ctor = this._ctor; @@ -52,4 +52,4 @@ ConstructorSpec.prototype.instantiate = function() { // Expose constructor. -module.exports = ConstructorSpec; +module.exports = ConstructorComponent; diff --git a/lib/patterns/factory.js b/lib/patterns/factory.js index 33e5321..29e3510 100644 --- a/lib/patterns/factory.js +++ b/lib/patterns/factory.js @@ -1,5 +1,5 @@ // Load modules. -var Spec = require('../component') +var Component = require('../component') , util = require('util') , debug = require('debug')('electrolyte'); @@ -11,25 +11,25 @@ var Spec = require('../component') * dependencies and returning the result. * * @constructor - * @param {string} id - The id of the specification. - * @param {object} mod - The module containing the object factory. - * @param {number} hs - The handle of the source from which the spec was loaded. + * @param {string} id - The id of the component. + * @param {object} fn - The module containing the object factory. + * @param {number} asm - The assembly from which the component was loaded. * @protected */ -function FactorySpec(id, fn, hs) { - Spec.call(this, id, fn, hs); +function FactoryComponent(id, fn, asm) { + Component.call(this, id, fn, asm); this._fn = fn; } -// Inherit from `Spec`. -util.inherits(FactorySpec, Spec); +// Inherit from `Component`. +util.inherits(FactoryComponent, Component); /** * Instantiate an object from the specification. * * @private */ -FactorySpec.prototype.instantiate = function() { +FactoryComponent.prototype.instantiate = function() { debug('instantiate %s', this.id); var ctx = { @@ -41,4 +41,4 @@ FactorySpec.prototype.instantiate = function() { // Expose constructor. -module.exports = FactorySpec; +module.exports = FactoryComponent; diff --git a/lib/patterns/literal.js b/lib/patterns/literal.js index 374cd80..f1aaf51 100644 --- a/lib/patterns/literal.js +++ b/lib/patterns/literal.js @@ -1,5 +1,5 @@ // Load modules. -var Spec = require('../component') +var Component = require('../component') , util = require('util'); @@ -18,19 +18,19 @@ var Spec = require('../component') * function as a factory. * * @constructor - * @param {string} id - The id of the specification. - * @param {object} mod - The module containing the object factory. - * @param {number} hs - The handle of the source from which the spec was loaded. + * @param {string} id - The id of the component. + * @param {object} obj - The module containing the literal object. + * @param {number} asm - The assembly from which the component was loaded. * @protected */ -function LiteralSpec(id, obj, hs) { - Spec.call(this, id, obj, hs); +function LiteralComponent(id, obj, asm) { + Component.call(this, id, obj, asm); this._instance = obj; } -// Inherit from `Spec`. -util.inherits(LiteralSpec, Spec); +// Inherit from `Component`. +util.inherits(LiteralComponent, Component); // Expose constructor. -module.exports = LiteralSpec; +module.exports = LiteralComponent;