Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 3 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Commits on Dec 25, 2012
abiank Added cmdline switches: -v to force vm.createContext , -w for webwork…
…er-threads (which is default)
ca2fc7f
abiank removed leftovers from implementing cmdline switches (-w for webworke…
…rs -v for createContext)
e490995
Commits on Dec 26, 2012
@audreyt Merge pull request #27 from abiank/master
implemented cmdline switches in sc.js
9d3572f
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){

No commit comments for this range

Something went wrong with that request. Please try again.