mnemonica 0.9.93 → 0.9.98
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -13
- package/build/api/errors/bindedMethodErrorHandler.js +52 -51
- package/build/api/errors/exceptionConstructor.js +98 -98
- package/build/api/errors/index.d.ts +1 -1
- package/build/api/errors/index.js +51 -48
- package/build/api/errors/throwModificationError.js +96 -95
- package/build/api/hooks/flowCheckers.d.ts +1 -1
- package/build/api/hooks/flowCheckers.js +11 -10
- package/build/api/hooks/index.js +7 -7
- package/build/api/hooks/invokeHook.js +46 -45
- package/build/api/hooks/registerHook.js +19 -18
- package/build/api/index.d.ts +1 -1
- package/build/api/index.js +9 -9
- package/build/api/types/InstanceCreator.d.ts +2 -4
- package/build/api/types/InstanceCreator.js +237 -239
- package/build/api/types/InstanceModificator.js +10 -8
- package/build/api/types/Mnemosyne.d.ts +3 -2
- package/build/api/types/Mnemosyne.js +127 -111
- package/build/api/types/TypeProxy.js +132 -132
- package/build/api/types/addProps.d.ts +1 -0
- package/build/api/types/addProps.js +68 -0
- package/build/api/types/compileNewModificatorFunctionBody.d.ts +1 -1
- package/build/api/types/compileNewModificatorFunctionBody.js +37 -27
- package/build/api/types/createInstanceModificator.js +26 -24
- package/build/api/types/createInstanceModificator200XthWay.js +29 -28
- package/build/api/types/index.js +161 -159
- package/build/api/types/obeyConstructor.d.ts +1 -0
- package/build/api/types/obeyConstructor.js +30 -0
- package/build/api/utils/index.d.ts +20 -8
- package/build/api/utils/index.js +122 -122
- package/build/constants/index.d.ts +2 -0
- package/build/constants/index.js +62 -57
- package/build/descriptors/errors/index.js +7 -7
- package/build/descriptors/index.js +5 -5
- package/build/descriptors/namespaces/index.js +70 -70
- package/build/descriptors/types/index.js +141 -141
- package/build/index.d.ts +39 -5
- package/build/index.js +63 -31
- package/build/types/index.d.ts +16 -17
- package/build/types/index.js +1 -1
- package/build/utils/collectConstructors.js +52 -51
- package/build/utils/defineStackCleaner.js +9 -8
- package/build/utils/extract.js +16 -15
- package/build/utils/hop.js +3 -2
- package/build/utils/index.js +27 -27
- package/build/utils/merge.js +15 -14
- package/build/utils/parent.js +17 -16
- package/build/utils/parse.js +42 -41
- package/build/utils/pick.js +21 -20
- package/build/utils/toJSON.js +27 -26
- package/package.json +92 -92
- package/build/api/types/InstanceCreatorProto.d.ts +0 -3
- package/build/api/types/InstanceCreatorProto.js +0 -88
package/README.md
CHANGED
|
@@ -10,10 +10,8 @@ abstract technique that aids information retention : instance inheritance system
|
|
|
10
10
|
|
|
11
11
|
# shortcuts
|
|
12
12
|
|
|
13
|
-
* ?. : state : **mad science**
|
|
14
13
|
* ?. : type : **asynchronous monad descriptor** => this
|
|
15
14
|
* ?. : prod ready : **we wonder about**
|
|
16
|
-
* ?. : typescript : **yes, some, starting from 0.9.77**
|
|
17
15
|
* ?. : example : **git clone && npm run example**
|
|
18
16
|
|
|
19
17
|
---
|
|
@@ -28,17 +26,6 @@ abstract technique that aids information retention : instance inheritance system
|
|
|
28
26
|
|
|
29
27
|
---
|
|
30
28
|
|
|
31
|
-
# TypeScript note
|
|
32
|
-
|
|
33
|
-
If you are TypeScript user we have good news for you:
|
|
34
|
-
* there is more than one way to annotate the code
|
|
35
|
-
* we provide support with some limitations
|
|
36
|
-
* and you can help to do better
|
|
37
|
-
|
|
38
|
-
Please visit [Mnemonica TypeScript](https://github.com/wentout/mnemonica/blob/master/TypeScript.md) page for explanations.
|
|
39
|
-
|
|
40
|
-
---
|
|
41
|
-
|
|
42
29
|
|
|
43
30
|
# core concept
|
|
44
31
|
|
|
@@ -49,6 +36,13 @@ This lib might help to create some sort of order or sequence or precedence of ho
|
|
|
49
36
|
* [Dead Simple type checker for JavaScript](https://dev.to/wentout/dead-simple-type-checker-for-javascript-4l40)
|
|
50
37
|
|
|
51
38
|
|
|
39
|
+
## TypeScript note
|
|
40
|
+
|
|
41
|
+
**define** function now fully supports TypeScript definitions
|
|
42
|
+
|
|
43
|
+
for more easy types writing nested~sub constructors might be applied using just direct apply, call or bind functions
|
|
44
|
+
|
|
45
|
+
|
|
52
46
|
## Factory of Constructors
|
|
53
47
|
|
|
54
48
|
As we discrovered from that article, we need some tooling, giving us the best experience with Prototype Chain Inheritance pattern. First of all it must be reproducible and maintainable. And from the first point we have to define some sort of Factory Constructor for start crafting our Instances, it might look like so:
|
|
@@ -645,6 +639,39 @@ usingReactAsProto.render("just works", root);
|
|
|
645
639
|
|
|
646
640
|
```
|
|
647
641
|
|
|
642
|
+
|
|
643
|
+
# call, apply & bind ( existent, ItsNestedType, ...args)
|
|
644
|
+
|
|
645
|
+
mostly for TypeScript purpose you may do this
|
|
646
|
+
|
|
647
|
+
```js
|
|
648
|
+
const SomeType = define('SomeType', function () {
|
|
649
|
+
// ...
|
|
650
|
+
});
|
|
651
|
+
|
|
652
|
+
|
|
653
|
+
const SomeSubType = SomeType
|
|
654
|
+
.define('SomeSubType', function (...args) {
|
|
655
|
+
// ...
|
|
656
|
+
});
|
|
657
|
+
|
|
658
|
+
const someInstance = new SomeType;
|
|
659
|
+
|
|
660
|
+
const someSubInstance = call(
|
|
661
|
+
someInstance, SomeSubType, ...args);
|
|
662
|
+
|
|
663
|
+
// or for array of args
|
|
664
|
+
const someSubInstance = apply(
|
|
665
|
+
someInstance, SomeSubType, args);
|
|
666
|
+
|
|
667
|
+
// or for delayed construction
|
|
668
|
+
const someSubInstanceConstructor =
|
|
669
|
+
bind( someInstance, SomeSubType );
|
|
670
|
+
|
|
671
|
+
const someSubInstance = someSubInstanceConstructor(...args);
|
|
672
|
+
|
|
673
|
+
```
|
|
674
|
+
|
|
648
675
|
# Asynchronous Constructors
|
|
649
676
|
First of all you should understand what you wish to are doing!
|
|
650
677
|
Then you should understand what you wish. And only after doing so you might use this technic:
|
|
@@ -1,55 +1,56 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
Object.defineProperty(exports,
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.bindedMethodErrorHandler = void 0;
|
|
4
|
-
const constants_1 = require(
|
|
4
|
+
const constants_1 = require("../../constants");
|
|
5
5
|
const { odp, } = constants_1.constants;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
6
|
+
const bindedMethodErrorHandler = (exceptionReason) => {
|
|
7
|
+
const { applyTo, args, method, asNew, error } = exceptionReason;
|
|
8
|
+
const reThrown = error.exceptionReason !== undefined;
|
|
9
|
+
if (reThrown) {
|
|
10
|
+
error.reasons.push(exceptionReason);
|
|
11
|
+
error.surplus.push(error);
|
|
12
|
+
return error;
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
odp(error, 'exceptionReason', {
|
|
16
|
+
get() {
|
|
17
|
+
return exceptionReason;
|
|
18
|
+
},
|
|
19
|
+
enumerable: true
|
|
20
|
+
});
|
|
21
|
+
const reasons = [exceptionReason];
|
|
22
|
+
odp(error, 'reasons', {
|
|
23
|
+
get() {
|
|
24
|
+
return reasons;
|
|
25
|
+
},
|
|
26
|
+
enumerable: true
|
|
27
|
+
});
|
|
28
|
+
const surplus = [];
|
|
29
|
+
odp(error, 'surplus', {
|
|
30
|
+
get() {
|
|
31
|
+
return surplus;
|
|
32
|
+
},
|
|
33
|
+
enumerable: true
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
if (applyTo && applyTo.exception instanceof Function) {
|
|
37
|
+
let preparedException = error;
|
|
38
|
+
try {
|
|
39
|
+
preparedException = new applyTo.exception(error, {
|
|
40
|
+
args,
|
|
41
|
+
exceptionReasonMethod: method,
|
|
42
|
+
exceptionReasonObject: applyTo,
|
|
43
|
+
reasonsIsNew: asNew
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
catch (additionalError) {
|
|
47
|
+
error.surplus.push(additionalError);
|
|
48
|
+
return error;
|
|
49
|
+
}
|
|
50
|
+
if (preparedException instanceof Error) {
|
|
51
|
+
return preparedException;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return error;
|
|
55
55
|
};
|
|
56
|
+
exports.bindedMethodErrorHandler = bindedMethodErrorHandler;
|
|
@@ -1,110 +1,110 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
const constants_1 = require(
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const constants_1 = require("../../constants");
|
|
4
4
|
const { odp } = constants_1.constants;
|
|
5
|
-
const errors_1 = require(
|
|
5
|
+
const errors_1 = require("../../descriptors/errors");
|
|
6
6
|
const { WRONG_ARGUMENTS_USED, WRONG_INSTANCE_INVOCATION } = errors_1.ErrorsTypes;
|
|
7
|
-
const errors_2 = require(
|
|
8
|
-
const utils_1 = require(
|
|
7
|
+
const errors_2 = require("../errors");
|
|
8
|
+
const utils_1 = require("../../utils");
|
|
9
9
|
const { parse } = utils_1.utils;
|
|
10
|
-
const utils_2 = require(
|
|
10
|
+
const utils_2 = require("../utils");
|
|
11
11
|
const { makeFakeModificatorType } = utils_2.default;
|
|
12
|
-
const InstanceModificator_1 = require(
|
|
12
|
+
const InstanceModificator_1 = require("../types/InstanceModificator");
|
|
13
13
|
const checkThrowArgs = (instance, target, error, args) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
14
|
+
let wrongThrow;
|
|
15
|
+
if (!target) {
|
|
16
|
+
throw new WRONG_INSTANCE_INVOCATION('exception should be made with new keyword');
|
|
17
|
+
}
|
|
18
|
+
if (!(error instanceof Error)) {
|
|
19
|
+
wrongThrow = new WRONG_ARGUMENTS_USED('error must be instanceof Error');
|
|
20
|
+
}
|
|
21
|
+
if (!(wrongThrow instanceof Error)) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
odp(wrongThrow, 'instance', {
|
|
25
|
+
get() {
|
|
26
|
+
return instance;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
odp(wrongThrow, 'error', {
|
|
30
|
+
get() {
|
|
31
|
+
return error;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
odp(wrongThrow, 'args', {
|
|
35
|
+
get() {
|
|
36
|
+
return args;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
throw wrongThrow;
|
|
40
40
|
};
|
|
41
41
|
const exceptionConsctructHandler = function (opts) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
42
|
+
const { instance, TypeName, typeStack, args, error } = opts;
|
|
43
|
+
const exception = this;
|
|
44
|
+
odp(exception, 'args', {
|
|
45
|
+
get() {
|
|
46
|
+
return args;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
odp(exception, 'originalError', {
|
|
50
|
+
get() {
|
|
51
|
+
return error;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
odp(exception, 'instance', {
|
|
55
|
+
get() {
|
|
56
|
+
return instance;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
odp(exception, 'extract', {
|
|
60
|
+
get() {
|
|
61
|
+
return () => {
|
|
62
|
+
return instance.extract();
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
odp(exception, 'parse', {
|
|
67
|
+
get() {
|
|
68
|
+
return () => {
|
|
69
|
+
return parse(instance);
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
const errorStack = exception.stack.split('\n');
|
|
74
|
+
const stack = [];
|
|
75
|
+
const title = `\n<-- lifecycle of [ ${TypeName} ] traced -->`;
|
|
76
|
+
errors_2.getStack.call(exception, title, [], prepareException);
|
|
77
|
+
stack.push(...exception.stack);
|
|
78
|
+
stack.push('<-- with the following error -->');
|
|
79
|
+
errorStack.forEach((line) => {
|
|
80
|
+
if (!stack.includes(line)) {
|
|
81
|
+
stack.push(line);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
stack.push('\n<-- of constructor definitions stack -->');
|
|
85
|
+
stack.push(...typeStack);
|
|
86
|
+
exception.stack = (0, errors_2.cleanupStack)(stack).join('\n');
|
|
87
|
+
return exception;
|
|
88
88
|
};
|
|
89
89
|
const prepareException = function (target, error, ...args) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
90
|
+
const instance = this;
|
|
91
|
+
checkThrowArgs(instance, target, error, args);
|
|
92
|
+
const { __type__, __creator__ } = instance;
|
|
93
|
+
const { stack: typeStack, TypeName } = __type__;
|
|
94
|
+
const ExceptionCreator = Object.create(__creator__);
|
|
95
|
+
ExceptionCreator.config = Object.assign({}, __creator__.config);
|
|
96
|
+
ExceptionCreator.config.blockErrors = false;
|
|
97
|
+
ExceptionCreator.existentInstance = error;
|
|
98
|
+
ExceptionCreator.ModificatorType = makeFakeModificatorType(TypeName, function () {
|
|
99
|
+
return exceptionConsctructHandler.call(this, {
|
|
100
|
+
instance,
|
|
101
|
+
TypeName,
|
|
102
|
+
typeStack,
|
|
103
|
+
args,
|
|
104
|
+
error
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
ExceptionCreator.InstanceModificator = (0, InstanceModificator_1.makeInstanceModificator)(ExceptionCreator);
|
|
108
|
+
return new ExceptionCreator.InstanceModificator();
|
|
109
109
|
};
|
|
110
110
|
exports.default = prepareException;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const stackCleaners: RegExp[];
|
|
2
2
|
export declare const cleanupStack: (stack: string[]) => string[];
|
|
3
|
-
export declare const getStack: (this: any, title: string, stackAddition: string[], tillFunction?: CallableFunction
|
|
3
|
+
export declare const getStack: (this: any, title: string, stackAddition: string[], tillFunction?: CallableFunction) => any;
|
|
4
4
|
export declare class BASE_MNEMONICA_ERROR extends Error {
|
|
5
5
|
constructor(message: string | undefined, additionalStack: string[]);
|
|
6
6
|
}
|
|
@@ -1,59 +1,61 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
Object.defineProperty(exports,
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.constructError = exports.BASE_MNEMONICA_ERROR = exports.getStack = exports.cleanupStack = exports.stackCleaners = void 0;
|
|
4
|
-
const constants_1 = require(
|
|
4
|
+
const constants_1 = require("../../constants");
|
|
5
5
|
const { odp, SymbolConstructorName, MNEMONICA, ErrorMessages, } = constants_1.constants;
|
|
6
6
|
const { BASE_ERROR_MESSAGE } = ErrorMessages;
|
|
7
7
|
exports.stackCleaners = [];
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
const cleanupStack = (stack) => {
|
|
9
|
+
const cleaned = stack.reduce((arr, line) => {
|
|
10
|
+
exports.stackCleaners.forEach(cleanerRegExp => {
|
|
11
|
+
if (!cleanerRegExp.test(line)) {
|
|
12
|
+
arr.push(line);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
return arr;
|
|
16
|
+
}, []);
|
|
17
|
+
return cleaned.length ? cleaned : stack;
|
|
18
18
|
};
|
|
19
|
-
exports.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
19
|
+
exports.cleanupStack = cleanupStack;
|
|
20
|
+
const getStack = function (title, stackAddition, tillFunction) {
|
|
21
|
+
if (Error.captureStackTrace) {
|
|
22
|
+
Error.captureStackTrace(this, tillFunction || exports.getStack);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
this.stack = (new Error()).stack;
|
|
26
|
+
}
|
|
27
|
+
this.stack = this.stack.split('\n').slice(1);
|
|
28
|
+
this.stack = (0, exports.cleanupStack)(this.stack);
|
|
29
|
+
this.stack.unshift(title);
|
|
30
|
+
if (Array.isArray(stackAddition) && stackAddition.length) {
|
|
31
|
+
this.stack.push(...stackAddition);
|
|
32
|
+
}
|
|
33
|
+
this.stack.push('\n');
|
|
34
|
+
return this.stack;
|
|
34
35
|
};
|
|
36
|
+
exports.getStack = getStack;
|
|
35
37
|
class BASE_MNEMONICA_ERROR extends Error {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
38
|
+
constructor(message = BASE_ERROR_MESSAGE, additionalStack) {
|
|
39
|
+
super(message);
|
|
40
|
+
const BaseStack = this.stack;
|
|
41
|
+
odp(this, 'BaseStack', {
|
|
42
|
+
get() {
|
|
43
|
+
return BaseStack;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
const stack = (0, exports.cleanupStack)(BaseStack.split('\n'));
|
|
47
|
+
if (additionalStack) {
|
|
48
|
+
stack.unshift(...additionalStack);
|
|
49
|
+
}
|
|
50
|
+
this.stack = stack.join('\n');
|
|
51
|
+
}
|
|
52
|
+
static get [SymbolConstructorName]() {
|
|
53
|
+
return `base of : ${MNEMONICA} : errors`;
|
|
54
|
+
}
|
|
53
55
|
}
|
|
54
56
|
exports.BASE_MNEMONICA_ERROR = BASE_MNEMONICA_ERROR;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
+
const constructError = (name, message) => {
|
|
58
|
+
const body = `
|
|
57
59
|
class ${name} extends base {
|
|
58
60
|
constructor (addition, stack) {
|
|
59
61
|
super(addition ?
|
|
@@ -65,6 +67,7 @@ exports.constructError = (name, message) => {
|
|
|
65
67
|
};
|
|
66
68
|
return ${name};
|
|
67
69
|
`;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
+
const NamedErrorConstructor = (new Function('base', body))(BASE_MNEMONICA_ERROR);
|
|
71
|
+
return NamedErrorConstructor;
|
|
70
72
|
};
|
|
73
|
+
exports.constructError = constructError;
|