Skip to content

Commit 14c1e49

Browse files
committed
Code style
1 parent f383395 commit 14c1e49

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

JavaScript/application.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
// File contains a small piece of the source to demonstrate main module
24
// of a sample application to be executed in the sandboxed context by
35
// another pice of code from `framework.js`. Read README.md for tasks.

JavaScript/framework.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
// Example showing us how the framework creates an environment (sandbox) for
24
// appication runtime, load an application code and passes a sandbox into app
35
// as a global context and receives exported application interface
@@ -9,17 +11,17 @@ api.vm = require('vm');
911

1012
// Create a hash and turn it into the sandboxed context which will be
1113
// the global context of an application
12-
let context = { module: {}, console: console };
14+
const context = { module: {}, console };
1315
context.global = context;
14-
let sandbox = api.vm.createContext(context);
16+
const sandbox = api.vm.createContext(context);
1517

1618
// Read an application source code from the file
17-
let fileName = './application.js';
19+
const fileName = './application.js';
1820
api.fs.readFile(fileName, (err, src) => {
1921
// We need to handle errors here
2022

2123
// Run an application in sandboxed context
22-
let script = api.vm.createScript(src, fileName);
24+
const script = api.vm.createScript(src, fileName);
2325
script.runInNewContext(sandbox);
2426

2527
// We can access a link to exported interface from sandbox.module.exports

0 commit comments

Comments
 (0)