File tree Expand file tree Collapse file tree 5 files changed +72
-60
lines changed Expand file tree Collapse file tree 5 files changed +72
-60
lines changed Original file line number Diff line number Diff line change 11'use strict' ;
22
3- function init ( list ) {
4- list . _idleNext = list ;
5- list . _idlePrev = list ;
6- }
7- exports . init = init ;
3+ const msg = require ( 'internal/util' ) . printDeprecationMessage ;
84
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 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 11'use strict' ;
22
33const Timer = process . binding ( 'timer_wrap' ) . Timer ;
4- const L = require ( '_linklist ' ) ;
4+ const L = require ( 'internal/linkedlist ' ) ;
55const assert = require ( 'assert' ) . ok ;
66const util = require ( 'util' ) ;
77const debug = util . debuglog ( 'timer' ) ;
Original file line number Diff line number Diff line change 1717 'src/node.js' ,
1818 'lib/_debug_agent.js' ,
1919 'lib/_debugger.js' ,
20- 'lib/_linklist.js' ,
2120 'lib/assert.js' ,
2221 'lib/buffer.js' ,
2322 'lib/child_process.js' ,
3938 'lib/_http_outgoing.js' ,
4039 'lib/_http_server.js' ,
4140 'lib/https.js' ,
41+ 'lib/_linklist.js' ,
4242 'lib/module.js' ,
4343 'lib/net.js' ,
4444 'lib/os.js' ,
7070 'lib/zlib.js' ,
7171 'lib/internal/child_process.js' ,
7272 'lib/internal/freelist.js' ,
73+ 'lib/internal/linkedlist.js' ,
7374 'lib/internal/module.js' ,
74- 'lib/internal/socket_list.js' ,
7575 'lib/internal/repl.js' ,
76+ 'lib/internal/socket_list.js' ,
7677 'lib/internal/util.js' ,
7778 'lib/internal/streams/lazy_transform.js' ,
7879 ],
Original file line number Diff line number Diff line change 11'use strict' ;
2- var common = require ( '../common' ) ;
3- var assert = require ( 'assert' ) ;
4- var L = require ( '_linklist' ) ;
52
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 ) ;
611
712var list = { name : 'list' } ;
813var A = { name : 'A' } ;
You can’t perform that action at this time.
0 commit comments