mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 11:38:51 +01:00
check parent range when creating selection range, #67872
This commit is contained in:
@@ -1103,6 +1103,10 @@ export class SelectionRange {
|
||||
constructor(range: Range, parent?: SelectionRange) {
|
||||
this.range = range;
|
||||
this.parent = parent;
|
||||
|
||||
if (parent && !parent.range.contains(this.range)) {
|
||||
throw new Error('Invalid argument: parent must contain this range');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user