breeze-bindgen 1.1.29 → 1.1.30
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/dist/cli.mjs +22 -8
- package/dist/core.cjs +22 -8
- package/dist/core.mjs +22 -8
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -335,13 +335,14 @@ declare module '${tsModuleName}' {
|
|
|
335
335
|
const methodName = node.name;
|
|
336
336
|
const getterMatch = methodName.match(/^get_(.+)$/) || (methodName.match(/^get([A-Z].*)$/) ? [null, methodName[3].toLowerCase() + methodName.slice(4)] : null);
|
|
337
337
|
const setterMatch = methodName.match(/^set_(.+)$/) || (methodName.match(/^set([A-Z].*)$/) ? [null, methodName[3].toLowerCase() + methodName.slice(4)] : null);
|
|
338
|
+
const isStatic = node.storageClass === "static";
|
|
338
339
|
if (getterMatch && parsed.args.length === 0) {
|
|
339
340
|
const propName = getterMatch[1];
|
|
340
341
|
methods.push({
|
|
341
342
|
name: methodName,
|
|
342
343
|
returnType: ctypeToQualified(parsed.returnType, [...path, node.name]),
|
|
343
344
|
args: [],
|
|
344
|
-
static:
|
|
345
|
+
static: isStatic,
|
|
345
346
|
comment: comment.length > 0 ? comment : void 0,
|
|
346
347
|
argNames: [],
|
|
347
348
|
isGetter: true,
|
|
@@ -353,7 +354,7 @@ declare module '${tsModuleName}' {
|
|
|
353
354
|
name: methodName,
|
|
354
355
|
returnType: ctypeToQualified(parsed.returnType, [...path, node.name]),
|
|
355
356
|
args: parsed.args.map((arg) => ctypeToQualified(arg, [...path, node_struct.name])),
|
|
356
|
-
static:
|
|
357
|
+
static: isStatic,
|
|
357
358
|
comment: comment.length > 0 ? comment : void 0,
|
|
358
359
|
argNames,
|
|
359
360
|
isSetter: true,
|
|
@@ -364,7 +365,7 @@ declare module '${tsModuleName}' {
|
|
|
364
365
|
name: methodName,
|
|
365
366
|
returnType: ctypeToQualified(parsed.returnType, [...path, node.name]),
|
|
366
367
|
args: parsed.args.map((arg) => ctypeToQualified(arg, [...path, node_struct.name])),
|
|
367
|
-
static:
|
|
368
|
+
static: isStatic,
|
|
368
369
|
comment: comment.length > 0 ? comment : void 0,
|
|
369
370
|
argNames
|
|
370
371
|
});
|
|
@@ -428,12 +429,25 @@ template<> struct js_bind<${fullName}> {
|
|
|
428
429
|
}
|
|
429
430
|
}
|
|
430
431
|
for (const [propName, { getter, setter }] of properties) {
|
|
431
|
-
if (setter) {
|
|
432
|
-
|
|
433
|
-
|
|
432
|
+
if (setter.static !== getter.static) {
|
|
433
|
+
throw new Error(`Found setter ${setter.name} with different staticness than getter for property ${propName}`);
|
|
434
|
+
}
|
|
435
|
+
if (getter.static) {
|
|
436
|
+
if (setter) {
|
|
437
|
+
binding += `
|
|
438
|
+
.static_property<&${fullName}::${getter.name}, &${fullName}::${setter.name}>("${propName}")`;
|
|
439
|
+
} else {
|
|
440
|
+
binding += `
|
|
441
|
+
.static_property<&${fullName}::${getter.name}>("${propName}")`;
|
|
442
|
+
}
|
|
434
443
|
} else {
|
|
435
|
-
|
|
436
|
-
|
|
444
|
+
if (setter) {
|
|
445
|
+
binding += `
|
|
446
|
+
.property<&${fullName}::${getter.name}, &${fullName}::${setter.name}>("${propName}")`;
|
|
447
|
+
} else {
|
|
448
|
+
binding += `
|
|
449
|
+
.property<&${fullName}::${getter.name}>("${propName}")`;
|
|
450
|
+
}
|
|
437
451
|
}
|
|
438
452
|
}
|
|
439
453
|
for (const method of methods) {
|
package/dist/core.cjs
CHANGED
|
@@ -545,13 +545,14 @@ declare module '${tsModuleName}' {
|
|
|
545
545
|
const methodName = node.name;
|
|
546
546
|
const getterMatch = methodName.match(/^get_(.+)$/) || (methodName.match(/^get([A-Z].*)$/) ? [null, methodName[3].toLowerCase() + methodName.slice(4)] : null);
|
|
547
547
|
const setterMatch = methodName.match(/^set_(.+)$/) || (methodName.match(/^set([A-Z].*)$/) ? [null, methodName[3].toLowerCase() + methodName.slice(4)] : null);
|
|
548
|
+
const isStatic = node.storageClass === "static";
|
|
548
549
|
if (getterMatch && parsed.args.length === 0) {
|
|
549
550
|
const propName = getterMatch[1];
|
|
550
551
|
methods.push({
|
|
551
552
|
name: methodName,
|
|
552
553
|
returnType: ctypeToQualified(parsed.returnType, [...path, node.name]),
|
|
553
554
|
args: [],
|
|
554
|
-
static:
|
|
555
|
+
static: isStatic,
|
|
555
556
|
comment: comment.length > 0 ? comment : void 0,
|
|
556
557
|
argNames: [],
|
|
557
558
|
isGetter: true,
|
|
@@ -563,7 +564,7 @@ declare module '${tsModuleName}' {
|
|
|
563
564
|
name: methodName,
|
|
564
565
|
returnType: ctypeToQualified(parsed.returnType, [...path, node.name]),
|
|
565
566
|
args: parsed.args.map((arg) => ctypeToQualified(arg, [...path, node_struct.name])),
|
|
566
|
-
static:
|
|
567
|
+
static: isStatic,
|
|
567
568
|
comment: comment.length > 0 ? comment : void 0,
|
|
568
569
|
argNames,
|
|
569
570
|
isSetter: true,
|
|
@@ -574,7 +575,7 @@ declare module '${tsModuleName}' {
|
|
|
574
575
|
name: methodName,
|
|
575
576
|
returnType: ctypeToQualified(parsed.returnType, [...path, node.name]),
|
|
576
577
|
args: parsed.args.map((arg) => ctypeToQualified(arg, [...path, node_struct.name])),
|
|
577
|
-
static:
|
|
578
|
+
static: isStatic,
|
|
578
579
|
comment: comment.length > 0 ? comment : void 0,
|
|
579
580
|
argNames
|
|
580
581
|
});
|
|
@@ -638,12 +639,25 @@ template<> struct js_bind<${fullName}> {
|
|
|
638
639
|
}
|
|
639
640
|
}
|
|
640
641
|
for (const [propName, { getter, setter }] of properties) {
|
|
641
|
-
if (setter) {
|
|
642
|
-
|
|
643
|
-
|
|
642
|
+
if (setter.static !== getter.static) {
|
|
643
|
+
throw new Error(`Found setter ${setter.name} with different staticness than getter for property ${propName}`);
|
|
644
|
+
}
|
|
645
|
+
if (getter.static) {
|
|
646
|
+
if (setter) {
|
|
647
|
+
binding += `
|
|
648
|
+
.static_property<&${fullName}::${getter.name}, &${fullName}::${setter.name}>("${propName}")`;
|
|
649
|
+
} else {
|
|
650
|
+
binding += `
|
|
651
|
+
.static_property<&${fullName}::${getter.name}>("${propName}")`;
|
|
652
|
+
}
|
|
644
653
|
} else {
|
|
645
|
-
|
|
646
|
-
|
|
654
|
+
if (setter) {
|
|
655
|
+
binding += `
|
|
656
|
+
.property<&${fullName}::${getter.name}, &${fullName}::${setter.name}>("${propName}")`;
|
|
657
|
+
} else {
|
|
658
|
+
binding += `
|
|
659
|
+
.property<&${fullName}::${getter.name}>("${propName}")`;
|
|
660
|
+
}
|
|
647
661
|
}
|
|
648
662
|
}
|
|
649
663
|
for (const method of methods) {
|
package/dist/core.mjs
CHANGED
|
@@ -541,13 +541,14 @@ declare module '${tsModuleName}' {
|
|
|
541
541
|
const methodName = node.name;
|
|
542
542
|
const getterMatch = methodName.match(/^get_(.+)$/) || (methodName.match(/^get([A-Z].*)$/) ? [null, methodName[3].toLowerCase() + methodName.slice(4)] : null);
|
|
543
543
|
const setterMatch = methodName.match(/^set_(.+)$/) || (methodName.match(/^set([A-Z].*)$/) ? [null, methodName[3].toLowerCase() + methodName.slice(4)] : null);
|
|
544
|
+
const isStatic = node.storageClass === "static";
|
|
544
545
|
if (getterMatch && parsed.args.length === 0) {
|
|
545
546
|
const propName = getterMatch[1];
|
|
546
547
|
methods.push({
|
|
547
548
|
name: methodName,
|
|
548
549
|
returnType: ctypeToQualified(parsed.returnType, [...path, node.name]),
|
|
549
550
|
args: [],
|
|
550
|
-
static:
|
|
551
|
+
static: isStatic,
|
|
551
552
|
comment: comment.length > 0 ? comment : void 0,
|
|
552
553
|
argNames: [],
|
|
553
554
|
isGetter: true,
|
|
@@ -559,7 +560,7 @@ declare module '${tsModuleName}' {
|
|
|
559
560
|
name: methodName,
|
|
560
561
|
returnType: ctypeToQualified(parsed.returnType, [...path, node.name]),
|
|
561
562
|
args: parsed.args.map((arg) => ctypeToQualified(arg, [...path, node_struct.name])),
|
|
562
|
-
static:
|
|
563
|
+
static: isStatic,
|
|
563
564
|
comment: comment.length > 0 ? comment : void 0,
|
|
564
565
|
argNames,
|
|
565
566
|
isSetter: true,
|
|
@@ -570,7 +571,7 @@ declare module '${tsModuleName}' {
|
|
|
570
571
|
name: methodName,
|
|
571
572
|
returnType: ctypeToQualified(parsed.returnType, [...path, node.name]),
|
|
572
573
|
args: parsed.args.map((arg) => ctypeToQualified(arg, [...path, node_struct.name])),
|
|
573
|
-
static:
|
|
574
|
+
static: isStatic,
|
|
574
575
|
comment: comment.length > 0 ? comment : void 0,
|
|
575
576
|
argNames
|
|
576
577
|
});
|
|
@@ -634,12 +635,25 @@ template<> struct js_bind<${fullName}> {
|
|
|
634
635
|
}
|
|
635
636
|
}
|
|
636
637
|
for (const [propName, { getter, setter }] of properties) {
|
|
637
|
-
if (setter) {
|
|
638
|
-
|
|
639
|
-
|
|
638
|
+
if (setter.static !== getter.static) {
|
|
639
|
+
throw new Error(`Found setter ${setter.name} with different staticness than getter for property ${propName}`);
|
|
640
|
+
}
|
|
641
|
+
if (getter.static) {
|
|
642
|
+
if (setter) {
|
|
643
|
+
binding += `
|
|
644
|
+
.static_property<&${fullName}::${getter.name}, &${fullName}::${setter.name}>("${propName}")`;
|
|
645
|
+
} else {
|
|
646
|
+
binding += `
|
|
647
|
+
.static_property<&${fullName}::${getter.name}>("${propName}")`;
|
|
648
|
+
}
|
|
640
649
|
} else {
|
|
641
|
-
|
|
642
|
-
|
|
650
|
+
if (setter) {
|
|
651
|
+
binding += `
|
|
652
|
+
.property<&${fullName}::${getter.name}, &${fullName}::${setter.name}>("${propName}")`;
|
|
653
|
+
} else {
|
|
654
|
+
binding += `
|
|
655
|
+
.property<&${fullName}::${getter.name}>("${propName}")`;
|
|
656
|
+
}
|
|
643
657
|
}
|
|
644
658
|
}
|
|
645
659
|
for (const method of methods) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e",
|
|
3
3
|
"name": "breeze-bindgen",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.30",
|
|
5
5
|
"main": "dist/core.cjs",
|
|
6
6
|
"module": "dist/core.mjs",
|
|
7
7
|
"types": "dist/core.d.ts",
|