diff options
Diffstat (limited to 'node_modules/timers-browserify')
-rw-r--r-- | node_modules/timers-browserify/.npmignore | 2 | ||||
-rw-r--r-- | node_modules/timers-browserify/CHANGELOG.md | 40 | ||||
-rw-r--r-- | node_modules/timers-browserify/main.js | 20 | ||||
-rw-r--r-- | node_modules/timers-browserify/package.json | 4 |
4 files changed, 57 insertions, 9 deletions
diff --git a/node_modules/timers-browserify/.npmignore b/node_modules/timers-browserify/.npmignore deleted file mode 100644 index a387873da..000000000 --- a/node_modules/timers-browserify/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -example diff --git a/node_modules/timers-browserify/CHANGELOG.md b/node_modules/timers-browserify/CHANGELOG.md index 841e59c48..6162f37b0 100644 --- a/node_modules/timers-browserify/CHANGELOG.md +++ b/node_modules/timers-browserify/CHANGELOG.md @@ -2,6 +2,44 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## 2.0.10 - 2018-04-18 + +### Fixed + +* Guard `global` usage in scope to avoid reference errors + +## 2.0.9 - 2018-04-17 + +### Fixed + +* Guard `self` usage in scope to avoid Webpack reference errors + +## 2.0.8 - 2018-04-17 + +### Fixed + +* Worker support now explicitly references `self` and `window` rather then using + `this` implicitly to fix issues in Webpack builds. + +## 2.0.7 - 2018-04-16 + +### Fixed + +* Support `setTimeout` / `setInterval` in workers + +## 2.0.6 - 2018-01-24 + +### Fixed + +* Use `typeof` to search globals more carefully. + +## 2.0.5 - 2018-01-23 + +### Fixed + +* Try harder to retrieve `setImmediate` and `clearImmediate` in esoteric + environments. + ## 2.0.4 - 2017-08-14 ### Fixed @@ -9,7 +47,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). * Revert `setImmediate` and `clearImmediate` changes from 2.0.3 because they appear to break Webpack. -### 2.0.3 - 2017-07-31 +## 2.0.3 - 2017-07-31 ### Fixed diff --git a/node_modules/timers-browserify/main.js b/node_modules/timers-browserify/main.js index 001c63190..4214e74bc 100644 --- a/node_modules/timers-browserify/main.js +++ b/node_modules/timers-browserify/main.js @@ -1,12 +1,15 @@ +var scope = (typeof global !== "undefined" && global) || + (typeof self !== "undefined" && self) || + window; var apply = Function.prototype.apply; // DOM APIs, for completeness exports.setTimeout = function() { - return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout); + return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout); }; exports.setInterval = function() { - return new Timeout(apply.call(setInterval, window, arguments), clearInterval); + return new Timeout(apply.call(setInterval, scope, arguments), clearInterval); }; exports.clearTimeout = exports.clearInterval = function(timeout) { @@ -21,7 +24,7 @@ function Timeout(id, clearFn) { } Timeout.prototype.unref = Timeout.prototype.ref = function() {}; Timeout.prototype.close = function() { - this._clearFn.call(window, this._id); + this._clearFn.call(scope, this._id); }; // Does not start the time, just sets up the members needed. @@ -49,5 +52,12 @@ exports._unrefActive = exports.active = function(item) { // setimmediate attaches itself to the global object require("setimmediate"); -exports.setImmediate = setImmediate; -exports.clearImmediate = clearImmediate; +// On some exotic environments, it's not clear which object `setimmediate` was +// able to install onto. Search each possibility in the same order as the +// `setimmediate` library. +exports.setImmediate = (typeof self !== "undefined" && self.setImmediate) || + (typeof global !== "undefined" && global.setImmediate) || + (this && this.setImmediate); +exports.clearImmediate = (typeof self !== "undefined" && self.clearImmediate) || + (typeof global !== "undefined" && global.clearImmediate) || + (this && this.clearImmediate); diff --git a/node_modules/timers-browserify/package.json b/node_modules/timers-browserify/package.json index 019612e29..8f2d757e7 100644 --- a/node_modules/timers-browserify/package.json +++ b/node_modules/timers-browserify/package.json @@ -2,7 +2,7 @@ "author": "J. Ryan Stinnett <jryans@gmail.com> (http://convolv.es/)", "name": "timers-browserify", "description": "timers module for browserify", - "version": "2.0.4", + "version": "2.0.10", "homepage": "https://github.com/jryans/timers-browserify", "bugs": "https://github.com/jryans/timers-browserify/issues", "repository": { @@ -11,6 +11,7 @@ }, "contributors": [ "Colton Brown <coltonTB@me.com>", + "Dario Segura <dario.seco@gmail.com>", "Guy Bedford <guybedford@gmail.com>", "Ionut-Cristian Florescu <ionut.florescu@gmail.com>", "James Halliday <mail@substack.net>", @@ -19,6 +20,7 @@ "Jonathan Prins <jon@blip.tv>", "Matt Esch <matt@mattesch.info>", "taoqf <tao_qiufeng@126.com>", + "Thiago Felix <thiago@thiagofelix.com>", "wtgtybhertgeghgtwtg <wtgtybhertgeghgtwtg@gmail.com>" ], "main": "main.js", |