A reference to eval is treated differently by the compiler. For example, when evaluating code containing block-scoped declarations (e.g., let, const, function, class), the compiler may throw an error complaining that block-scoped declarations are not yet supported outside of strict mode. One possible workaround is to include "use strict"; in the evaluated code.
Alias for
eval
global.Notes
eval
is treated differently by the compiler. For example, when evaluating code containing block-scoped declarations (e.g.,let
,const
,function
,class
), the compiler may throw anerror
complaining that block-scoped declarations are not yet supported outside ofstrict mode
. One possible workaround is to include"use strict";
in the evaluated code.