From b0834fe962b96fc84e5ffbcdb5283b25f74a5c47 Mon Sep 17 00:00:00 2001 From: Nikita Potapenko Date: Thu, 10 Oct 2019 11:58:39 +0300 Subject: [PATCH] refactor(compiler): replace instanceof Array (#33076) PR Close #33076 --- packages/compiler/src/aot/static_reflector.ts | 2 +- packages/compiler/src/util.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/compiler/src/aot/static_reflector.ts b/packages/compiler/src/aot/static_reflector.ts index 1bb58fb4e4..1514f066d2 100644 --- a/packages/compiler/src/aot/static_reflector.ts +++ b/packages/compiler/src/aot/static_reflector.ts @@ -575,7 +575,7 @@ export class StaticReflector implements CompileReflector { if (isPrimitive(expression)) { return expression; } - if (expression instanceof Array) { + if (Array.isArray(expression)) { const result: any[] = []; for (const item of (expression)) { // Check for a spread expression diff --git a/packages/compiler/src/util.ts b/packages/compiler/src/util.ts index e0e5c1d11a..01819f7225 100644 --- a/packages/compiler/src/util.ts +++ b/packages/compiler/src/util.ts @@ -168,7 +168,7 @@ export function stringify(token: any): string { return token; } - if (token instanceof Array) { + if (Array.isArray(token)) { return '[' + token.map(stringify).join(', ') + ']'; }