From 19994454a555f029edbe616213d6023c8620b57c Mon Sep 17 00:00:00 2001 From: Geoffrey Booth Date: Mon, 9 Oct 2023 20:47:09 -0700 Subject: [PATCH] typings: lib/internal/vm.js --- lib/internal/vm.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/lib/internal/vm.js b/lib/internal/vm.js index f348ef6d2d612f..1503681c4290a9 100644 --- a/lib/internal/vm.js +++ b/lib/internal/vm.js @@ -24,12 +24,35 @@ const { ERR_INVALID_ARG_TYPE, } = require('internal/errors').codes; +/** + * Checks if the given object is a context object. + * @param {object} object - The object to check. + * @returns {boolean} - Returns true if the object is a context object, else false. + */ function isContext(object) { validateObject(object, 'object', kValidateObjectAllowArray); return _isContext(object); } +/** + * Compiles a function from the given code string. + * @param {string} code - The code string to compile. + * @param {string[]} [params] - An optional array of parameter names for the compiled function. + * @param {object} [options] - An optional object containing compilation options. + * @param {string} [options.filename=''] - The filename to use for the compiled function. + * @param {number} [options.columnOffset=0] - The column offset to use for the compiled function. + * @param {number} [options.lineOffset=0] - The line offset to use for the compiled function. + * @param {Buffer} [options.cachedData=undefined] - The cached data to use for the compiled function. + * @param {boolean} [options.produceCachedData=false] - Whether to produce cached data for the compiled function. + * @param {ReturnType