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

perf_hooks: fix error message for invalid entryTypes #33285

Closed
wants to merge 1 commit into from

Conversation

targos
Copy link
Member

@targos targos commented May 7, 2020

Will now print a more meaningful value instead of always "[object Object]".

Will now print a more meaningful value instead of always [object Object]
@nodejs-github-bot nodejs-github-bot added the perf_hooks Issues and PRs related to the implementation of the Performance Timing API. label May 7, 2020
@@ -341,19 +341,20 @@ class PerformanceObserver extends AsyncResource {
if (typeof options !== 'object' || options === null) {
throw new ERR_INVALID_ARG_TYPE('options', 'Object', options);
}
if (!ArrayIsArray(options.entryTypes)) {
throw new ERR_INVALID_OPT_VALUE('entryTypes', options);
const { entryTypes } = options;
Copy link
Member Author

Choose a reason for hiding this comment

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

this is to prevent accessing the value more than once (it could be a getter that doesn't always return the same thing)

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented May 7, 2020

CI: https://ci.nodejs.org/job/node-test-pull-request/31212/ (:yellow_heart:)

targos added a commit that referenced this pull request May 10, 2020
Will now print a more meaningful value instead of always [object Object]

PR-URL: #33285
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
@targos
Copy link
Member Author

targos commented May 10, 2020

Landed in 1182539

@targos targos closed this May 10, 2020
@targos targos deleted the fix-entrytypes-error branch May 10, 2020 11:53
codebytere pushed a commit that referenced this pull request May 11, 2020
Will now print a more meaningful value instead of always [object Object]

PR-URL: #33285
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
@codebytere codebytere mentioned this pull request May 18, 2020
codebytere pushed a commit that referenced this pull request Jun 7, 2020
Will now print a more meaningful value instead of always [object Object]

PR-URL: #33285
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
@codebytere codebytere mentioned this pull request Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf_hooks Issues and PRs related to the implementation of the Performance Timing API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants