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

JSContext-method-validateR Documentation

Assess validity of JS code without evaluating

Description

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

Usage

validate(code_string)

Arguments

code_string

The JS code to check

Format

An object of class NULL of length 0.

Value

A boolean indicating whether code is valid

Examples

## Not run: 
ctx <- JSContext$new()
ctx$validate("1 + 2")

## End(Not run)

QuickJSR documentation built on April 13, 2025, 5:12 p.m.