From 6238b0a4579539a627d192e0ce2c4a10993aeb8c Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Tue, 23 Jan 2024 23:04:53 +1100 Subject: refactor: port more ops to `ensureFastOps()` (#22046) --- runtime/js/41_prompt.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'runtime/js/41_prompt.js') 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,5 +1,8 @@ // 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, @@ -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}`, ); -- cgit v1.2.3