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

Modified extend to take into account primitive and absent values #2810

Merged
merged 2 commits into from
Jun 26, 2017
Merged

Modified extend to take into account primitive and absent values #2810

merged 2 commits into from
Jun 26, 2017

Conversation

delapuente
Copy link
Contributor

@delapuente delapuente commented Jun 22, 2017

Fix #2809

With the addition of the extend() function, the extension mechanism can consider the cases in which the component is absent or is of a primitive type:

  1. If both base and extension are absent, extend() will return undefined.
  2. Else, If base or extension is absent, extend() will returns a copy of the other.
  3. Else, If none of them is absent and both are pure JS objects, the second will extend the first as usual.
  4. Finally, the extension is preferred so a copy of it is returned.

@ngokevin
Copy link
Member

Can you post example code which this PR might address? Will help clarify the case, thanks!

@dmarcos
Copy link
Member

dmarcos commented Jun 23, 2017

I would add a test with the case that this PR fixes

@ngokevin ngokevin merged commit 5dd553e into aframevr:master Jun 26, 2017
@ngokevin
Copy link
Member

added the tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants