7 examples of 'javascript execute string' in JavaScript

Every line of 'javascript execute string' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
46return function executeCode(str) {
47 (contexts || []).forEach((c) => Object.keys(c).forEach((key) => {
48 if (!this[key]) {
49 this[key] = c[key];
50 }
51 }));
52 return eval(str);
53}.call({}, source);
210function evaluate(str) {
211 var v = +str;
212 if (str.indexOf("/") >= 0) {
213 var args = str.split("/");
214 v = +args[0] / +args[1];
215 }
216 return str;
217}
847function execute(text)
848{
849 eval(text);
850}
7function runWithString(string) {
8 try {
9 var out = {
10 html: htmldecode(string),
11 url: decodeURIComponent(string),
12 base64: Base64.decode(string),
13 utf8: unescape(string)
14 };
15
16 return [
17 { title: out.html,
18 actionArgument: out.html,
19 subtitle: "HTML decoded",
20 icon: "html" },
21 { title: out.url,
22 actionArgument: out.url,
23 subtitle: "URL decoded",
24 icon: "url" },
25 { title: out.base64,
26 actionArgument: out.base64,
27 subtitle: "Base64 decoded",
28 icon: "base64" },
29 { title: out.utf8,
30 actionArgument: out.utf8,
31 subtitle: "UTF-8 decoded",
32 icon: "utf8" },
33 ];
34 } catch (err) {
35 Notify.error(err);
36 }
37}
129value: function execute(code) {
130 return this._driver.executeScript(code);
131}
30async execute(context: ScriptContext, args: Args): Promise {
31 return this.executeTasks('serial');
32}
355exec: function stringLiteralExec(args, astArgs, ctx: ExecContext) {
356 return args[0][0];
357}

Related snippets