Root reference #5

Merged
merged 4 commits into from Jul 31, 2011

Projects

None yet

2 participants

@benatkin
Contributor

Found another issue - a JSONPointer can also reference the root. Getting the root ought to work as the API is now. Setting the root doesn't work because in JavaScript parameters are passed by value. I added an throw statement with a message that could probably be worded better.

One way to make setting the root work in practice would be to return the entire modified object instead of the old node value, and suggest that the caller use that. Then it would make sense to get rid of the exception message.

Now that I think about it, I'm not crazy about the exception on set. I'm going to add another commit to remove that exception.

@janl janl merged commit 14789fd into janl:master Jul 31, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment