Evaluate script in page frame.

        :param script: The script to evaluate.
8978
def evaluate(self, script):
        
        if WEBENGINE:
            return self.dom.runJavaScript("{}".format(script))
        else:
            return self.dom.evaluateJavaScript("{}".format(script))
1324224
def execute_script(self, name, keys, *args, **options):
        '''
        '''
        script = get_script(name)
        if not script:
            raise redis.RedisError('No such script "%s"' % name)
        address = self.address()
        if address not in all_loaded_scripts:
            all_loaded_scripts[address] = set()
        loaded = all_loaded_scripts[address]
        toload = script.required_scripts.difference(loaded)
        for name in toload:
            s = get_script(name)
            yield self.script_load(s.script)
        loaded.update(toload)
        yield script(self, keys, args, options)
751364
public static Object eval(String script) {
        try {
            return getScriptEngine().eval(script);
        } catch (Exception e) {
            return JMExceptionManager
                    .handleExceptionAndReturnNull(log, e, "eval", script);
        }
    }
1184733
def box(script):
    
    if script.type is BOOLEAN:
        return "Boolean.valueOf(" + text_type(script.expr) + ")"
    elif script.type is INTEGER:
        return "Integer.valueOf(" + text_type(script.expr) + ")"
    elif script.type is NUMBER:
        return "Double.valueOf(" + text_type(script.expr) + ")"
    else:
        return script.expr
906302
function getSoleInlineScript(eligibleScripts) {
  var i, len,
      script = null;
  eligibleScripts = eligibleScripts || scripts;
  for (i = 0, len = eligibleScripts.length; i < len; i++) {
    if (!eligibleScripts[i].hasAttribute("src")) {
      if (script) {
        script = null;
        break;
      }
      script = eligibleScripts[i];
    }
  }
  return script;
}
12345
def eval_py(self, _globals, _locals):
        
        try:
            params = eval(self.script, _globals, _locals)
        except NameError as e:
            raise Exception(
                'Failed to evaluate parameters: {}'
                .format(str(e))
            )
        except ResolutionError as e:
            raise Exception('GetOutput: {}'.format(str(e)))

        return params
775617
def doScript(self, script_name, params=None, return_all=False):
		""""""
		request = [
			uu({'-db': self._db }),
			uu({'-lay': self._layout }),
			uu({'-script': script_name})
		]

		if params:
			request.append(uu({'-script.param': params }))

		request.append(uu({'-findall': '' }))

		result = self._doRequest(request)
		result = FMResultset.FMResultset(result)

		try:
			# Try to return results from the script
			resp = result.resultset if return_all else result.resultset[0]
		except IndexError:
			resp = None

		return resp
1134980
function () {
                    var i, len;

                    // eval scripts.
                    if (data.scripts && data.scripts.length) {
                        for (i = 0, len = data.scripts.length; i < len; i++) {
                            Util.globalEval(data.scripts[i]);
                        }
                    }

                    callback && callback(data);
                }
472559
def script_load(self, script):
        """"""
        sha_digest = sha1(script.encode("utf-8")).hexdigest()
        self.shas[sha_digest] = script
        return sha_digest
908119
private static Object evaluateScript(final ActionContext actionContext, final GraphObject entity, final String engineName, final String script) throws FrameworkException {

		final ScriptEngineManager manager = new ScriptEngineManager();
		ScriptEngine engine = manager.getEngineByName(engineName);

		if (engine == null) {
			List<ScriptEngineFactory> factories = manager.getEngineFactories();

			for (ScriptEngineFactory factory : factories) {

				if (factory.getNames().contains(engineName)) {

					engine = factory.getScriptEngine();
					break;

				}

			}

		}


		if (engine == null) {
			throw new RuntimeException(engineName + " script engine could not be initialized. Check class path.");
		}

		final ScriptContext scriptContext = engine.getContext();
		final Bindings bindings           = new StructrScriptBindings(actionContext, entity);

		if (!(engine instanceof RenjinScriptEngine)) {
			scriptContext.setBindings(bindings, ScriptContext.GLOBAL_SCOPE);
		} else if (engine instanceof  RenjinScriptEngine) {

			engine.put("Structr", new StructrScriptObject(actionContext, entity));

		}

		StringWriter output = new StringWriter();
		scriptContext.setWriter(output);

		try {

			Object extractedValue = engine.eval(script);

			if (output != null && output.toString() != null && output.toString().length() > 0) {
				extractedValue = output.toString();
			}

			return extractedValue;

		} catch (final Throwable e) {

			if (!actionContext.getDisableVerboseExceptionLogging()) {
				logger.error("Error while processing {} script: {}", engineName, script, e);
			}

			throw new FrameworkException(422, e.getMessage());
		}

	}
323628
def script(self):
        """"""
        # The script object is cached, since constructing it may involve
        # a number of string-manipulation operations.
        if getattr(self, '_script', None) is None:
            self._script = self._script__getter()
        return self._script
960275
public Object execute(ExecutableScript script, VariableScope scope) {

    // get script engine
    ScriptEngine scriptEngine = scriptingEngines.getScriptEngineForLanguage(script.getLanguage());

    // create bindings
    Bindings bindings = scriptingEngines.createBindings(scriptEngine, scope);

    return execute(script, scope, bindings, scriptEngine);
  }
582276
def eval_script(self, expr):
    
    ret = self.conn.issue_command("Evaluate", expr)
    return json.loads("[%s]" % ret)[0]
533675
def entrypoint_script(*lines):
    ''
    lines = list(lines)
    if lines and not lines[0].startswith('#!'):
        lines.insert(0, '#!/bin/sh')
    return eval([['entrypoint', '/entrypoint'],
                 ['write-script', '/entrypoint'] + lines])
276615
def run_script(scriptfile):
    ''''''
    try:
        f = open(scriptfile, mode='r')
    except Exception:
        return
    mpstate.console.writeln("Running script %s" % scriptfile)
    sub = mp_substitute.MAVSubstitute()
    for line in f:
        line = line.strip()
        if line == "" or line.startswith('#'):
            continue
        try:
            line = sub.substitute(line, os.environ)
        except mp_substitute.MAVSubstituteError as ex:
            print("Bad variable: %s" % str(ex))
            if mpstate.settings.script_fatal:
                sys.exit(1)
            continue
        if line.startswith('@'):
            line = line[1:]
        else:
            mpstate.console.writeln("-> %s" % line)
        process_stdin(line)
    f.close()
1243133
public Object eval(String source, int lineNo, int columnNo, Object script) throws BSFException {
        try {
            source = convertToValidJavaClassname(source);
            return getEvalShell().evaluate(script.toString(), source);
        } catch (Exception e) {
            throw new BSFException(BSFException.REASON_EXECUTION_ERROR, "exception from Groovy: " + e, e);
        }
    }
116531
public static void writeScriptBlock(ServletRequest req, AbstractRenderAppender results, String script)
    {
        assert(results != null);
        ScriptTag.State state = new ScriptTag.State();
        state.suppressComments = false;
        ScriptTag br = (ScriptTag) TagRenderingBase.Factory.getRendering(TagRenderingBase.SCRIPT_TAG, req);

        results.append("\n");
        br.doStartTag(results, state);
        results.append(script);
        br.doEndTag(results, false);
        results.append("\n");
    }