refactor(compiler): replace instanceof Array (#33076)

PR Close #33076
This commit is contained in:
Nikita Potapenko 2019-10-10 11:58:39 +03:00 committed by Miško Hevery
parent 6ab5f3648a
commit b0834fe962
2 changed files with 2 additions and 2 deletions

View File

@ -575,7 +575,7 @@ export class StaticReflector implements CompileReflector {
if (isPrimitive(expression)) { if (isPrimitive(expression)) {
return expression; return expression;
} }
if (expression instanceof Array) { if (Array.isArray(expression)) {
const result: any[] = []; const result: any[] = [];
for (const item of (<any>expression)) { for (const item of (<any>expression)) {
// Check for a spread expression // Check for a spread expression

View File

@ -168,7 +168,7 @@ export function stringify(token: any): string {
return token; return token;
} }
if (token instanceof Array) { if (Array.isArray(token)) {
return '[' + token.map(stringify).join(', ') + ']'; return '[' + token.map(stringify).join(', ') + ']';
} }