Skip to content
This repository has been archived by the owner on Jun 4, 2022. It is now read-only.

Strict mode issues #225

Open
anmonteiro opened this issue Aug 2, 2017 · 2 comments
Open

Strict mode issues #225

anmonteiro opened this issue Aug 2, 2017 · 2 comments

Comments

@anmonteiro
Copy link
Owner

Currently Lumo sets strict mode by default.

A number of people have run into this problem importing some libraries, so we could rethink the default (easy onboarding vs. slight perf gain).

As suggested by @SevereOverfl0w on Slack, we may be able to override the error message to point to the documentation on how to disable strict mode.

@vemv
Copy link

vemv commented Jul 29, 2018

The current approach for disabling the flag (having to invoke some code) appears to be less than ideal, given that that solution cannot be self-contained.

i.e. the following won't work:

(ns my.ns
  (:require [pinpointer.core] ;; <------ (uses eval)
  ))

(def v8 (js/require "v8"))
(.setFlagsFromString v8 "--no-use_strict")

(pinpointer.core/do-something-with-it)

...This doesn't work because the require is placed before the .setFlagsFromString call.

So one, as a library author, cannot reasonably tell consumers "please place this snippet before invocation". That's quite clearly repetitive and error-prone: for example at work we have a number of Lumo scripts, and prepending the snippet to each of them would be undesirable.

A cleaner API would be to have a command line flag and/or a global dotfile, don't you agree?

Thanks - Victor

@arichiardi
Copy link
Collaborator

arichiardi commented Jul 29, 2018

I personally agree.

EDIT: sorry for closing, was a mobile glitch

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants