You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Dynamic import attributes broken with multiple attributes #50700
changed the title [-]Dynamic `import` attributes broken with custom attributes[/-][+]Dynamic `import` attributes broken with multiple attributes[/+]on Nov 13, 2023
Activity
[-]Dynamic `import` attributes broken with custom attributes[/-][+]Dynamic `import` attributes broken with multiple attributes[/+]targos commentedon Nov 13, 2023
I thought this would be easy to fix when I saw
node/src/module_wrap.cc
Line 256 in 0304da2
But this is not just an off-by-one issue.
For
import(jsModuleDataUrl, { with: { type: 'json', other: 'unsupported' } })(test I added), theraw_attributesarray contains 4 elements.For
import(`data:text/javascript,import${JSON.stringify(jsModuleDataUrl)}with{type:"json"}`)(existing test), it contains 3 elements.targos commentedon Nov 13, 2023
I don't understand how it's possible. The array is guaranteed to have a size that's a multiple of two:
node/deps/v8/src/execution/isolate.cc
Lines 5446 to 5448 in 0304da2
targos commentedon Nov 13, 2023
Debug build makes it a bit more understandable:
targos commentedon Nov 13, 2023
Found the issue: #50703
src: iterate on import attributes array correctly
src: iterate on import attributes array correctly
src: iterate on import attributes array correctly
src: iterate on import attributes array correctly
src: iterate on import attributes array correctly
src: iterate on import attributes array correctly
src: iterate on import attributes array correctly
src: iterate on import attributes array correctly
src: iterate on import attributes array correctly
src: iterate on import attributes array correctly
src: iterate on import attributes array correctly