MCPcopy
hub / github.com/patriksimek/vm2 / _compile

Method _compile

lib/script.js:334–342  ·  view source on GitHub ↗

* Compiles this script to a vm.Script. * * @private * @param {string} prefix - JavaScript code that will be used as prefix. * @param {string} suffix - JavaScript code that will be used as suffix. * @return {vm.Script} The compiled vm.Script. * @throws {SyntaxError} If there is a syntax e

(prefix, suffix)

Source from the content-addressed store, hash-verified

332 * @throws {SyntaxError} If there is a syntax error in the script.
333 */
334 _compile(prefix, suffix) {
335 return new Script(prefix + this.getCompiledCode() + suffix, {
336 __proto__: null,
337 filename: this.filename,
338 displayErrors: false,
339 lineOffset: this.lineOffset,
340 columnOffset: this.columnOffset
341 });
342 }
343
344 /**
345 * Will return the cached version of the script intended for VM or compile it.

Callers 3

_compileVMMethod · 0.95
_compileNodeVMMethod · 0.95
_compileNodeVMStrictMethod · 0.95

Calls 1

getCompiledCodeMethod · 0.95

Tested by

no test coverage detected