-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Description
I try to use a ES6 Map inside library code like this:
// library_webgpu.js
var LibraryWebGPU = {
$WebGPU__deps: [],
$WebGPU: {
Internals: {
+ buffers: new Map(),
...
},
...
},
};
autoAddDeps(LibraryWebGPU, '$WebGPU');
mergeInto(LibraryManager.library, LibraryWebGPU);
And the final generated JS files is like this:
var WebGPU = {
Internals: {
buffers: {},
This will cause the following error later:
Uncaught TypeError: buffers.set is not a function
I tried to figure out whether this is an expected behavior, but didn't see document about this. And I don't understand why this behavior happens. If this is expected behavior (re-writing a Map to a plain object), is there a way to use ES6 Map in library code?
Metadata
Metadata
Assignees
Labels
No labels