Skip to content

stringifier as CSSOMString attribute is not allowed #254

@cdoublev

Description

@cdoublev

When generating a wrapper class for CSS MediaList, I get the following error:

/home/vagrant/npm/css/node_modules/webidl2js/lib/constructs/interface.js:341
            throw new Error(`${msg}attribute can only be of type DOMString or USVString`);
                  ^

Error: Invalid stringifier "mediaText" on interface MediaList: attribute can only be of type DOMString or USVString
    at Interface._analyzeMembers (/home/vagrant/npm/css/node_modules/webidl2js/lib/constructs/interface.js:341:19)
    at Interface.toString (/home/vagrant/npm/css/node_modules/webidl2js/lib/constructs/interface.js:1718:12)
    at Transformer._writeFiles (/home/vagrant/npm/css/node_modules/webidl2js/lib/transformer.js:221:24)
    at async Transformer.generate (/home/vagrant/npm/css/node_modules/webidl2js/lib/transformer.js:286:5)
  ...
  stringifier attribute [LegacyNullToEmptyString] CSSOMString mediaText;
  ...

I'm not sure why CSSOMString attribute is not accepted or if it should be accepted, but obviously when appending ... && member.idlType.idlType !== "CSSOMString) ...", it works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions