From 26105034da4fcce7ac883c899d781f016559310d Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 8 Nov 2018 00:38:48 +0800 Subject: switch to vuepress --- node_modules/immediate/.travis.yml | 12 ++ node_modules/immediate/LICENSE.txt | 20 ++++ node_modules/immediate/README.md | 81 +++++++++++++ node_modules/immediate/bench.js | 89 +++++++++++++++ node_modules/immediate/bower.json | 13 +++ node_modules/immediate/component.json | 13 +++ node_modules/immediate/dist/immediate.js | 165 +++++++++++++++++++++++++++ node_modules/immediate/dist/immediate.min.js | 1 + node_modules/immediate/lib/index.js | 96 ++++++++++++++++ node_modules/immediate/lib/messageChannel.js | 18 +++ node_modules/immediate/lib/mutation.js | 22 ++++ node_modules/immediate/lib/nextTick.js | 11 ++ node_modules/immediate/lib/stateChange.js | 24 ++++ node_modules/immediate/lib/timeout.js | 10 ++ node_modules/immediate/package.json | 48 ++++++++ 15 files changed, 623 insertions(+) create mode 100644 node_modules/immediate/.travis.yml create mode 100644 node_modules/immediate/LICENSE.txt create mode 100644 node_modules/immediate/README.md create mode 100644 node_modules/immediate/bench.js create mode 100644 node_modules/immediate/bower.json create mode 100644 node_modules/immediate/component.json create mode 100644 node_modules/immediate/dist/immediate.js create mode 100644 node_modules/immediate/dist/immediate.min.js create mode 100644 node_modules/immediate/lib/index.js create mode 100644 node_modules/immediate/lib/messageChannel.js create mode 100644 node_modules/immediate/lib/mutation.js create mode 100644 node_modules/immediate/lib/nextTick.js create mode 100644 node_modules/immediate/lib/stateChange.js create mode 100644 node_modules/immediate/lib/timeout.js create mode 100644 node_modules/immediate/package.json (limited to 'node_modules/immediate') diff --git a/node_modules/immediate/.travis.yml b/node_modules/immediate/.travis.yml new file mode 100644 index 00000000..8c2c20b7 --- /dev/null +++ b/node_modules/immediate/.travis.yml @@ -0,0 +1,12 @@ +language: node_js +node_js: + - '0.10' +notifications: + email: false + +before_script: + - "export DISPLAY=:99.0" + - "sh -e /etc/init.d/xvfb start" + - "sleep 5" + # Workaround for Selenium #3280 issue + - "sudo sed -i 's/^127\\.0\\.0\\.1.*$/127.0.0.1 localhost/' /etc/hosts" \ No newline at end of file diff --git a/node_modules/immediate/LICENSE.txt b/node_modules/immediate/LICENSE.txt new file mode 100644 index 00000000..88c18c27 --- /dev/null +++ b/node_modules/immediate/LICENSE.txt @@ -0,0 +1,20 @@ +Copyright (c) 2012 Barnesandnoble.com, llc, Donavon West, Domenic Denicola, Brian Cavalier + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/immediate/README.md b/node_modules/immediate/README.md new file mode 100644 index 00000000..6d31c87f --- /dev/null +++ b/node_modules/immediate/README.md @@ -0,0 +1,81 @@ +# immediate [![Build Status](https://travis-ci.org/calvinmetcalf/immediate.svg?branch=master)](https://travis-ci.org/calvinmetcalf/immediate) + +[![testling status](https://ci.testling.com/calvinmetcalf/immediate.png)](https://ci.testling.com/calvinmetcalf/immediate) + +``` +npm install immediate --save +``` + +then + +```js +var immediate = require("immediate"); + +immediate(function () { + // this will run soon +}); + +immediate(function (arg1, arg2) { + // get your args like in iojs +}, thing1, thing2); +``` + +## Introduction + +**immediate** is a microtask library, decended from [NobleJS's setImmediate](https://github.com/NobleJS/setImmediate), but including ideas from [Cujo's When](https://github.com/cujojs/when) and [RSVP][RSVP]. + +immediate takes the tricks from setImmedate and RSVP and combines them with the schedualer inspired (vaugly) by whens. + +Note versions 2.6.5 and earlier were strictly speaking a 'macrotask' library not a microtask one, [see this for the difference](https://github.com/YuzuJS/setImmediate#macrotasks-and-microtasks), if you need a macrotask library, [I got you covered](https://github.com/calvinmetcalf/macrotask). + +Several new features were added in versions 3.1.0 and 3.2.0 to maintain parity with +process.nextTick, but the 3.0.x series is still being kept up to date if you just need +the small barebones version + +## The Tricks + +### `process.nextTick` + +Note that we check for *actual* Node.js environments, not emulated ones like those produced by browserify or similar. + +### `MutationObserver` + +This is what [RSVP][RSVP] uses, it's very fast, details on [MDN](https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver). + + +### `MessageChannel` + +Unfortunately, `postMessage` has completely different semantics inside web workers, and so cannot be used there. So we +turn to [`MessageChannel`][MessageChannel], which has worse browser support, but does work inside a web worker. + +### `