Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add assertions to emscriptenGetAudioObject. NFC#25914

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
sbc100 wants to merge1 commit intoemscripten-core:main
base:main
Choose a base branch
Loading
fromsbc100:emscriptenGetAudioObject

Conversation

@sbc100
Copy link
Collaborator

@sbc100sbc100 commentedDec 8, 2025
edited
Loading

This API was added when audioworklets were first added, but it doesn't
look like it was intended to work with invalid inputs:5402fc9.

At least none of the original usages in5402fc9 checked for

@sbc100sbc100force-pushed theemscriptenGetAudioObject branch from8e311af to587a47fCompareDecember 8, 2025 22:05
This API was added when audioworklets were first added, but it doesn'tlook like it was intended to work with invalid inputs:5402fc9.At least none of the original usages in5402fc9 checked forundefined return values.
@sbc100sbc100force-pushed theemscriptenGetAudioObject branch from587a47f to60e5204CompareDecember 8, 2025 22:12
$emscriptenGetAudioObject:(objectHandle)=>{
#ifASSERTIONS||WEBAUDIO_DEBUG
emAudioExpectNodeOrContext(objectHandle,'emscriptenGetAudioObject');
#endif
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The above call toemAudioExpectNodeOrContext() seems restrictive.

It prevents users from testing if a given handle has been deleted? E.g. one would not be able to write code like this anymore:

if (emscriptenGetAudioObject(someHandle)) {  console.log('someHandle exists, accessing it...');} else {  console.log('someHandle has been deleted, doing something else (maybe deinitializing some JS side structure at shutdown?)');}

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Indeed, that is the idea. None of our use cases for the API seems to use it in this way, and none of the other APIs in the this file allow invalid handles to be passed. Unless there is specific use case for allowing invalid handles here I suggest we be consistent. (At least until someone asks for this ability).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'd be interested to know how others are using the API. I agree with putting the test with the handle request, but I only see my own use cases.

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'm only aware of the uses within the test code, but maybe you could find more via a github global search or some such?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@jujjujjuj left review comments

@cwoffendencwoffendenAwaiting requested review from cwoffenden

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@sbc100@juj@cwoffenden

[8]ページ先頭

©2009-2025 Movatter.jp