<commit_before>// Load modules.
var Spec = require('../spec')
  , util = require('util');


function LiteralSpec(id, obj, hs) {
  Spec.call(this, id, obj, hs);
  this.instance = obj;
}

// Inherit from `Spec`.
util.inherits(LiteralSpec, Spec);


// Expose constructor.
module.exports = LiteralSpec;
<commit_msg>Document literal.<commit_after>// Load modules.
var Spec = require('../spec')
  , util = require('util');


/**
 * A specification of an object literal.
 *
 * A literal is returned directly when created by the IoC container.
 *
 * Due to the nature of being a literal, no dependencies are injected and only
 * a single instance of the object will be created.
 *
 * If a module exports a primitive type (object, string, number, etc.), the IoC
 * container will automatically detect it as a literal.  If the module exports
 * a function which is to be treated as a literal, the `@literal` annotation
 * must be set to `true`.  Otherwise, the default behavior will be to treat the
 * 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.
 * @protected
 */
function LiteralSpec(id, obj, hs) {
  Spec.call(this, id, obj, hs);
  this.instance = obj;
}

// Inherit from `Spec`.
util.inherits(LiteralSpec, Spec);


// Expose constructor.
module.exports = LiteralSpec;

{'fraction_non_alphanumeric': 0.11506849315068493, 'fraction_numerical': 0.0, 'mean_word_length': 3.608832807570978, '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': '4904759', 'n_tokens_mistral': 435, 'n_tokens_neox': 421, 'n_words': 184}