pax_global_header00006660000000000000000000000064125002420700014502gustar00rootroot0000000000000052 comment=4c50df7ade5a368e106fee82351ee0a378c990f7 set-immediate-shim-1.0.1/000077500000000000000000000000001250024207000151665ustar00rootroot00000000000000set-immediate-shim-1.0.1/.editorconfig000066400000000000000000000003371250024207000176460ustar00rootroot00000000000000root = true [*] indent_style = tab end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [package.json] indent_style = space indent_size = 2 [*.md] trim_trailing_whitespace = false set-immediate-shim-1.0.1/.gitattributes000066400000000000000000000000141250024207000200540ustar00rootroot00000000000000* text=auto set-immediate-shim-1.0.1/.gitignore000066400000000000000000000000151250024207000171520ustar00rootroot00000000000000node_modules set-immediate-shim-1.0.1/.jshintrc000066400000000000000000000002761250024207000170200ustar00rootroot00000000000000{ "node": true, "esnext": true, "bitwise": true, "camelcase": true, "curly": true, "immed": true, "newcap": true, "noarg": true, "undef": true, "unused": "vars", "strict": true } set-immediate-shim-1.0.1/.travis.yml000066400000000000000000000001101250024207000172670ustar00rootroot00000000000000sudo: false language: node_js node_js: - 'iojs' - '0.12' - '0.10' set-immediate-shim-1.0.1/index.js000066400000000000000000000003221250024207000166300ustar00rootroot00000000000000'use strict'; module.exports = typeof setImmediate === 'function' ? setImmediate : function setImmediate() { var args = [].slice.apply(arguments); args.splice(1, 0, 0); setTimeout.apply(null, args); }; set-immediate-shim-1.0.1/license000066400000000000000000000021371250024207000165360ustar00rootroot00000000000000The MIT License (MIT) Copyright (c) Sindre Sorhus (sindresorhus.com) 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. set-immediate-shim-1.0.1/package.json000066400000000000000000000011641250024207000174560ustar00rootroot00000000000000{ "name": "set-immediate-shim", "version": "1.0.1", "description": "Simple setImmediate shim", "license": "MIT", "repository": "sindresorhus/set-immediate-shim", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=0.10.0" }, "scripts": { "test": "node test.js" }, "files": [ "index.js" ], "keywords": [ "setImmediate", "immediate", "setTimeout", "timeout", "shim", "polyfill", "ponyfill" ], "devDependencies": { "ava": "0.0.4", "require-uncached": "^1.0.2" } } set-immediate-shim-1.0.1/readme.md000066400000000000000000000010561250024207000167470ustar00rootroot00000000000000# set-immediate-shim [![Build Status](https://travis-ci.org/sindresorhus/set-immediate-shim.svg?branch=master)](https://travis-ci.org/sindresorhus/set-immediate-shim) > Simple [`setImmediate`](https://developer.mozilla.org/en-US/docs/Web/API/Window.setImmediate) shim ## Install ``` $ npm install --save set-immediate-shim ``` ## Usage ```js var setImmediateShim = require('set-immediate-shim'); setImmediateShim(function () { console.log('2'); }); console.log('1'); //=> 1 //=> 2 ``` ## License MIT © [Sindre Sorhus](http://sindresorhus.com) set-immediate-shim-1.0.1/test.js000066400000000000000000000012031250024207000164770ustar00rootroot00000000000000'use strict'; var test = require('ava'); var requireUncached = require('require-uncached'); test('shim', function (t) { var called = false; // force the shim var _ = setImmediate; setImmediate = null; var setImmediateShim = requireUncached('./'); setImmediate = _; setImmediateShim(function () { called = true; t.end(); }); t.assert(!called); }); test('pass rest arguments', function (t) { // force the shim var _ = setImmediate; setImmediate = null; var setImmediateShim = requireUncached('./'); setImmediate = _; setImmediateShim(function (a, b) { t.assert(a === 3); t.assert(b === 5); t.end(); }, 3, 5); });