Clojurians
#lumo
<
2017-04-24
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

cgrand10:04:51

(fn [eval x] (eval x)) <= error because of eval and strict mode, is there a workaround other than renaming?

dominicm10:04:04

@cgrand You mean js strict mode? Turn off strict mode.

cgrand10:04:35

I guess it’s an option to the compiler?

dominicm10:04:48

@cgrand You can turn it off in a similar way

dominicm10:04:52

Lemme find the snippet

dominicm10:04:23

(.setFlagsFromString (nodejs/require "v8") "--no-use_strict")

cgrand10:04:43

I did (.setFlagsFromString js/v8 "--nouse_strict")

dominicm10:04:03

does that work? :thinking_face:

cgrand10:04:24

cljs.user=> (fn [eval x] (eval x))
SyntaxError: Unexpected eval or arguments in strict mode
cljs.user=> (.setFlagsFromString js/v8 "--nouse_strict")
nil
cljs.user=> (fn [eval x] (eval x))
#object[Function "function (eval,x){
return eval.call(null,x);
}"]

dominicm10:04:28

Interesting. Node let's you do anything :stuck_out_tongue: