summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/punycode.ts
diff options
context:
space:
mode:
authorKenta Moriuchi <moriken@kimamass.com>2024-01-11 07:37:25 +0900
committerGitHub <noreply@github.com>2024-01-10 15:37:25 -0700
commit515a34b4de222e35c7ade1b92614d746e73d4c2e (patch)
tree8284201fc826a33f12597959a8a8be14e0f524bd /ext/node/polyfills/punycode.ts
parentd4893eb51a01c5a692d8ca74a3b8ff95c5fd1d9f (diff)
refactor: use `core.ensureFastOps()` (#21888)
Diffstat (limited to 'ext/node/polyfills/punycode.ts')
-rw-r--r--ext/node/polyfills/punycode.ts18
1 files changed, 12 insertions, 6 deletions
diff --git a/ext/node/polyfills/punycode.ts b/ext/node/polyfills/punycode.ts
index 3c3e18242..53bec2e5e 100644
--- a/ext/node/polyfills/punycode.ts
+++ b/ext/node/polyfills/punycode.ts
@@ -1,23 +1,29 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
-import { ucs2 } from "ext:deno_node/internal/idna.ts";
+import { core } from "ext:core/mod.js";
+const {
+ op_node_idna_domain_to_unicode,
+ op_node_idna_punycode_decode,
+ op_node_idna_punycode_encode,
+ op_node_idna_domain_to_ascii,
+} = core.ensureFastOps();
-const { ops } = globalThis.__bootstrap.core;
+import { ucs2 } from "ext:deno_node/internal/idna.ts";
function toASCII(domain) {
- return ops.op_node_idna_domain_to_ascii(domain);
+ return op_node_idna_domain_to_ascii(domain);
}
function toUnicode(domain) {
- return ops.op_node_idna_domain_to_unicode(domain);
+ return op_node_idna_domain_to_unicode(domain);
}
function decode(domain) {
- return ops.op_node_idna_punycode_decode(domain);
+ return op_node_idna_punycode_decode(domain);
}
function encode(domain) {
- return ops.op_node_idna_punycode_encode(domain);
+ return op_node_idna_punycode_encode(domain);
}
export { decode, encode, toASCII, toUnicode, ucs2 };