From e1c8fe85bdf81dd84d79d40c24e62d3a2f9f8968 Mon Sep 17 00:00:00 2001 From: RuoJia123 <127158875+RuoJia123@users.noreply.github.com> Date: Tue, 7 Mar 2023 10:04:16 -0800 Subject: [PATCH] fix(cdk-experimental/scrolling): throw error rather than string (#26736) (cherry picked from commit 7043a51da122927f63f6ea9c72ba4c28fafcc507) --- src/cdk-experimental/scrolling/auto-size-virtual-scroll.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cdk-experimental/scrolling/auto-size-virtual-scroll.ts b/src/cdk-experimental/scrolling/auto-size-virtual-scroll.ts index 2495ccea55d4..1f5fb1a84610 100644 --- a/src/cdk-experimental/scrolling/auto-size-virtual-scroll.ts +++ b/src/cdk-experimental/scrolling/auto-size-virtual-scroll.ts @@ -183,7 +183,7 @@ export class AutoSizeVirtualScrollStrategy implements VirtualScrollStrategy { */ updateBufferSize(minBufferPx: number, maxBufferPx: number) { if (maxBufferPx < minBufferPx) { - throw 'CDK virtual scroll: maxBufferPx must be greater than or equal to minBufferPx'; + throw Error('CDK virtual scroll: maxBufferPx must be greater than or equal to minBufferPx'); } this._minBufferPx = minBufferPx; this._maxBufferPx = maxBufferPx;