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

test: use common.hasIntl instead of typeof Intl in Intl v8BreakIterator test #17311

Closed
wants to merge 1 commit into from
Closed

test: use common.hasIntl instead of typeof Intl in Intl v8BreakIterator test #17311

wants to merge 1 commit into from

Conversation

AquiTCD
Copy link
Contributor

@AquiTCD AquiTCD commented Nov 26, 2017

This is a part of Nodefest's Code and Learn nodejs/code-and-learn#72
I replace typeof Intl to common.hasIntl intest/parallel/test-intl-v8BreakIterator.js.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Nov 26, 2017
@@ -3,7 +3,7 @@ const common = require('../common');
const assert = require('assert');
const vm = require('vm');

if (typeof Intl === 'undefined')
if (common.hasIntl === 'undefined')
Copy link
Member

Choose a reason for hiding this comment

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

common.hasIntl returns boolean, it does not match 'undefined'.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for reviewing, I fixed it to expect boolean.

@targos
Copy link
Member

targos commented Nov 26, 2017

@gireeshpunathil gireeshpunathil added the code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. label Nov 26, 2017
@mscdex mscdex added i18n-api Issues and PRs related to the i18n implementation. v8 engine Issues and PRs related to the V8 dependency. labels Nov 26, 2017
jasnell pushed a commit that referenced this pull request Nov 26, 2017
PR-URL: #17311
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Jon Moss <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@jasnell
Copy link
Member

jasnell commented Nov 26, 2017

Landed in 6a99224. Thank you and congrats on your PR to core!

@jasnell jasnell closed this Nov 26, 2017
@AquiTCD AquiTCD deleted the replace-to-common-from-typeof branch November 26, 2017 22:32
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
PR-URL: #17311
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Jon Moss <[email protected]>
Reviewed-By: James M Snell <[email protected]>
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
PR-URL: #17311
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Jon Moss <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Dec 12, 2017
@gibfahn
Copy link
Member

gibfahn commented Dec 19, 2017

@bnoordhuis I see you made the change this commit undoes in 668ad44, is there a reason you didn't keep common.hasIntl there?

-if (!common.hasIntl || Intl.v8BreakIterator === undefined)
+if (typeof Intl === 'undefined')

Just checking there isn't a problem with it here.

(This commit depends on #15238, so shouldn't be backported anyway)

@bnoordhuis
Copy link
Member

I changed it because the test tests properties from the Intl object and typeof Intl is the most direct way to check its presence. But uniformity is good, I suppose, if boring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. i18n-api Issues and PRs related to the i18n implementation. test Issues and PRs related to the tests. v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
Development

Successfully merging this pull request may close these issues.