Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

Commit

Permalink
remove "regenerator"
Browse files Browse the repository at this point in the history
Generators have been natively supported in Node.js since
v0.11 at this point. Newest LTS is v7, so pre v0 should
definitely not be supported at this point. This makes the
packge smaller as well.

Fixes #13.
  • Loading branch information
TooTallNate committed Nov 9, 2016
1 parent cfb9d47 commit df860eb
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
11 changes: 0 additions & 11 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ var co = require('co');
var vm = require('vm');
var thunkify = require('thunkify');
var degenerator = require('degenerator');
var regenerator = require('regenerator');

/**
* Built-in PAC functions.
Expand All @@ -32,9 +31,6 @@ var weekdayRange = require('./weekdayRange');

module.exports = generate;

// cache the `facebook/regenerator` wrap function for the Generator object.
var rg = vm.runInNewContext(regenerator.compile('', { includeRuntime: true }).code + ';regeneratorRuntime');

/**
* Returns an asyncronous `FindProxyForURL` function from the
* given JS string (from a PAC file).
Expand Down Expand Up @@ -82,16 +78,9 @@ function generate (str, opts) {
}
//console.log(names);

// for `facebook/regenerator`
sandbox.regeneratorRuntime = rg;

// convert the JS FindProxyForURL function into a generator function
var js = degenerator(str, names);

// use `facebook/regenerator` for node < v0.11 support
// TODO: don't use regenerator if native generators are supported...
js = regenerator.compile(js, { includeRuntime: false }).code;

// filename of the pac file for the vm
var filename = opts && opts.filename ? opts.filename : 'proxy.pac';

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"co": "~3.0.6",
"netmask": "~1.0.4",
"degenerator": "~1.0.2",
"regenerator": "~0.8.13",
"thunkify": "~2.1.1",
"ip": "1.0.1"
},
Expand Down

0 comments on commit df860eb

Please sign in to comment.