Re: [heycam/webidl] Consider syntactic changes to WebIDL to make it more "JavaScript-y" (#485)

Can I add another but pretty similar/related idea about "constructor" here?

The idea is to declare IDL interface's constructors without using extended attributes.

current syntax:
```WebIDL
[Constructor(),
 Constructor(Arg arg)]
interface X {}
```

proposed syntax (details TBD):
```WebIDL
interface X {
  [ExtAttr1] constructor();
  [ExtAttr2] constructor(Arg arg);
}
```

The key point here is that, with the proposed way above, we can annotate constructors with extended attributes respectively (like `[ExtAttr1]` and `[ExtAttr2]` above).  For example, we can make one of constructors [SecureContext].  (By the way, Chromium team has actual demands to specify Chromium/Blink-specific extended attributes.)

In the above example, I used `constructor` as a keyword, but I'm fine with any syntax as long as we can specify extended attributes.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/485#issuecomment-448537484

Received on Wednesday, 19 December 2018 10:00:10 UTC