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

Value methods to assert value kind #50

Merged
merged 7 commits into from
Dec 21, 2020
Merged

Value methods to assert value kind #50

merged 7 commits into from
Dec 21, 2020

Conversation

rogchap
Copy link
Owner

@rogchap rogchap commented Dec 19, 2020

Expanding the API for the Value struct to include checks for the value returned by a run script.
This will pave the way forward for more API's to interact between Go and Javascript.

@rogchap rogchap mentioned this pull request Dec 19, 2020
Copy link
Collaborator

@tmc tmc left a comment

Choose a reason for hiding this comment

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

Love this direction!

@zwass
Copy link

zwass commented Dec 19, 2020

Nice! This looks to be a precursor to being able to extract the values (beyond the existing string method)?

@rogchap
Copy link
Owner Author

rogchap commented Dec 19, 2020

That's right; once I have this PR done, I'll add the ToXXXX methods (as a seperate PR to keep it easier to review)

@rogchap rogchap mentioned this pull request Dec 20, 2020
@rogchap rogchap marked this pull request as ready for review December 21, 2020 00:08
@rogchap rogchap requested a review from tmc December 21, 2020 00:08
@rogchap
Copy link
Owner Author

rogchap commented Dec 21, 2020

Hey @tmc Would you mind giving this a sanity check?

Copy link
Collaborator

@tmc tmc left a comment

Choose a reason for hiding this comment

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

This looks reasonable to me, added a few small comments.

would you mind populating the PR description for posterity's sake?

@@ -1,6 +1,11 @@
name: CI

on: [push, pull_request, workflow_dispatch]
on:
Copy link
Collaborator

Choose a reason for hiding this comment

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

did you mean to change this to only run on master? it seems like this should run on any push.

nit: whitespace at EOL

Copy link
Owner Author

Choose a reason for hiding this comment

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

This is a quirk of GitHub actions. I previously had just push but that does not work for pushes to forks, so I added pull_request but now if I (and only people that can push directly to this repo) submit a pull request the tests get run twice: Once for push and again for pull_request.
There should be no other branches other than master that should need to run the test unless you are creating a pull request. If you really need to then that's what workflow_dispatch will allow, but is a manual process.

v8go.cc Outdated
void ValueDispose(ValuePtr ptr) {
delete static_cast<m_value*>(ptr);
delete static_cast<m_value*>(ptr);
Copy link
Collaborator

Choose a reason for hiding this comment

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

would love to get clangtidy/otherwise in here to standardize the non-go code formatting as well.

Copy link
Owner Author

@rogchap rogchap Dec 21, 2020

Choose a reason for hiding this comment

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

Agree; I did format the whole file, but I thought that was too much of a change to add to this PR, so I reverted that. (missed this line though).

I'll look to add a clang-format in a future PR, but if you're ok having a larger PR, then I'll just run my default format for now? or leave as-is? @tmc

Copy link
Owner Author

@rogchap rogchap Dec 21, 2020

Choose a reason for hiding this comment

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

#51 I guess it depends which PR you approve first 😉

Copy link
Collaborator

@tmc tmc left a comment

Choose a reason for hiding this comment

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

LGTM!

@rogchap rogchap merged commit 00a5f9e into master Dec 21, 2020
@rogchap rogchap deleted the value-is branch December 21, 2020 09:24
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