Element that is not an instance of a View should not be added to its parent.

This commit is contained in:
Maya Zhecheva
2016-08-01 16:21:26 +03:00
parent 9d58707da5
commit 17d0172ace

View File

@ -988,7 +988,10 @@ export class View extends ProxyObject implements definition.View {
if (!view) {
throw new Error("Expecting a valid View instance.");
}
if(!(view instanceof View))
{
throw new Error(view + " is not a valid View instance.");
}
if (view._parent) {
throw new Error("View already has a parent. View: " + view + " Parent: " + view._parent);
}