mdittmer / web-apis

Playground for better understanding Web APIs
Apache License 2.0
18 stars 10 forks source link

Implement rightMissingConstructor IDL checker. #17

Closed mdittmer closed 7 years ago

mdittmer commented 7 years ago

… Also made pass/fail logging optional in check() helper.

@LoonyBean PTAL.

mdittmer commented 7 years ago

Error-reporting example from /analyze_idl.html#l=181&r=908&i=ANY&c=rightMissingConstructor:

ERRR  Parse "CustomEvent" is missing Constructor.
        Left has constructors: [
  {
    "args": [
      {
        "name": "type",
        "type": {
          "name": "DOMString"
        }
      },
      {
        "name": "eventInitDict",
        "optional": true,
        "type": {
          "name": "CustomEventInit"
        }
      }
    ],
    "name": "Constructor"
  }
]
ERRR  Parse "Document" is missing Constructor.
        Left has constructors: [
  {
    "name": "Constructor"
  }
]
ERRR  Parse "MessageChannel" is missing Constructor.
        Left has constructors: [
  {
    "name": "Constructor"
  }
]
ERRR  Parse "ClipboardEvent" is missing Constructor.
        Left has constructors: [
  {
    "args": [
      {
        "name": "type",
        "type": {
          "name": "DOMString"
        }
      },
      {
        "name": "eventInitDict",
        "optional": true,
        "type": {
          "name": "ClipboardEventInit"
        }
      }
    ],
    "name": "Constructor"
  }
]