MCPcopy Create free account
hub / github.com/ICBNetwork/web3-Wallet / makeEvalFunction

Function makeEvalFunction

ses.cjs:5120–5139  ·  view source on GitHub ↗
(safeEvaluate)

Source from the content-addressed store, hash-verified

5118 * @param {Function} safeEvaluate
5119 */
5120const makeEvalFunction= (safeEvaluate)=>{
5121 // We use the the concise method syntax to create an eval without a
5122 // [[Construct]] behavior (such that the invocation "new eval()" throws
5123 // TypeError: eval is not a constructor"), but which still accepts a
5124 // 'this' binding.
5125 const newEval= {
5126 eval(source) {
5127 if( typeof source!== 'string') {
5128 // As per the runtime semantic of PerformEval [ECMAScript 18.2.1.1]:
5129 // If Type(source) is not String, return source.
5130 // TODO Recent proposals from Mike Samuel may change this non-string
5131 // rule. Track.
5132 return source;
5133 }
5134 return safeEvaluate(source);
5135 }}.
5136 eval;
5137
5138 return newEval;
5139 };$h‍_once.makeEvalFunction(makeEvalFunction);
5140})()
5141,
5142// === functors[21] ===

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected