-
-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support mixins + includes statements #105
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couple of nits, but this looks great!
"static": false, | ||
stringifier: false | ||
}; | ||
const ret = Object.assign({}, EMPTY_OPERATION); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is nice :)
lib/webidl2.js
Outdated
function stringifier(store) { | ||
all_ws(store, "pea"); | ||
if (!consume(ID, "stringifier")) return; | ||
const prefix = "stringifier"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just inline this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
lib/webidl2.js
Outdated
@@ -863,7 +910,7 @@ | |||
} | |||
}; | |||
|
|||
const enum_ = function(store) { | |||
const enum_ = function (store) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: whitespace after function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, the VSCode formatter 😬
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add .vstudio
file at the base... I'm also using code, and we should start formatting this stuff properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, it should be function enum_
instead of const enum_
. Omitted on the previous PR.
@saschanaz, if you are happy to merge this, I'm happy to ship it and add support in ReSpec :) Let me know. |
README.md
Outdated
|
||
```JS | ||
{ | ||
"type": "interface-mixin", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering, maybe we should change this to "interface mixin"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(that would match "callback interface", and would allow me to use the type directly in ReSpec without needing to special case the type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to keep consistency with line-comment
, multiline-comment
, etc., although they are undocumented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Do we want to change them as line comment
, multiline comment
, etc.?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nah, line-comment and multiline-comment are ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes made! (But why not line comment
?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only because that would be a breaking change (e.g., in ReSpec, I have code that already expects "line-comment").
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requesting change on type identifier.
Happy to also make this change, let me know @saschanaz. |
I don't see any problems now so it should be safe to merge 😁 (If you don't see other problems either) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎊
|
(This includes #103)
Fixes #92.
MixinMember only includes stringifiers but not static members, while current
operation()
/attribute()
always include both. This PR pullsstatic_member()
andstringifier()
out ofoperation()
/attribute()
to support mixins + better match the parser structure to the spec.Bonus: This renames nonspecial_operation to regular_operation to match the spec naming.