mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-18 13:51:27 +08:00
Element that is not an instance of a View should not be added to its parent.
This commit is contained in:
@ -988,7 +988,10 @@ export class View extends ProxyObject implements definition.View {
|
|||||||
if (!view) {
|
if (!view) {
|
||||||
throw new Error("Expecting a valid View instance.");
|
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) {
|
if (view._parent) {
|
||||||
throw new Error("View already has a parent. View: " + view + " Parent: " + view._parent);
|
throw new Error("View already has a parent. View: " + view + " Parent: " + view._parent);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user