Skip to content
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

Generate JSTypeTraits by macro functions #123

Merged
merged 1 commit into from
Oct 8, 2017

Conversation

corona10
Copy link
Contributor

@corona10 corona10 commented Oct 8, 2017

Generate JSTypeTraits by macro functions

In the future, we can auto-generate js_type_traits during bacardi build time by using some information of types with template.

e.g
types = {
  'Number': {
    int32_t,
    int64_t,
    float,
    long
    .
    .
  },
  'String': {
     char*,
     std::string,
     .
   }
  
}

And this is the just pseudo code for concept.

if type in types['Number']:
   generate("JS_TYPE_TRAITS_NUMBER("+type+")");

if type in types['String']:
   generate("JS_TYPE_TRAITS_STRING("+type+")");

ISSUE=#120

@corona10
Copy link
Contributor Author

corona10 commented Oct 8, 2017

I am working on next step also :)

Copy link
Member

@romandev romandev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@romandev romandev merged commit 0190d3b into lunchclass:master Oct 8, 2017
@corona10 corona10 deleted the js_types branch October 8, 2017 14:47
romandev pushed a commit that referenced this pull request Oct 18, 2017
Generate JSTypeTraits by macro functions

In the future, we can auto-generate js_type_traits during bacardi build
time by using some information of types with template.

e.g
types = {
  'Number': {
    int32_t,
    int64_t,
    float,
    long
    .
    .
  },
  'String': {
     char*,
     std::string,
     .
   }
  
}
And this is the just pseudo code for concept.

if type in types['Number']:
   generate("JS_TYPE_TRAITS_NUMBER("+type+")");

if type in types['String']:
   generate("JS_TYPE_TRAITS_STRING("+type+")");

ISSUE=#120
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants