diff options
Diffstat (limited to 'ext/node/polyfills/punycode.ts')
-rw-r--r-- | ext/node/polyfills/punycode.ts | 18 |
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 }; |