Learn R Programming

QuickJSR (version 1.7.0)

JSContext-method-validate: Assess validity of JS code without evaluating

Description

Checks whether JS code string is valid code in the current context

Usage

validate(code_string)

Value

A boolean indicating whether code is valid

Format

An object of class NULL of length 0.

Arguments

code_string

The JS code to check

Examples

Run this code
if (FALSE) {
ctx <- JSContext$new()
ctx$validate("1 + 2")
}

Run the code above in your browser using DataLab