diff options
author | Asher Gomez <ashersaupingomez@gmail.com> | 2024-01-23 23:04:53 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-23 17:34:53 +0530 |
commit | 6238b0a4579539a627d192e0ce2c4a10993aeb8c (patch) | |
tree | 32e0afc23890ade44544062deddbb8582595f621 /runtime/js/41_prompt.js | |
parent | 01b6e38bafb4c60a281ba7e854a06a1e8b554bb7 (diff) |
refactor: port more ops to `ensureFastOps()` (#22046)
Diffstat (limited to 'runtime/js/41_prompt.js')
-rw-r--r-- | runtime/js/41_prompt.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/runtime/js/41_prompt.js b/runtime/js/41_prompt.js index e9f10e244..fce1ac9ac 100644 --- a/runtime/js/41_prompt.js +++ b/runtime/js/41_prompt.js @@ -1,6 +1,9 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { core, primordials } from "ext:core/mod.js"; const { + op_read_line_prompt, +} = core.ensureFastOps(); +const { ArrayPrototypePush, StringPrototypeCharCodeAt, Uint8Array, @@ -9,8 +12,6 @@ const { import { isatty } from "ext:runtime/40_tty.js"; import { stdin } from "ext:deno_io/12_io.js"; -const ops = core.ops; - const LF = StringPrototypeCharCodeAt("\n", 0); const CR = StringPrototypeCharCodeAt("\r", 0); @@ -43,7 +44,7 @@ function prompt(message = "Prompt", defaultValue) { return null; } - return ops.op_read_line_prompt( + return op_read_line_prompt( `${message} `, `${defaultValue}`, ); |