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

Added KindsOf method to Value type #37

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

afinch7
Copy link

@afinch7 afinch7 commented Nov 30, 2018

Pretty simple stuff just added a KindsOf method for the Value type, and a KindList type with a method String.

Should allow for a little better error reporting from bound functions.

I.E.

func someBoundMethod(in v8.CallbackArgs) (*v8.Value, error) {
    if !in.Arg(0).IsKind(v8.KindString) {
	return nil, errors.New("Expected String type for arg 0 but got: " + in.Arg(0).KindsOf().String() + ".")
    }
} 

I would imagine there are other uses this is just the one that motivated me to make this pr.

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.

None yet

1 participant