1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-09 19:39:57 +00:00
TiddlyWiki5/js/Sandbox.js

24 lines
372 B
JavaScript
Raw Normal View History

/*\
title: js/Sandbox.js
Execute a fragment of JavaScript in a sandbox
\*/
(function(){
/*jslint evil: true, node: true */
"use strict";
2011-12-28 22:07:17 +00:00
var pegjs = require("pegjs");
2011-12-28 22:07:17 +00:00
var Sandbox = function(parserText) {
this.parser = pegjs.buildParser(parserText);
};
Sandbox.prototype.parse = function(code) {
return this.parser.parse(code);
};
2011-12-28 22:07:17 +00:00
exports.Sandbox = Sandbox;
})();