Skip to content

WebIDL's window.window method violates newer component creation rules #719

Open
@vados-cosmonic

Description

@vados-cosmonic

It looks like the WebIDL example code that we have now runs afoul of newer wasm-tools:

Error: error while executing [/path/to/.fnm/node-versions/v23.9.0/installation/bin/node --no-warnings --experimental-wasm-jspi --stack-trace-limit=100 --conditions node --conditions development src/jco.js componentize test/fixtures/idl/dom.test.js -d clocks -d random -d stdio -w test/fixtures/idl/dom.wit -n window-test -o /tmp/VwfGqC/out-component-file]:
ComponentError: Failed to decode Wasm
decoding custom section component-type

Caused by:
    export name `[method]window.window` conflicts with previous name `window` (at offset 0x28)
    at componentNew (file:///path/to/jco/packages/jco/obj/wasm-tools.js:3744:11)
    at componentNew (file:///path/to/jco/packages/jco/src/api.js:37:10)
    at async componentize (file:///path/to/jco/node_modules/@bytecodealliance/componentize-js/src/componentize.js:420:5)
    at async componentize (file:///path/to/jco/packages/jco/src/cmd/componentize.js:20:24)
    at async file:///path/to/jco/packages/jco/src/jco.js:228:9

This was discovered during the error context async work, but we'll need to fix this (and possibly fix upstream in webidl2wit) -- it seems that resources can't have methods that are named the exact same thing as the resource itself?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions