Skip to content

Commit

Permalink
Revert: Update: Polyfill Proxy on Node 4
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Kennedy committed Oct 16, 2017
1 parent d328cac commit 86375e4
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 45 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ node_js:
- '8'
- '7'
- '6'
- '4'
before_script:
- npm prune
script:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('Example test suite', function () {

`anticipated-call` intercepts function calls with [Proxy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy), and returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). To do this, the `Proxy` and `Promise` constructors must be available as globals.

The `Promise` constructor is assumed to be available, since it was implemented in Node 4. If `Proxy` is not available, it will be polyfilled.
If you're running Node 8, these are included in core, so you don't have to do anything. Similarly, if you're using `babel-polyfill` or similar, this is handled for you.

## API

Expand Down
61 changes: 28 additions & 33 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
"test": "jest",
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
},
"files": [
"lib"
],
"files": ["lib"],
"author": "Ryan Kennedy <[email protected]>",
"license": "MIT",
"release": {
Expand All @@ -36,8 +34,5 @@
"eslint-config-react-app": "^2.0.1",
"jest": "^21.2.1",
"semantic-release": "^8.0.3"
},
"dependencies": {
"harmony-reflect": "^1.5.1"
}
}
4 changes: 0 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
const EventEmitter = require('events');

if (typeof Proxy === 'undefined') {
require('harmony-reflect');
}

class Anticipated extends EventEmitter {
nthNextCall(n) {
let counter = 0;
Expand Down

0 comments on commit 86375e4

Please sign in to comment.