From cc97a4dd2a967e1c2273bd5f4c5f49a5bf2e2585 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 27 Mar 2019 21:01:33 +0100 Subject: remove node_modules --- node_modules/events/tests/add-listeners.js | 63 ---------------- node_modules/events/tests/check-listener-leaks.js | 86 ---------------------- node_modules/events/tests/common.js | 42 ----------- node_modules/events/tests/index.js | 25 ------- node_modules/events/tests/legacy-compat.js | 18 ----- node_modules/events/tests/listener-count.js | 36 --------- .../events/tests/listeners-side-effects.js | 55 -------------- node_modules/events/tests/listeners.js | 51 ------------- node_modules/events/tests/max-listeners.js | 50 ------------- node_modules/events/tests/modify-in-emit.js | 76 ------------------- node_modules/events/tests/num-args.js | 44 ----------- node_modules/events/tests/once.js | 59 --------------- node_modules/events/tests/remove-all-listeners.js | 80 -------------------- node_modules/events/tests/remove-listeners.js | 84 --------------------- .../events/tests/set-max-listeners-side-effects.js | 29 -------- node_modules/events/tests/subclass.js | 51 ------------- 16 files changed, 849 deletions(-) delete mode 100644 node_modules/events/tests/add-listeners.js delete mode 100644 node_modules/events/tests/check-listener-leaks.js delete mode 100644 node_modules/events/tests/common.js delete mode 100644 node_modules/events/tests/index.js delete mode 100644 node_modules/events/tests/legacy-compat.js delete mode 100644 node_modules/events/tests/listener-count.js delete mode 100644 node_modules/events/tests/listeners-side-effects.js delete mode 100644 node_modules/events/tests/listeners.js delete mode 100644 node_modules/events/tests/max-listeners.js delete mode 100644 node_modules/events/tests/modify-in-emit.js delete mode 100644 node_modules/events/tests/num-args.js delete mode 100644 node_modules/events/tests/once.js delete mode 100644 node_modules/events/tests/remove-all-listeners.js delete mode 100644 node_modules/events/tests/remove-listeners.js delete mode 100644 node_modules/events/tests/set-max-listeners-side-effects.js delete mode 100644 node_modules/events/tests/subclass.js (limited to 'node_modules/events/tests') diff --git a/node_modules/events/tests/add-listeners.js b/node_modules/events/tests/add-listeners.js deleted file mode 100644 index 5ab874cea..000000000 --- a/node_modules/events/tests/add-listeners.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -var assert = require('assert'); -var events = require('../'); - -var e = new events.EventEmitter(); - -var events_new_listener_emited = []; -var listeners_new_listener_emited = []; -var times_hello_emited = 0; - -// sanity check -assert.equal(e.addListener, e.on); - -e.on('newListener', function(event, listener) { - console.log('newListener: ' + event); - events_new_listener_emited.push(event); - listeners_new_listener_emited.push(listener); -}); - -function hello(a, b) { - console.log('hello'); - times_hello_emited += 1; - assert.equal('a', a); - assert.equal('b', b); -} -e.on('hello', hello); - -var foo = function() {}; -e.once('foo', foo); - -console.log('start'); - -e.emit('hello', 'a', 'b'); - - -// just make sure that this doesn't throw: -var f = new events.EventEmitter(); -f.setMaxListeners(0); - -assert.deepEqual(['hello', 'foo'], events_new_listener_emited); -assert.deepEqual([hello, foo], listeners_new_listener_emited); -assert.equal(1, times_hello_emited); - diff --git a/node_modules/events/tests/check-listener-leaks.js b/node_modules/events/tests/check-listener-leaks.js deleted file mode 100644 index e07866a50..000000000 --- a/node_modules/events/tests/check-listener-leaks.js +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -var assert = require('assert'); -var events = require('../'); - -var e = new events.EventEmitter(); - -// default -for (var i = 0; i < 10; i++) { - e.on('default', function() {}); -} -assert.ok(!e._events['default'].hasOwnProperty('warned')); -e.on('default', function() {}); -assert.ok(e._events['default'].warned); - -// specific -e.setMaxListeners(5); -for (var i = 0; i < 5; i++) { - e.on('specific', function() {}); -} -assert.ok(!e._events['specific'].hasOwnProperty('warned')); -e.on('specific', function() {}); -assert.ok(e._events['specific'].warned); - -// only one -e.setMaxListeners(1); -e.on('only one', function() {}); -assert.ok(!e._events['only one'].hasOwnProperty('warned')); -e.on('only one', function() {}); -assert.ok(e._events['only one'].hasOwnProperty('warned')); - -// unlimited -e.setMaxListeners(0); -for (var i = 0; i < 1000; i++) { - e.on('unlimited', function() {}); -} -assert.ok(!e._events['unlimited'].hasOwnProperty('warned')); - -// process-wide -events.EventEmitter.defaultMaxListeners = 42; -e = new events.EventEmitter(); - -for (var i = 0; i < 42; ++i) { - e.on('fortytwo', function() {}); -} -assert.ok(!e._events['fortytwo'].hasOwnProperty('warned')); -e.on('fortytwo', function() {}); -assert.ok(e._events['fortytwo'].hasOwnProperty('warned')); -delete e._events['fortytwo'].warned; - -events.EventEmitter.defaultMaxListeners = 44; -e.on('fortytwo', function() {}); -assert.ok(!e._events['fortytwo'].hasOwnProperty('warned')); -e.on('fortytwo', function() {}); -assert.ok(e._events['fortytwo'].hasOwnProperty('warned')); - -// but _maxListeners still has precedence over defaultMaxListeners -events.EventEmitter.defaultMaxListeners = 42; -e = new events.EventEmitter(); -e.setMaxListeners(1); -e.on('uno', function() {}); -assert.ok(!e._events['uno'].hasOwnProperty('warned')); -e.on('uno', function() {}); -assert.ok(e._events['uno'].hasOwnProperty('warned')); - -// chainable -assert.strictEqual(e, e.setMaxListeners(1)); diff --git a/node_modules/events/tests/common.js b/node_modules/events/tests/common.js deleted file mode 100644 index 66f70a390..000000000 --- a/node_modules/events/tests/common.js +++ /dev/null @@ -1,42 +0,0 @@ -var assert = require('assert'); - -var mustCallChecks = []; - -function runCallChecks() { - var failed_count = 0; - for (var i=0 ; i< mustCallChecks.length; ++i) { - var context = mustCallChecks[i]; - if (context.actual === context.expected) { - continue; - } - - failed_count++; - console.log('Mismatched %s function calls. Expected %d, actual %d.', - context.name, - context.expected, - context.actual); - console.log(context.stack.split('\n').slice(2).join('\n')); - } - - assert(failed_count === 0); -} - -after(runCallChecks); - -exports.mustCall = function(fn, expected) { - if (typeof expected !== 'number') expected = 1; - - var context = { - expected: expected, - actual: 0, - stack: (new Error).stack, - name: fn.name || '' - }; - - mustCallChecks.push(context); - - return function() { - context.actual++; - return fn.apply(this, arguments); - }; -}; diff --git a/node_modules/events/tests/index.js b/node_modules/events/tests/index.js deleted file mode 100644 index f144530b9..000000000 --- a/node_modules/events/tests/index.js +++ /dev/null @@ -1,25 +0,0 @@ - -require('./legacy-compat'); - -// we do this to easily wrap each file in a mocha test -// and also have browserify be able to statically analyze this file -var orig_require = require; -var require = function(file) { - test(file, function() { - orig_require(file); - }); -} - -require('./add-listeners.js'); -require('./check-listener-leaks.js'); -require('./listener-count.js'); -require('./listeners-side-effects.js'); -require('./listeners.js'); -require('./max-listeners.js'); -require('./modify-in-emit.js'); -require('./num-args.js'); -require('./once.js'); -require('./set-max-listeners-side-effects.js'); -require('./subclass.js'); -require('./remove-all-listeners.js'); -require('./remove-listeners.js'); diff --git a/node_modules/events/tests/legacy-compat.js b/node_modules/events/tests/legacy-compat.js deleted file mode 100644 index afbc0ab83..000000000 --- a/node_modules/events/tests/legacy-compat.js +++ /dev/null @@ -1,18 +0,0 @@ -// sigh... life is hard -if (!global.console) { - console = {} -} - -var fns = ['log', 'error', 'trace']; -for (var i=0 ; ifoo should not be emitted', '!'); -}; - -e.once('foo', remove); -e.removeListener('foo', remove); -e.emit('foo'); - -var times_recurse_emitted = 0; - -e.once('e', function() { - e.emit('e'); - times_recurse_emitted++; -}); - -e.once('e', function() { - times_recurse_emitted++; -}); - -e.emit('e'); - -assert.equal(1, times_hello_emited); -assert.equal(2, times_recurse_emitted); diff --git a/node_modules/events/tests/remove-all-listeners.js b/node_modules/events/tests/remove-all-listeners.js deleted file mode 100644 index b3dc886e7..000000000 --- a/node_modules/events/tests/remove-all-listeners.js +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -var common = require('./common'); -var assert = require('assert'); -var events = require('../'); - -var after_checks = []; -after(function() { - for (var i=0 ; i