mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 11:08:51 +01:00
validate ctor arguments (fixes #35112)
This commit is contained in:
@@ -1452,6 +1452,16 @@ export class RelativePattern implements IRelativePattern {
|
||||
pattern: string;
|
||||
|
||||
constructor(base: vscode.WorkspaceFolder | string, pattern: string) {
|
||||
if (typeof base !== 'string') {
|
||||
if (!base || !URI.isUri(base.uri)) {
|
||||
throw illegalArgument('base');
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof pattern !== 'string') {
|
||||
throw illegalArgument('pattern');
|
||||
}
|
||||
|
||||
this.base = typeof base === 'string' ? base : base.uri.fsPath;
|
||||
this.pattern = pattern;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user