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

Add (Basic) getter methods for the v8 value struct #59

Merged
merged 10 commits into from
Jan 14, 2021
Merged

Conversation

rogchap
Copy link
Owner

@rogchap rogchap commented Dec 22, 2020

This will enable getting of richer data types from the v8 value struct than just currently string

All the basic ToXXX methods have been implemented as defined here:
https://v8.github.io/api/head/classv8_1_1Value.html#a838af7d16f0ce87b4411beb178383db4

However ToBigInt() and ToObject() have NOT yet been implemented. The reason is that Object represents everything that is not a primitive type: eg. Functions, Objects, Promises, Dates, Regex etc. Implementing all of the Object type would make this PR too large, and take quite a bit of time to implement.

Was hoping to include this PR in the next release, which already has a number of features people are waiting for to be released.

As such, I think it's best to un-export these methods (to not break the public API), get this PR merged, do a release and continue work on Object (and BigInt) in later PRs.

@rogchap rogchap mentioned this pull request Dec 22, 2020
@rogchap rogchap changed the title Add getter methods for the v8 value struct Add (Basic) getter methods for the v8 value struct Jan 13, 2021
@rogchap rogchap marked this pull request as ready for review January 13, 2021 10:10
@rogchap rogchap requested a review from tmc January 13, 2021 10:11
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 great! We should consider issues for the bigInt and object implementations. I like the fmt.Formatter support addition.

@rogchap
Copy link
Owner Author

rogchap commented Jan 14, 2021

@tmc Thanks. I've added those two issues as suggested. ☝️

@rogchap rogchap merged commit 27cd225 into master Jan 14, 2021
@rogchap rogchap deleted the value-to branch January 14, 2021 05:11
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