Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(compiler): replace instanceof Array with Array.isArray #33076

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/compiler/src/aot/static_reflector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 (<any>expression)) {
// Check for a spread expression
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(', ') + ']';
}

Expand Down