GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — benchmark: fix punycode test for --without-intl · nodejs/node@18be476

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • benchmark/misc
    • punycode.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎benchmark/misc/punycode.js‎

Copy file name to clipboardExpand all lines: benchmark/misc/punycode.js
+10-4Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
'use strict';
22

33
const common = require('../common.js');
4-
const icu = process.binding('icu');
4+
let icu;
5+
try {
6+
icu = process.binding('icu');
7+
} catch (err) {}
58
const punycode = require('punycode');
69

710
const bench = common.createBenchmark(main, {
8-
method: ['punycode', 'icu'],
11+
method: ['punycode'].concat(icu !== undefined ? ['icu'] : []),
912
n: [1024],
1013
val: [
1114
'افغانستا.icom.museum',
@@ -69,8 +72,11 @@ function main(conf) {
6972
runPunycode(n, val);
7073
break;
7174
case 'icu':
72-
runICU(n, val);
73-
break;
75+
if (icu !== undefined) {
76+
runICU(n, val);
77+
break;
78+
}
79+
// fallthrough
7480
default:
7581
throw new Error('Unexpected method');
7682
}

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.