Skip to content

Commit 98db871

Browse files
committed
Add #if ASSERTIONS guard around assert in embind_shared
Adding the #if ASSERTIONS guard fixes the error ERROR - [JSC_NOT_FUNCTION_TYPE] { __clutz_actual_namespace: string, assert: function(*, (Error|string)=): undefined } expressions are not callable assert(signature[signature.length - 1] == ")", "Parentheses for argument names should match."); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1 parent fcb3336 commit 98db871

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/embind/embind_shared.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ var LibraryEmbindShared = {
129129
signature = signature.trim();
130130
const argsIndex = signature.indexOf("(");
131131
if (argsIndex !== -1) {
132+
#if ASSERTIONS
132133
assert(signature[signature.length - 1] == ")", "Parentheses for argument names should match.");
134+
#endif
133135
return signature.substr(0, argsIndex);
134136
} else {
135137
return signature;
@@ -140,7 +142,9 @@ var LibraryEmbindShared = {
140142
signature = signature.trim();
141143
const argsIndex = signature.indexOf("(") + 1;
142144
if (argsIndex !== 0) {
145+
#if ASSERTIONS
143146
assert(signature[signature.length - 1] == ")", "Parentheses for argument names should match.");
147+
#endif
144148
return signature.substr(argsIndex, signature.length - argsIndex - 1).replaceAll(" ", "").split(",").filter(n => n.length);
145149
} else {
146150
return [];

0 commit comments

Comments
 (0)