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

Improve some conditional in the builder.js #293

Merged
merged 1 commit into from
Dec 5, 2014

Conversation

okuryu
Copy link
Member

@okuryu okuryu commented Dec 3, 2014

Some conditional in the lib/builder.js have admit of improvement. It'll be more readable and efficient by this changes.

Some conditional in the `lib/builder.js` have admit of improvement.
It'll be more readable and efficient by this changes.
@yahoocla
Copy link

yahoocla commented Dec 3, 2014

CLA is valid!

@okuryu okuryu self-assigned this Dec 3, 2014
@juandopazo
Copy link
Member

Are we sure this is the same logic? How's the coverage for this section?

@okuryu
Copy link
Member Author

okuryu commented Dec 3, 2014

Yep, it's the same logic, and the coverage stay about the same. It actually has 2 conditional changes as follows.

From:

if (k === 'final') {
}
if (k === 'description' || k === 'example') {
}

To:

if (k === 'final') {
} else if (k === 'description' || k === 'example') {
}

From:

if (k1 === 'return') {
    o[k1][k] = self.markdown(v);
} else if (v.forEach || (v instanceof Object)) {
    o[k1][k] = self.augmentData(v);
} else {
    o[k1][k] = self.markdown(v);
}

To:

if (v.forEach || (v instanceof Object)) {
    o[k1][k] = self.augmentData(v);
} else {
    o[k1][k] = self.markdown(v);
}

This is a preparing for supporting @throws syntax in the near future.

@juandopazo
Copy link
Member

👍 awesome.

@throws sounds like Javaaaaaa

@okuryu okuryu merged commit ea7feb1 into yui:master Dec 5, 2014
@okuryu okuryu deleted the improve-conditional branch December 5, 2014 11:24
@okuryu
Copy link
Member Author

okuryu commented Dec 5, 2014

Merged. Thanks!

@okuryu okuryu modified the milestone: v0.5.0 Dec 23, 2014
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.

3 participants