Add #if ASSERTIONS guard around assert in embind_shared#20504
Closed
itf wants to merge 2 commits intoemscripten-core:mainfrom
Closed
Add #if ASSERTIONS guard around assert in embind_shared#20504itf wants to merge 2 commits intoemscripten-core:mainfrom
itf wants to merge 2 commits intoemscripten-core:mainfrom
Conversation
Collaborator
|
Do you know why assert is undefined in this case? Can you share the command you run to generate that error? |
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.");
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
apply code review suggestions Co-authored-by: Brendan Dahl <brendan.dahl@gmail.com>
1c9080b to
6ee793a
Compare
Author
|
I believe the reason is that I'm compiling with The other flags I'm using are: PRINTF_LONG_DOUBLE=1 |
Collaborator
|
I'd love to see a test for this.. I'm trying to create a failing test locally, but not having much luck |
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Nov 1, 2023
This matches the behaviour of MINIMAL_RUNTIME, and supports the practice of not including asserts in release builds. Also remove the closure externs for `assert` so that closure can correctly error out end `assert` is not defined. Helps with emscripten-core#20504
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Nov 1, 2023
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Nov 1, 2023
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Nov 2, 2023
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Nov 2, 2023
This matches the behaviour of MINIMAL_RUNTIME, and supports the practice of not including asserts in release builds. Also remove the closure externs for `assert` so that closure can correctly error out end `assert` is not defined. Helps with emscripten-core#20504
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Nov 2, 2023
sbc100
added a commit
that referenced
this pull request
Nov 2, 2023
This matches the behaviour of MINIMAL_RUNTIME, and supports the practice of not including asserts in release builds. Also remove the closure externs for `assert` so that closure can correctly error out end `assert` is not defined. Helps with #20504
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Nov 2, 2023
sbc100
added a commit
that referenced
this pull request
Nov 3, 2023
Collaborator
|
The fix landed in #20606 so I think we can close this one. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.");
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^