add doc comments to explicitly state what the default setting is

This commit is contained in:
Gered 2014-02-20 18:12:10 -05:00
parent 19aab9c19d
commit 17c97d5135
2 changed files with 5 additions and 2 deletions

View file

@ -13,7 +13,8 @@
(defn toggle-dynamic-scope! [enable]
"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))
(defn with-context [fun]

View file

@ -4,7 +4,9 @@ import org.mozilla.javascript.Context;
import org.mozilla.javascript.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) {
useDynamicScope = enable;