mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-24 11:20:42 +00:00
Raise an exception if a view is added to itself as a subview.
This is better than a DOM node exception.
This commit is contained in:
@@ -369,6 +369,9 @@ var CPViewFlags = { },
|
||||
/* @ignore */
|
||||
- (void)_insertSubview:(CPView)aSubview atIndex:(int)anIndex
|
||||
{
|
||||
if (aSubview === self)
|
||||
[CPException raise:CPInvalidArgumentException reason:"can't add a view as a subview of itself"];
|
||||
|
||||
// We will have to adjust the z-index of all views starting at this index.
|
||||
var count = _subviews.length;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user