Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dhowe committed Jan 21, 2024
1 parent 8754a38 commit 17bb726
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 851 deletions.
5 changes: 4 additions & 1 deletion src/riscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,13 @@ class RiScript {
* @param {object} [options] - options for the evaluation
* @returns {string}
*/
evaluate(script, context, options = {}) {
evaluate(script, context, options) {
if (typeof script !== 'string') {
throw Error('RiScript.evaluate() expects a string, got ' + typeof script);
}
if (typeof options !== 'object') {
options = {};
}
options.input = script;
options.visitor = new RiScriptVisitor(this, context);
return this._evaluate(options);
Expand Down
4 changes: 3 additions & 1 deletion src/visitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -529,9 +529,11 @@ class RiScriptVisitor extends BaseVisitor {
}
}

// WORKING HERE
if (typeof result === 'object') {
// check for function
console.log("HIT", JSON.stringify(result));

//console.log("HIT", JSON.stringify(result));
}

// do we have more script to deal with ?
Expand Down
Loading

0 comments on commit 17bb726

Please sign in to comment.