mirror of
https://github.com/BreizhHardware/memoizee.git
synced 2026-01-18 16:37:21 +01:00
Update up to changes in es5-ext
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
var CustomError = require('es5-ext/error/custom')
|
||||
var customError = require('es5-ext/error/custom')
|
||||
, callable = require('es5-ext/object/valid-callable')
|
||||
, hasListeners = require('event-emitter/lib/has-listeners')
|
||||
|
||||
@@ -53,7 +53,7 @@ module.exports = require('./_base')(function (conf, length, options) {
|
||||
if (arguments.length === 1) value = call.call(fn, this, id);
|
||||
else value = apply.call(fn, this, arguments);
|
||||
if (cache.hasOwnProperty(id)) {
|
||||
throw new CustomError("Circular invocation", 'CIRCULAR_INVOCATION');
|
||||
throw customError("Circular invocation", 'CIRCULAR_INVOCATION');
|
||||
}
|
||||
cache[id] = value;
|
||||
if (initListeners) conf.emit('init', id);
|
||||
@@ -66,7 +66,7 @@ module.exports = require('./_base')(function (conf, length, options) {
|
||||
}
|
||||
value = apply.call(conf.fn, this, arguments);
|
||||
if (cache.hasOwnProperty(id)) {
|
||||
throw new CustomError("Circular invocation", 'CIRCULAR_INVOCATION');
|
||||
throw customError("Circular invocation", 'CIRCULAR_INVOCATION');
|
||||
}
|
||||
cache[id] = value;
|
||||
if (initListeners) conf.emit('init', id);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
var CustomError = require('es5-ext/error/custom')
|
||||
var customError = require('es5-ext/error/custom')
|
||||
, indexOf = require('es5-ext/array/#/e-index-of')
|
||||
, hasListeners = require('event-emitter/lib/has-listeners')
|
||||
|
||||
@@ -222,7 +222,7 @@ module.exports = require('./_base')(function (conf, length) {
|
||||
value = apply.call(fn, this, arguments);
|
||||
id = get(arguments);
|
||||
if (id != null) {
|
||||
throw new CustomError("Circular invocation", 'CIRCULAR_INVOCATION');
|
||||
throw customError("Circular invocation", 'CIRCULAR_INVOCATION');
|
||||
}
|
||||
id = set(arguments);
|
||||
cache[id] = value;
|
||||
|
||||
Reference in New Issue
Block a user