diff --git a/js/ArgParser.js b/js/ArgParser.js index f4906e41a..3c886ccb1 100755 --- a/js/ArgParser.js +++ b/js/ArgParser.js @@ -16,8 +16,10 @@ Options and their defaults are: noNames: false, cascadeDefaults: false, allowEval: true + sandbox: null globals: null +`sandbox` is the sandbox object used to evaluate JavaScript parameters `globals` is the global variable object provided to evaluated parameters \*/ @@ -26,9 +28,8 @@ Options and their defaults are: /*jslint node: true */ "use strict"; -var sandbox = require("./Sandbox.js").sandbox; - var ArgParser = function(argString,options) { + options = options || {}; var parseToken = function(match,p) { var n; if(match[p]) { // Double quoted @@ -38,7 +39,7 @@ var ArgParser = function(argString,options) { } else if(match[p+2]) { // Double-square-bracket quoted n = match[p+2]; } else if(match[p+3]) { // Double-brace quoted - n = options.allowEval === false ? match[p+3] : sandbox(match[p+3],options.globals); + n = options.allowEval === false ? match[p+3] : options.sandbox.execute(match[p+3],options.globals); } else if(match[p+4]) { // Unquoted n = match[p+4]; } else if(match[p+5]) { // empty quote diff --git a/js/Main.js b/js/Main.js index 6a9e8a7d7..1aff3f947 100644 --- a/js/Main.js +++ b/js/Main.js @@ -14,6 +14,7 @@ var WikiStore = require("./WikiStore.js").WikiStore, tiddlerInput = require("./TiddlerInput.js"), tiddlerOutput = require("./TiddlerOutput.js"), WikiTextProcessor = require("./WikiTextProcessor.js").WikiTextProcessor, + Sandbox = require("./Sandbox.js").Sandbox, Navigators = require("./Navigators.js").Navigators, StoryNavigator = require("./StoryNavigator.js").StoryNavigator; @@ -58,6 +59,9 @@ for(t=0; t> + +<> diff --git a/tiddlywiki5/tiddlywiki5.recipe b/tiddlywiki5/tiddlywiki5.recipe index d9da3d54b..05e913a0f 100644 --- a/tiddlywiki5/tiddlywiki5.recipe +++ b/tiddlywiki5/tiddlywiki5.recipe @@ -3,6 +3,7 @@ copyright: ../copyright.txt style: styles.css recipe: tiddlers/split.recipe +recipe: ../parsers/split.recipe jslib: ../test/tiddlywiki.2.6.5/source/tiddlywiki/jquery/jquery.js @@ -22,14 +23,8 @@ jsmodule: ../js/Navigators.js jsmodule: ../js/StoryNavigator.js jsmodule: ../js/Main.js -jsmodule: ../node_modules/uglify-js/lib/parse-js.js - title: lib/parse-js -jsmodule: ../node_modules/uglify-js/lib/process.js - title: lib/process -jsmodule: ../node_modules/uglify-js/lib/squeeze-more.js - title: lib/squeeze-more -jsmodule: ../node_modules/uglify-js/uglify-js.js - title: uglify-js +jsmodule: ../node_modules/pegjs/lib/peg.js + title: pegjs jsbootstart: BootStart.js jsbootend: BootLoader.js