提交 a767e5e8 编写于 作者: M Matt Bierner

Add isArray overload to handle simple case where input is a readonly array

isArray should keep the output as readonly
上级 c91fc7f2
......@@ -4,6 +4,8 @@
*--------------------------------------------------------------------------------------------*/
interface ArrayConstructor {
isArray<T>(arg: ReadonlyArray<T> | null | undefined): arg is ReadonlyArray<T>;
isArray<T>(arg: Array<T> | null | undefined): arg is Array<T>;
isArray(arg: any): arg is Array<any>;
isArray<T>(arg: any): arg is Array<T>;
}
\ No newline at end of file
......@@ -92,7 +92,7 @@ export function areWebviewInputOptionsEqual(a: WebviewInputOptions, b: WebviewIn
&& a.retainContextWhenHidden === b.retainContextWhenHidden
&& a.tryRestoreScrollPosition === b.tryRestoreScrollPosition
&& (a.localResourceRoots === b.localResourceRoots || (Array.isArray(a.localResourceRoots) && Array.isArray(b.localResourceRoots) && equals(a.localResourceRoots, b.localResourceRoots, (a, b) => a.toString() === b.toString())))
&& (a.portMapping === b.portMapping || (Array.isArray(a.portMapping) && Array.isArray(b.portMapping) && equals(a.portMapping, b.portMapping, (a, b) => a.from === b.from && a.to === b.to)));
&& (a.portMapping === b.portMapping || (Array.isArray(a.portMapping) && Array.isArray(b.portMapping) && equals(a.portMapping, b.portMapping, (a, b) => a.extensionHostPort === b.extensionHostPort && a.webviewPort === b.webviewPort)));
}
function canRevive(reviver: WebviewReviver, webview: WebviewEditorInput): boolean {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册