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

Fix uncaught TypeError in ext/console (css styling) #13567

Merged
merged 1 commit into from
Feb 6, 2022

Conversation

zachauten
Copy link
Contributor

When using css coloring in the console, non-color values should be ignored rather than throw exceptions.
Fixes #13469

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zachauten
Thanks for the contribution!

Confirmed this fixes the bug. Nice!

But I think we need another test case like the below to check an invalid color doesn't cause the uncaught error:

Deno.test(function consoleLogShouldNotThrowErrorWhenInvalidCssColorsAreGiven() {
  mockConsole((console, out) => {
    console.log("%cfoo", "color: foo; background-color: bar;");
    assertEquals(out.toString(), "foo\n");
  });
});

@lucacasonato
Copy link
Member

@zachauten Do you want to add that test case, or finish this PR up for you?

When using css coloring in the console, non-color values should be ignored rather than throw exceptions.
Fixes denoland#13469
@zachauten
Copy link
Contributor Author

@kt3k @lucacasonato Added!

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zachauten Thanks for the update! LGTM

@kt3k kt3k merged commit a7850d7 into denoland:main Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Uncaught TypeError in ext/console
3 participants