summaryrefslogtreecommitdiffstats
path: root/node_modules/vm-browserify/example/run/entry.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/vm-browserify/example/run/entry.js')
-rw-r--r--node_modules/vm-browserify/example/run/entry.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/node_modules/vm-browserify/example/run/entry.js b/node_modules/vm-browserify/example/run/entry.js
new file mode 100644
index 0000000..def1376
--- /dev/null
+++ b/node_modules/vm-browserify/example/run/entry.js
@@ -0,0 +1,6 @@
+var vm = require('vm');
+
+window.addEventListener('load', function () {
+ var res = vm.runInNewContext('a + 5', { a : 100 });
+ document.querySelector('#res').textContent = res;
+});