mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 21:01:34 +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) {
|
||||
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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user