-
Notifications
You must be signed in to change notification settings - Fork 17
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
Check enum values before pass to native side. #145
Conversation
f31cea0
to
86fb888
Compare
i rebased this patch. |
@hwanseung Your patch is broken in bots :( |
86fb888
to
d39cd40
Compare
@romandev i fixed it. |
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.
Looks good overall.
I think we don't need to generate enum_types_cpp(.h, .cc).
template/enum_types_header.njk
Outdated
#include <set> | ||
#include <string> | ||
|
||
class EnumTypes { |
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.
IMHO, we don't need to generate this type.
We can just pass the string set into isValidEnum() directly.
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 you means to pass the string set into isVaildEnum() directly in interface_cpp.njk?
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.
Yeah, exactly!
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 changed to pass to the string set as parameter.
generator/main.ts
Outdated
env.renderString(enum_type_cpp_tmpl, {enums: idl_enum})); | ||
} | ||
|
||
// TODO(hwansueng) :: this function should be improved. |
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: // TODO(hwanseung): This function should be improved.
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
Check enum values before pass to native side. ISSUE=lunchclass#80
Check enum values before pass to native side.
ISSUE=#80