Package-level declarations

Types

Link copied to clipboard
external class Recoverable : SyntaxError

Indicates a recoverable error that a REPLServer can use to support multi-line input.

Link copied to clipboard
sealed external interface REPLCommand
Link copied to clipboard
typealias REPLCommandAction = (text: String) -> Unit
Link copied to clipboard
typealias REPLEval = (evalCmd: String, context: Context, file: String, cb: (err: JsError?, result: Any?) -> Unit) -> Unit
Link copied to clipboard
sealed external interface ReplOptions
Link copied to clipboard
external class REPLServer : _Interface

Instances of repl.REPLServer are created using the {@link start} method or directly using the JavaScript new keyword.

Link copied to clipboard
typealias REPLWriter = (obj: Any?) -> String
Link copied to clipboard
sealed external interface Writer : JsContextFunction<Void?, JsTuple1<Any?>, String>

Properties

Link copied to clipboard
external val REPL_MODE_SLOPPY: Symbol

A flag passed in the REPL options. Evaluates expressions in sloppy mode.

Link copied to clipboard
external val REPL_MODE_STRICT: Symbol

A flag passed in the REPL options. Evaluates expressions in strict mode. This is equivalent to prefacing every repl statement with 'use strict'.

Link copied to clipboard
external val writer: Writer

This is the default "writer" value, if none is passed in the REPL options, and it can be overridden by custom print functions.

Functions

Link copied to clipboard
external fun start(): REPLServer
external fun start(options: String = definedExternally): REPLServer
external fun start(options: ReplOptions = definedExternally): REPLServer

The repl.start() method creates and starts a {@link REPLServer} instance.