Commit Graph

68 Commits

Author SHA1 Message Date
Rafael Gonzaga 143aca7d1f
lib: add note about removing `node:sys` module
PR-URL: https://github.com/nodejs/node/pull/54743
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-09-05 21:53:52 +02:00
Ruben Bridgewater f8763bb077
benchmark,doc,lib,test: capitalize comments
PR-URL: https://github.com/nodejs/node/pull/26483
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2019-03-10 00:44:40 +01:00
James M Snell 98e54b0bd4 meta: restore original copyright header
A prior io.js era commit inappropriately removed the
original copyright statements from the source. This
restores those in any files still remaining from that
edit.

Ref: https://github.com/nodejs/TSC/issues/174
Ref: https://github.com/nodejs/node/pull/10599
PR-URL: https://github.com/nodejs/node/pull/10155

Note: This PR was required, reviewed-by and approved
by the Node.js Foundation Legal Committee and the TSC.
There is no `Approved-By:` meta data.
2017-03-10 11:23:48 -08:00
James M Snell 5de3cf099c lib: add static identifier codes for all deprecations
Assigns a static identifier code to all runtime and documentation
only deprecations. The identifier code is included in the emitted
DeprecationWarning.

Also adds a deprecations.md to the API docs to provide a central
location where deprecation codes can be referenced and explained.

PR-URL: https://github.com/nodejs/node/pull/10116
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Michal Zasso <targos@protonmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
2017-01-30 11:11:57 -08:00
James M Snell 15eaba98a1 lib: use emitWarning instead of printDeprecationMessage
The process.emitWarning() API should be used for printing
deprecation warning messages rather than directly using the
internal/util#printDeprecationMessage

PR-URL: https://github.com/nodejs/node/pull/8166
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
2016-09-02 13:15:22 -07:00
Vladimir Kurchatkin 628845b816 util: introduce `printDeprecationMessage` function
`printDeprecationMessage` is used to deprecate modules
and execution branches.

PR-URL: https://github.com/nodejs/io.js/pull/1822
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-06-04 10:59:43 +03:00
cjihrig 804e7aa9ab lib: use const to define constants
This commit replaces a number of var statements throughout
the lib code with const statements.

PR-URL: https://github.com/iojs/io.js/pull/541
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-21 16:21:31 -05:00
Wyatt Preul dc42e1faaf sys: Mark as deprecated
PR-URL: https://github.com/iojs/io.js/pull/317
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

discussed at TC meeting, deprecate, don't remove
2015-01-13 12:53:15 +11:00
isaacs 3e1b1dd4a9 Remove excessive copyright/license boilerplate
The copyright and license notice is already in the LICENSE file.  There
is no justifiable reason to also require that it be included in every
file, since the individual files are not individually distributed except
as part of the entire package.
2015-01-12 15:30:28 -08:00
Ben Noordhuis 21130c7d6f lib: turn on strict mode
Turn on strict mode for the files in the lib/ directory.  It helps
catch bugs and can have a positive effect on performance.

PR-URL: https://github.com/node-forward/node/pull/64
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-11-22 17:23:30 +01:00
isaacs f2a9ed4873 Fix #3577 Un-break require('sys') 2012-06-28 10:14:03 -07:00
Ryan Dahl b28e700ebd require('sys') now throws
To be removed in v0.9
2012-01-09 12:59:28 -08:00
Ben Noordhuis 97900776bb util: add internal function _deprecationWarning() 2011-12-14 13:36:21 +01:00
Ben Noordhuis 5fea00581b sys: print stack trace if NODE_DEBUG=sys 2011-11-29 19:22:13 +01:00
Maciej Małecki 8d70cc607c Show warning when using lib/sys.js 2011-08-31 19:26:34 +02:00
Ryan Dahl 55048cdf79 Update copyright headers 2011-03-14 17:37:05 -07:00
Ryan Dahl dd53ceebe4 lint 2010-12-01 20:59:06 -08:00
Ryan Dahl 6ce007e89a Remove warning in 'sys' - too aggressive 2010-11-02 21:20:28 -07:00
Micheil Smith e38eb0c5a4 Soft migration of sys -> util, Removal of deprecated utils module. 2010-10-11 15:21:36 -07:00
Ryan Dahl f23eb282c0 Fix style 2010-10-09 12:48:22 -07:00
Ryan Dahl 39b9043bef Use readline.columns in sys.inspect when possible
Though, this should probably be an option to sys.inspect and be set by REPL.
2010-10-09 12:40:17 -07:00
Ryan Dahl d164989e3f Commas last in sys.inspect
Ugly? Yes. More readable by first time users? Yes.
2010-10-09 12:18:17 -07:00
Joshaven Potter 3d4e4d8909 syntax fixes to pass jslint 2010-10-06 20:40:57 -07:00
Jorge Chamorro Bieling fc334b3a97 sys.js: --needless Object.keys() --needless .map() in a single patch 2010-09-19 18:02:27 -07:00
Jorge Chamorro Bieling 8e246acd0e sys.js: sys.inspect: show function names 2010-09-19 13:37:09 -07:00
Ryan Dahl f08985c193 Handle writeStream errors in sys.pump 2010-09-16 14:40:41 -07:00
Trent Mick 1d961a6630 add ANSI coloring option to sys.inspect and, by default, to the repl 2010-09-08 09:47:13 -07:00
Russell Haering 37b6e10684 Pass an error to the sys.pump callback if one occurs
- Add test case for pumping from unreadable stream.
- Document the sys.pump error handling behavior
2010-08-30 10:23:48 -07:00
isaacs e55c486801 Missing 'var' in sys.inspect (Found by Oleg Slobodskoi) 2010-08-22 13:45:39 -07:00
Herbert Vojčík 5dc2b93311 Fix sys.inspect for regex in different context. 2010-08-18 11:47:43 -07:00
Mikeal Rogers 16cb45103f Adds "pause" and "resume" events to pump and it's readable argument. 2010-07-13 17:17:20 -07:00
Dmitry Baranovskiy d3f04933f1 sys.inherts to shadow constructor property from enumerability
thanks to ES5 features in V8 it is quite easily possible.
2010-06-29 19:11:40 -07:00
Mikeal Rogers f62979da6b Add sys.pump 2010-06-22 17:58:09 -07:00
Ben Lowery f3cd7bbe77 Coerce each argument to a String before attempting to print it via sys.print 2010-06-15 14:44:09 -07:00
Ryan Dahl d62b0f442a Fix style in sys.js 2010-06-01 09:28:56 -07:00
isaacs 3c7873bd3f Use duck-typing as well as instanceof in sys.inspect
This makes it so that inspecting objects from other contexts works as expected.
2010-05-29 12:31:46 -07:00
Tim Caswell b480184fd6 Check for a couple of edge cases on the inspect hook.
Don't treat sys.inspect special, same with prototype objects.
2010-05-28 15:40:25 -07:00
Tim Caswell 7f5320b167 Provide a hook for user-specified inspect functions 2010-05-28 14:29:51 -07:00
Ryan Dahl 022c083848 Deprecate sys.p() 2010-05-20 10:12:05 -07:00
isaacs 57fbb627ca trailing whitespace fixes 2010-04-11 14:48:23 -07:00
Tim Caswell 7af9cb9e80 Don't put an extra comma after bases in inspect.
{ [Function]     { [Function]
, more: true  =>   more: true
, more2: true    , more2: true
, more3: true    , more3: true
, more3: true    , more4: true
, more3: true    , more5: true
}                }
2010-04-01 08:58:19 -07:00
Ryan Dahl 04c06b9149 child process now use net.Socket 2010-03-17 14:00:17 -07:00
Ryan Dahl fdf46a65c9 Use streams for stdout and stdin 2010-03-15 15:11:40 -07:00
Ryan Dahl 9be3df0828 Add sys.log() 2010-03-02 17:35:01 -08:00
Benjamin Thomas 6034701f57 Stop sys.inspect from adding extra new lines for deep objects that are elements in an array.
A couple other small fixes:

If the keys of an object were all numeric they should be quoted. This
way, you can now hypothetically copy and paste the output into your code
(if the object doesn't contain any circular objects, deeply nested
objects, Dates, RegExps or functions. I think).

If a nested object isn't being recursed into, output "[Object]" as
opposed to "[object Object]".

If an object is longer than the max width but it is one line no matter
what, then don't put the closing brace on a new line.

Fix some formatting issues to try and match Node's style guidelines.
2010-03-01 13:34:46 -08:00
Ryan Dahl b021a845f7 Move process.inherits to sys 2010-03-01 11:39:35 -08:00
Benjamin Thomas de1521413e Make the output of sys.inspect a lot more compact.
See:
http://groups.google.com/group/nodejs/browse_thread/thread/ac060521e27fef65

By default now, sys.inspect doesn't recurse more than two times.  Pass
in null as the third parameter to make it recurse indefinitely.
2010-02-25 18:23:11 -08:00
Benjamin Thomas a2714be8b5 Add optional third argument sys.inpect to indicate how many times you want it to recurse 2010-02-25 13:17:05 -08:00
Ryan Dahl de7016eac5 sys.exec() no longer uses Promise 2010-02-19 16:55:46 -08:00
Mark Hansen 98e61db216 sys.inspect(Date) now shows the date value 2010-02-15 17:08:22 -08:00