提交 4368d0f4 编写于 作者: B Benjamin Pasero

validate ctor arguments (fixes #35112)

上级 5851b873
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册