Skip to content

Add Closure externs for growable and resizable properties#27244

Open
kleisauke wants to merge 1 commit into
emscripten-core:mainfrom
kleisauke:closure-rab-gsab-properties
Open

Add Closure externs for growable and resizable properties#27244
kleisauke wants to merge 1 commit into
emscripten-core:mainfrom
kleisauke:closure-rab-gsab-properties

Conversation

@kleisauke

Copy link
Copy Markdown
Collaborator

Prevents Closure compiler from mangling the resizable and
growable properties accessed on HEAP8.buffer.

Prevents Closure compiler from mangling the `resizable` and
`growable` properties accessed on `HEAP8.buffer`.
@kleisauke

Copy link
Copy Markdown
Collaborator Author

See:

// If we already have a heap that is resizeable/growable buffer we don't
// need to do anything in updateMemoryViews.
#if SHARED_MEMORY
if (HEAP8?.buffer?.growable) return;
#else
if (HEAP8?.buffer?.resizable) return;
#endif
var b = getMemoryBuffer();

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/resizable
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer/growable

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant