add doc comments to explicitly state what the default setting is
This commit is contained in:
parent
19aab9c19d
commit
17c97d5135
|
@ -13,7 +13,8 @@
|
||||||
|
|
||||||
(defn toggle-dynamic-scope! [enable]
|
(defn toggle-dynamic-scope! [enable]
|
||||||
"enables/disables creation of either 'normal' scopes or dynamic scopes. this
|
"enables/disables creation of either 'normal' scopes or dynamic scopes. this
|
||||||
will only affect scopes that are created after calling this function."
|
will only affect scopes that are created after calling this function. the
|
||||||
|
default setting is to create non-dynamic scopes."
|
||||||
(DynamicScopeContextFactory/toggleDynamicScopeCreation enable))
|
(DynamicScopeContextFactory/toggleDynamicScopeCreation enable))
|
||||||
|
|
||||||
(defn with-context [fun]
|
(defn with-context [fun]
|
||||||
|
|
|
@ -4,7 +4,9 @@ import org.mozilla.javascript.Context;
|
||||||
import org.mozilla.javascript.ContextFactory;
|
import org.mozilla.javascript.ContextFactory;
|
||||||
|
|
||||||
public class DynamicScopeContextFactory extends ContextFactory {
|
public class DynamicScopeContextFactory extends ContextFactory {
|
||||||
static boolean useDynamicScope;
|
// default is to use non-dynamic scopes, which is to maintain compatibility with how clj-rhino worked
|
||||||
|
// before this addition
|
||||||
|
static boolean useDynamicScope = false;
|
||||||
|
|
||||||
public static boolean toggleDynamicScopeCreation(boolean enable) {
|
public static boolean toggleDynamicScopeCreation(boolean enable) {
|
||||||
useDynamicScope = enable;
|
useDynamicScope = enable;
|
||||||
|
|
Reference in a new issue