File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -15,10 +15,11 @@ class BaseSignature {
15
15
16
16
// Type of the signature.
17
17
// Determines the actual signature class of each instance.
18
- // These must match JavaScript enum SignatureType in enums .ts
18
+ // These must match JavaScript enum SignatureType in common .ts
19
19
20
20
enum class SignatureType : unsigned int {
21
- func = 0 ,
21
+ none = 0 ,
22
+ func,
22
23
method,
23
24
getter,
24
25
setter,
@@ -92,6 +93,10 @@ class TemplatedBaseSignature : public BaseSignature {
92
93
static Signature &getInstance () {
93
94
// Linkage for a singleton instance of each templated class.
94
95
static Signature instance;
96
+
97
+ // The constructor should have been called, but sometimes it wasn't!
98
+ if (instance.getType () == SignatureType :: none) new (&instance) Signature ();
99
+
95
100
return (instance);
96
101
}
97
102
Original file line number Diff line number Diff line change 4
4
// These must match C++ enum SignatureType in BaseSignature.h
5
5
6
6
export const enum SignatureType {
7
- func = 0 ,
7
+ none = 0 ,
8
+ func ,
8
9
method ,
9
10
getter ,
10
11
setter ,
Original file line number Diff line number Diff line change @@ -223,6 +223,11 @@ static void initModule() {
223
223
}
224
224
225
225
switch (signature->getType ()) {
226
+ case SignatureType :: none:
227
+
228
+ // Impossible!
229
+ abort ();
230
+
226
231
case SignatureType :: method:
227
232
case SignatureType :: getter:
228
233
case SignatureType :: setter:
You can’t perform that action at this time.
0 commit comments