PATH: //opt/alt/alt-nodejs19/root/lib/node_modules/npm/node_modules/events/tests
FILE_BARU
CREATE
FOLDER_BARU
MKDIR
UPLOAD_FILE
GO
[ .. KEMBALI ]
📄 add-listeners.js
↓
X
📄 check-listener-leaks.js
↓
X
📄 common.js
↓
X
📄 errors.js
↓
X
📄 events-list.js
↓
X
📄 events-once.js
↓
X
📄 index.js
↓
X
📄 legacy-compat.js
↓
X
📄 listener-count.js
↓
X
📄 listeners-side-effects.js
↓
X
📄 listeners.js
↓
X
📄 max-listeners.js
↓
X
📄 method-names.js
↓
X
📄 modify-in-emit.js
↓
X
📄 num-args.js
↓
X
📄 once.js
↓
X
📄 prepend.js
↓
X
📄 remove-all-listeners.js
↓
X
📄 remove-listeners.js
↓
X
📄 set-max-listeners-side-effects.js
↓
X
📄 special-event-names.js
↓
X
📄 subclass.js
↓
X
📄 symbols.js
↓
X
SAVING...
BERHASIL DIUBAH!
EDITING: prepend.js
'use strict'; var common = require('./common'); var EventEmitter = require('../'); var assert = require('assert'); var myEE = new EventEmitter(); var m = 0; // This one comes last. myEE.on('foo', common.mustCall(function () { assert.strictEqual(m, 2); })); // This one comes second. myEE.prependListener('foo', common.mustCall(function () { assert.strictEqual(m++, 1); })); // This one comes first. myEE.prependOnceListener('foo', common.mustCall(function () { assert.strictEqual(m++, 0); })); myEE.emit('foo'); // Verify that the listener must be a function assert.throws(function () { var ee = new EventEmitter(); ee.prependOnceListener('foo', null); }, 'TypeError: The "listener" argument must be of type Function. Received type object');
SIMPAN PERUBAHAN