Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #27 from abiank/master

implemented cmdline switches in sc.js
  • Loading branch information...
commit 9d3572f0918de4408da9d9488473f5f1e179223a 2 parents a92fa38 + e490995
@audreyt authored
Showing with 11 additions and 3 deletions.
  1. +11 −3 sc.js
View
14 sc.js
@@ -1,15 +1,23 @@
(function(){
- var vm, fs, path, bootSC, Worker, e;
+ var vm, fs, path, bootSC, Worker, e, wt;
vm = require('vm');
fs = require('fs');
+ argv = require('optimist').argv;
path = require('path');
bootSC = fs.readFileSync(path.dirname(fs.realpathSync(__filename)) + "/SocialCalcModule.js", 'utf8');
global.SC == null && (global.SC = {});
Worker = (function(){
try {
- return require('webworker-threads').Worker;
+ wt = require('webworker-threads').Worker;
} catch (e$) {
- e = e$;
+ wt=null;
+ }
+ if (wt!=null && argv.v != true) {
+ console.log("starting backend using webworker-threads");
+ return wt;
+ } else {
+ //e = e$;
+ console.log("starting backend using vm.CreateContext");
return (function(){
var prototype = constructor.prototype;
function constructor(code){
Please sign in to comment.
Something went wrong with that request. Please try again.