Skip to content

Make google_search_features.js work on pages without CSS#3

Open
fritz-c wants to merge 1 commit into
puppeteer:masterfrom
fritz-c:patch-1
Open

Make google_search_features.js work on pages without CSS#3
fritz-c wants to merge 1 commit into
puppeteer:masterfrom
fritz-c:patch-1

Conversation

@fritz-c

@fritz-c fritz-c commented Mar 15, 2018

Copy link
Copy Markdown

When no CSS features are used at the specified URL, it exits with an error:

(node:11369) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'reduce' of undefined
    at uniqueByProperty (google_search_features.js:99:34)
    at google_search_features.js:244:22
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:118:7)

The content of the failing page was as follows:

Hi
<script type="text/javascript">
  console.log(['a', 'b'].includes('b') ? 'has b' : 'no b');
</script>

This pull request provides a default argument to one of the utility functions to prevent said reduce errors.

Comment thread google_search_features.js
@@ -95,7 +95,7 @@ const BlinkFeatureNameToCaniuseName = {
* @param {string} propName Property name to filter on.

@ebidel ebidel Mar 15, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

first doc string needs to be {!Array=}, now

@ebidel

ebidel commented Mar 15, 2018

Copy link
Copy Markdown
Contributor

Good catch!

@ebidel

ebidel commented Oct 8, 2018

Copy link
Copy Markdown
Contributor

Ping.

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.

2 participants