Nathan Rajlich
54b409d650
util: isRegExp() should not call toString() on its argument
An overloaded toString() method may have side effects
so don't call it for a simple type check.
14 years ago
koichik
d439c092c2
Improve util.format() compatibility with browser.
Fixes #1434 .
14 years ago
koichik
d3d8f1b972
Add %% escape to util.format()
Fixes #1273 .
14 years ago
Ben Noordhuis
874260b40f
util: add sprintf-like format() function
Fixes #1407 .
14 years ago
koichik
d38fac2230
Fixes #1260
RegExp object is no longer Function.
http://code.google.com/p/v8/issues/detail?id=617
14 years ago
Ryan Dahl
d1eba2b18b
Revert "Fixes #1260"
Due to downgrade of V8.
This reverts commit 3e2abd12d3
.
14 years ago
koichik
3e2abd12d3
Fixes #1260
RegExp object is no longer Function.
http://code.google.com/p/v8/issues/detail?id=617
14 years ago
Ryan Dahl
1ba2c32135
Massage util.inherits for perf increase
14 years ago
isaacs
4d64f36338
Closes GH-310 Format slashes properly
14 years ago
Ryan Dahl
55048cdf79
Update copyright headers
14 years ago
Devin Torres
8c6a7b5de4
Use more color in the repl, loosely inspired by TextMate's SunBurst theme
14 years ago
Ryan Dahl
558e5ba2b0
lint util.js and src/node.js
14 years ago
Ryan Dahl
dd53ceebe4
lint
14 years ago
Tim Cooijmans
d4b726a1a6
fix utils.inspect's detection of circular structures
14 years ago
Micheil Smith
e38eb0c5a4
Soft migration of sys -> util, Removal of deprecated utils module.
14 years ago
Ryan Dahl
f23eb282c0
Fix style
14 years ago
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.
14 years ago
Ryan Dahl
d164989e3f
Commas last in sys.inspect
Ugly? Yes. More readable by first time users? Yes.
14 years ago
Joshaven Potter
3d4e4d8909
syntax fixes to pass jslint
14 years ago
Jorge Chamorro Bieling
fc334b3a97
sys.js: --needless Object.keys() --needless .map() in a single patch
14 years ago
Jorge Chamorro Bieling
8e246acd0e
sys.js: sys.inspect: show function names
14 years ago
Ryan Dahl
f08985c193
Handle writeStream errors in sys.pump
14 years ago
Trent Mick
1d961a6630
add ANSI coloring option to sys.inspect and, by default, to the repl
15 years ago
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
15 years ago
isaacs
e55c486801
Missing 'var' in sys.inspect (Found by Oleg Slobodskoi)
15 years ago
Herbert Vojčík
5dc2b93311
Fix sys.inspect for regex in different context.
15 years ago
Mikeal Rogers
16cb45103f
Adds "pause" and "resume" events to pump and it's readable argument.
15 years ago
Dmitry Baranovskiy
d3f04933f1
sys.inherts to shadow constructor property from enumerability
thanks to ES5 features in V8 it is quite easily possible.
15 years ago
Mikeal Rogers
f62979da6b
Add sys.pump
15 years ago
Ben Lowery
f3cd7bbe77
Coerce each argument to a String before attempting to print it via sys.print
15 years ago
Ryan Dahl
d62b0f442a
Fix style in sys.js
15 years ago
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.
15 years ago
Tim Caswell
b480184fd6
Check for a couple of edge cases on the inspect hook.
Don't treat sys.inspect special, same with prototype objects.
15 years ago
Tim Caswell
7f5320b167
Provide a hook for user-specified inspect functions
15 years ago
Ryan Dahl
022c083848
Deprecate sys.p()
15 years ago
isaacs
57fbb627ca
trailing whitespace fixes
15 years ago
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
} }
15 years ago
Ryan Dahl
04c06b9149
child process now use net.Socket
15 years ago
Ryan Dahl
fdf46a65c9
Use streams for stdout and stdin
15 years ago
Ryan Dahl
9be3df0828
Add sys.log()
15 years ago
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.
15 years ago
Ryan Dahl
b021a845f7
Move process.inherits to sys
15 years ago
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.
15 years ago
Benjamin Thomas
a2714be8b5
Add optional third argument sys.inpect to indicate how many times you want it to recurse
15 years ago
Ryan Dahl
de7016eac5
sys.exec() no longer uses Promise
15 years ago
Mark Hansen
98e61db216
sys.inspect(Date) now shows the date value
15 years ago
visionmedia
9c6263bff8
Added multiple arg support for sys.puts(), print(), etc.
15 years ago
Tim Caswell
3aca908db3
Document the changes to sys.inspect's API.
It now takes an optional showHidden argument that shows hidden/non-enumerable properties of objects.
Also cleanup the lib/sys.js file a bit.
15 years ago
Tim Caswell
e33c66654a
Rewrite sys.inspect to be more reliable and handle crazy edge cases.
15 years ago
Ryan Dahl
70293a43c9
API: Move Promise and EventEmitter into 'events' module
15 years ago