Skip to content

Commit 85e7326

Browse files
authored
[tsgen] Fix braces on ifs for error blocks. (emscripten-core#22642)
Missed the comment on this.
1 parent 3dc7a77 commit 85e7326

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/embind/embind_gen.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,9 @@ var LibraryEmbind = {
476476
}
477477
argStart = 2;
478478
}
479-
if (argsName.length && argsName.length != (argTypes.length - hasThis - 1))
479+
if (argsName.length && argsName.length != (argTypes.length - hasThis - 1)) {
480480
throw new Error('Argument names should match number of parameters.');
481+
}
481482

482483
const args = [];
483484
for (let i = argStart, x = 0; i < argTypes.length; i++) {
@@ -620,8 +621,9 @@ var LibraryEmbind = {
620621
setterContext) {
621622
fieldName = readLatin1String(fieldName);
622623
const readonly = setter === 0;
623-
if (!(readonly || getterReturnType === setterArgumentType))
624+
if (!(readonly || getterReturnType === setterArgumentType)) {
624625
throw new error('Mismatched getter and setter types are not supported.');
626+
}
625627

626628
whenDependentTypesAreResolved([], [classType], function(classType) {
627629
classType = classType[0];
@@ -723,8 +725,9 @@ var LibraryEmbind = {
723725
setterContext
724726
) {
725727
const valueArray = tupleRegistrations[rawTupleType];
726-
if (getterReturnType !== setterArgumentType)
728+
if (getterReturnType !== setterArgumentType) {
727729
throw new Error('Mismatched getter and setter types are not supported.');
730+
}
728731

729732
valueArray.elementTypeIds.push(getterReturnType);
730733
},
@@ -766,8 +769,9 @@ var LibraryEmbind = {
766769
setterContext
767770
) {
768771
const valueObject = structRegistrations[structType];
769-
if (getterReturnType !== setterArgumentType)
772+
if (getterReturnType !== setterArgumentType) {
770773
throw new Error('Mismatched getter and setter types are not supported.');
774+
}
771775

772776
valueObject.fieldTypeIds.push(getterReturnType);
773777
valueObject.fieldNames.push(readLatin1String(fieldName));

0 commit comments

Comments
 (0)