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

Rename should throw an error for invalid property . #45

Merged
merged 2 commits into from Mar 19, 2014

Conversation

@adityabakle
Copy link
Contributor

adityabakle commented Mar 15, 2014

Error should be throw when rename is invoked on a property which does not exist in the object.
This will avoid making a valid property undefined.
e.g

var obj = {a: 1, b:2};
Hoek.rename(obj, 'd', 'a');  // --> Should throw an error that 'd' is not a valid property.
console.log(obj); 
// result {a:undefined, b:2}
adityabakle added 2 commits Mar 15, 2014
This will avoid the case of making a valid property `undefined`.
@hueniverse hueniverse added the bug label Mar 19, 2014
@hueniverse hueniverse added this to the 1.5.2 milestone Mar 19, 2014
@hueniverse hueniverse self-assigned this Mar 19, 2014
hueniverse added a commit that referenced this pull request Mar 19, 2014
Rename should throw an error for invalid property .
@hueniverse hueniverse merged commit 7b14ca4 into hapijs:master Mar 19, 2014
1 check passed
1 check passed
default The Travis CI build passed
Details
hueniverse added a commit that referenced this pull request Mar 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.