% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/JSContext.R
\docType{data}
\name{JSContext-method-source}
\alias{JSContext-method-source}
\alias{source}
\title{Evaluate JS string or file in the current context}
\format{
An object of class \code{NULL} of length 0.
}
\usage{
source(file = NULL, code = NULL)
}
\arguments{
\item{file}{A path to the JavaScript file to load}

\item{code}{A single string of JavaScript to evaluate}
}
\value{
No return value, called for side effects
}
\description{
Evaluate a provided JavaScript file or string within the initialised context.
Note that this method should only be used for initialising functions or values
within the context, no values are returned from this function. See the \verb{$call()}
method for returning values.
}
\examples{
\dontrun{
ctx <- JSContext$new()
ctx$source(file = "path/to/file.js")
ctx$source(code = "1 + 2")
}
}
\keyword{datasets}
