You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constnoEvaluators=!evalAllowed&&!functionAllowed;// eval() itself and the Function() constructor are not allowed to execute.
280
280
281
281
hostEvaluators==='all'&&
282
-
assert(
283
-
!noEvaluators,
284
-
"'hostEvaluators' was set to 'all', but the Function() constructor and eval() are not allowed to execute (SES_DIRECT_EVAL)",
285
-
);
282
+
noEvaluators&&
283
+
Fail`'hostEvaluators' was set to 'all', but the Function() constructor and eval() are not allowed to execute (SES_DIRECT_EVAL)`;
286
284
287
285
hostEvaluators==='none'&&
288
-
assert(
289
-
noEvaluators,
290
-
"'hostEvaluators' was set to 'none', but the Function() constructor and eval() are allowed to execute (SES_DIRECT_EVAL)",
291
-
);
286
+
!noEvaluators&&
287
+
Fail`'hostEvaluators' was set to 'none', but the Function() constructor and eval() are allowed to execute (SES_DIRECT_EVAL)`;
292
288
293
289
hostEvaluators==='no-direct'&&
294
-
assert(
295
-
!directEvalAllowed,
296
-
`'hostEvaluators' was set to 'no-direct', but ${directEvalAllowed===true ? 'direct eval is functional' : 'the Function() constructor and eval() are not allowed to execute'} (SES_DIRECT_EVAL)`,
297
-
);
290
+
directEvalAllowed&&
291
+
Fail`'hostEvaluators' was set to 'no-direct', but ${directEvalAllowed===true ? 'direct eval is functional' : 'the Function() constructor and eval() are not allowed to execute'} (SES_DIRECT_EVAL)`;
298
292
299
293
// TODO: Remove '_legacy' when 'all' introduced as the new default option (breaking change).
300
294
// For backwards compatibility under '_legacy', we do not error with a strict CSP, since directEvalAllowed remains undefined.
0 commit comments