MCPcopy Create free account
hub / github.com/OpenIntroStat/ims / tryEval

Function tryEval

libs/htmlwidgets-1.5.3/htmlwidgets.js:249–268  ·  view source on GitHub ↗
(code)

Source from the content-addressed store, hash-verified

247 // an expression that eval() can parse
248 // (otherwise, a SyntaxError is thrown)
249 function tryEval(code) {
250 var result = null;
251 try {
252 result = eval("(" + code + ")");
253 } catch(error) {
254 if (!error instanceof SyntaxError) {
255 throw error;
256 }
257 try {
258 result = eval(code);
259 } catch(e) {
260 if (e instanceof SyntaxError) {
261 throw error;
262 } else {
263 throw e;
264 }
265 }
266 }
267 return result;
268 }
269
270 function initSizing(el) {
271 var sizing = sizingPolicy(el);

Callers 2

evalAndRunFunction · 0.85
htmlwidgets.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected