How to use the cwlts/models.ExpressionEvaluator.evaluateExpression function in cwlts

To help you get started, we’ve selected a few cwlts examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rabix / composer / src / app / services / javascript-eval / javascript-eval.service.ts View on Github external
this.iFrame = document.createElement("iframe");

        const perm                = ["allow-same-origin", "allow-scripts"];
        this.iFrame.style.display = "none";
        this.iFrame.sandbox       = perm.join(" ");

        this.iFrame.onload = () => {
            this.iFrame.contentWindow.document.open("text/html", "replace");
            this.iFrame.contentWindow.document.write(this.iframeContent());
            this.iFrame.contentWindow.document.close();
        };

        document.body.appendChild(this.iFrame);

        // FIXME We have to improve this
        ExpressionEvaluator.evaluateExpression = this.evaluateCode.bind(this);
    }