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

object empty key string should be supported #262

Closed
iwind opened this issue Dec 28, 2021 · 0 comments · Fixed by #276
Closed

object empty key string should be supported #262

iwind opened this issue Dec 28, 2021 · 0 comments · Fixed by #276

Comments

@iwind
Copy link
Contributor

iwind commented Dec 28, 2021

To set an object property value, we are able to call Set() method in object.go:

func (o *Object) Set(key string, val interface{}) error {
	if len(key) == 0 {
		return errors.New("v8go: You must provide a valid property key")
	}
        ...
}

But, it does not accept an empty string key, which should be valid in javascript:

let obj = {}
obj[""] = "Empty Key Value" // this will be valid in all of Javascript engines

So, empty string key should be available in v8go.

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 a pull request may close this issue.

1 participant