/**
         * Gets a new value.
         */
        public Value containsKey(Value key)
        {
            EnvVar var = _env.getGlobalEnv().get(key.ToStringValue());

            if (var != null)
            {
                return(var.get());
            }
            else
            {
                return(null);
            }
        }
Esempio n. 2
0
        private void saveGlobals(Env env, Map <StringValue, EnvVar> globalMap)
        {
            _globalValues = new Value[globalMap.size()];

            for (Map.Entry <StringValue, EnvVar> entry : globalMap.entrySet())
            {
                if (env.isSpecialVar(entry.getKey()))
                {
                    continue;
                }

                EnvVar envVar = entry.getValue();

                int id = addGlobalName(entry.getKey());

                _globalValues[id] = envVar.get().copy(env);
            }
        }