| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 01908d0 commit 47befff
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,57 +1,6 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | ||
| 3 | - function init(list) { | ||
| 4 | - list._idleNext = list; | ||
| 5 | - list._idlePrev = list; | ||
| 6 | - } | ||
| 7 | - exports.init = init; | ||
| 3 | + const msg = require('internal/util').printDeprecationMessage; | ||
| 8 | 4 | ||
| 9 | - | ||
| 10 | - // show the most idle item | ||
| 11 | - function peek(list) { | ||
| 12 | - if (list._idlePrev == list) return null; | ||
| 13 | - return list._idlePrev; | ||
| 14 | - } | ||
| 15 | - exports.peek = peek; | ||
| 16 | - | ||
| 17 | - | ||
| 18 | - // remove the most idle item from the list | ||
| 19 | - function shift(list) { | ||
| 20 | - var first = list._idlePrev; | ||
| 21 | - remove(first); | ||
| 22 | - return first; | ||
| 23 | - } | ||
| 24 | - exports.shift = shift; | ||
| 25 | - | ||
| 26 | - | ||
| 27 | - // remove a item from its list | ||
| 28 | - function remove(item) { | ||
| 29 | - if (item._idleNext) { | ||
| 30 | - item._idleNext._idlePrev = item._idlePrev; | ||
| 31 | - } | ||
| 32 | - | ||
| 33 | - if (item._idlePrev) { | ||
| 34 | - item._idlePrev._idleNext = item._idleNext; | ||
| 35 | - } | ||
| 36 | - | ||
| 37 | - item._idleNext = null; | ||
| 38 | - item._idlePrev = null; | ||
| 39 | - } | ||
| 40 | - exports.remove = remove; | ||
| 41 | - | ||
| 42 | - | ||
| 43 | - // remove a item from its list and place at the end. | ||
| 44 | - function append(list, item) { | ||
| 45 | - remove(item); | ||
| 46 | - item._idleNext = list._idleNext; | ||
| 47 | - list._idleNext._idlePrev = item; | ||
| 48 | - item._idlePrev = list; | ||
| 49 | - list._idleNext = item; | ||
| 50 | - } | ||
| 51 | - exports.append = append; | ||
| 52 | - | ||
| 53 | - | ||
| 54 | - function isEmpty(list) { | ||
| 55 | - return list._idleNext === list; | ||
| 56 | - } | ||
| 57 | - exports.isEmpty = isEmpty; | ||
| 5 | + module.exports = require('internal/linkedlist'); | ||
| 6 | + msg('_linklist module is deprecated. Please use a userland alternative.'); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,57 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + | ||
| 3 | + function init(list) { | ||
| 4 | + list._idleNext = list; | ||
| 5 | + list._idlePrev = list; | ||
| 6 | + } | ||
| 7 | + exports.init = init; | ||
| 8 | + | ||
| 9 | + | ||
| 10 | + // show the most idle item | ||
| 11 | + function peek(list) { | ||
| 12 | + if (list._idlePrev == list) return null; | ||
| 13 | + return list._idlePrev; | ||
| 14 | + } | ||
| 15 | + exports.peek = peek; | ||
| 16 | + | ||
| 17 | + | ||
| 18 | + // remove the most idle item from the list | ||
| 19 | + function shift(list) { | ||
| 20 | + var first = list._idlePrev; | ||
| 21 | + remove(first); | ||
| 22 | + return first; | ||
| 23 | + } | ||
| 24 | + exports.shift = shift; | ||
| 25 | + | ||
| 26 | + | ||
| 27 | + // remove a item from its list | ||
| 28 | + function remove(item) { | ||
| 29 | + if (item._idleNext) { | ||
| 30 | + item._idleNext._idlePrev = item._idlePrev; | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + if (item._idlePrev) { | ||
| 34 | + item._idlePrev._idleNext = item._idleNext; | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + item._idleNext = null; | ||
| 38 | + item._idlePrev = null; | ||
| 39 | + } | ||
| 40 | + exports.remove = remove; | ||
| 41 | + | ||
| 42 | + | ||
| 43 | + // remove a item from its list and place at the end. | ||
| 44 | + function append(list, item) { | ||
| 45 | + remove(item); | ||
| 46 | + item._idleNext = list._idleNext; | ||
| 47 | + list._idleNext._idlePrev = item; | ||
| 48 | + item._idlePrev = list; | ||
| 49 | + list._idleNext = item; | ||
| 50 | + } | ||
| 51 | + exports.append = append; | ||
| 52 | + | ||
| 53 | + | ||
| 54 | + function isEmpty(list) { | ||
| 55 | + return list._idleNext === list; | ||
| 56 | + } | ||
| 57 | + exports.isEmpty = isEmpty; | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,7 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | ||
| 3 | 3 | const Timer = process.binding('timer_wrap').Timer; | |
| 4 | - const L = require('_linklist'); | ||
| 4 | + const L = require('internal/linkedlist'); | ||
| 5 | 5 | const assert = require('assert').ok; | |
| 6 | 6 | const util = require('util'); | |
| 7 | 7 | const debug = util.debuglog('timer'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,7 +17,6 @@ | |||
| 17 | 17 | 'src/node.js', | |
| 18 | 18 | 'lib/_debug_agent.js', | |
| 19 | 19 | 'lib/_debugger.js', | |
| 20 | - 'lib/_linklist.js', | ||
| 21 | 20 | 'lib/assert.js', | |
| 22 | 21 | 'lib/buffer.js', | |
| 23 | 22 | 'lib/child_process.js', | |
@@ -39,6 +38,7 @@ | |||
| 39 | 38 | 'lib/_http_outgoing.js', | |
| 40 | 39 | 'lib/_http_server.js', | |
| 41 | 40 | 'lib/https.js', | |
| 41 | + 'lib/_linklist.js', | ||
| 42 | 42 | 'lib/module.js', | |
| 43 | 43 | 'lib/net.js', | |
| 44 | 44 | 'lib/os.js', | |
@@ -70,9 +70,10 @@ | |||
| 70 | 70 | 'lib/zlib.js', | |
| 71 | 71 | 'lib/internal/child_process.js', | |
| 72 | 72 | 'lib/internal/freelist.js', | |
| 73 | + 'lib/internal/linkedlist.js', | ||
| 73 | 74 | 'lib/internal/module.js', | |
| 74 | - 'lib/internal/socket_list.js', | ||
| 75 | 75 | 'lib/internal/repl.js', | |
| 76 | + 'lib/internal/socket_list.js', | ||
| 76 | 77 | 'lib/internal/util.js', | |
| 77 | 78 | 'lib/internal/streams/lazy_transform.js', | |
| 78 | 79 | ], | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,8 +1,13 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | - var common = require('../common'); | ||
| 3 | - var assert = require('assert'); | ||
| 4 | - var L = require('_linklist'); | ||
| 5 | 2 | ||
| 3 | + // Flags: --expose-internals | ||
| 4 | + | ||
| 5 | + const common = require('../common'); | ||
| 6 | + const assert = require('assert'); | ||
| 7 | + const L = require('_linklist'); | ||
| 8 | + const internalL = require('internal/linkedlist'); | ||
| 9 | + | ||
| 10 | + assert.strictEqual(L, internalL); | ||
| 6 | 11 | ||
| 7 | 12 | var list = { name: 'list' }; | |
| 8 | 13 | var A = { name: 'A' }; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments