Nathan Rajlich
ebefe77bc0
More bulletproof util.inspect()
function.
...
Use the *real* versions of the Date and RegExp functions, from the
prototype. This defends against code like:
var d = new Date()
d.toUTCString = null
util.inspect(d)
// TypeError: toUTCString is not a function
Fixes #1944 .
2011-10-27 04:58:34 +09:00
Nathan Rajlich
2dbb470ea1
Don't use instanceof
in lib/util.js "is" checks.
...
While using `instanceof`, these functions could easily be faked with something
like: Object.create(Date.prototype)
So let's just not use it at all. A little slower, but these functions are only
used in the REPL / for debugging so it's OK.
Fixes #1941 .
Fixes #1942 .
2011-10-27 04:33:24 +09:00
Nathan Rajlich
b8f3e18a5d
Export the type checking functions from util.js
.
...
As per discussion at:
http://groups.google.com/group/nodejs-dev/browse_thread/thread/b08970166e4670cf
2011-10-27 03:38:29 +09:00
Ryan Dahl
239b3d62de
Remove resume and pause events
...
Too complex; unnecessary.
2011-10-24 13:23:59 -07:00
Ryan Dahl
d77ce4b998
Fixes #1860 . Remove process.writeError
...
Breaks a few tests in "make test-message"
2011-10-18 13:12:50 -07:00
Ryan Dahl
cdf5d91fe5
Remove tty_legacy
2011-10-11 13:41:33 -07:00
Colton Baker
87286cc737
Fixed a lot of jslint errors.
...
Fixes #1831
2011-10-05 18:51:06 -07:00
Ryan Dahl
8c87250816
Do not load readline from util.inspect
...
This causes all modules using console.log() to load readline which seems
unnecessary.
2011-09-12 18:25:23 -07:00
koichik
389e2a07e6
util: Fix inspection for Error
...
Fixes #1634 .
2011-09-11 23:13:06 +09:00
koichik
6139459d45
util: Fix inspection for sparse array
...
Fixes #1651 .
2011-09-09 00:57:42 +09:00
koichik
98b64422bb
util: Divide inspect() into some subroutines
2011-09-09 00:53:37 +09:00
Nathan Rajlich
44574bc39b
util: improve util.isDate() function
...
The old implementation was fragile. i.e. node-time is an example of a user-land
module that exports an extended Date object (with a few added functions on it's
own Date object's prototype). In that case, the old check fails.
2011-09-02 17:29:20 +02:00
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.
2011-08-15 17:22:48 +02:00
koichik
d439c092c2
Improve util.format() compatibility with browser.
...
Fixes #1434 .
2011-08-08 23:24:05 +09:00
koichik
d3d8f1b972
Add %% escape to util.format()
...
Fixes #1273 .
2011-07-30 23:56:17 +09:00
Ben Noordhuis
874260b40f
util: add sprintf-like format() function
...
Fixes #1407 .
2011-07-30 02:11:31 +02:00
koichik
d38fac2230
Fixes #1260
...
RegExp object is no longer Function.
http://code.google.com/p/v8/issues/detail?id=617
2011-07-08 17:18:42 -07:00
Ryan Dahl
d1eba2b18b
Revert "Fixes #1260 "
...
Due to downgrade of V8.
This reverts commit 3e2abd12d3
.
2011-07-05 16:49:13 -07:00
koichik
3e2abd12d3
Fixes #1260
...
RegExp object is no longer Function.
http://code.google.com/p/v8/issues/detail?id=617
2011-07-03 12:19:44 -07:00
Ryan Dahl
1ba2c32135
Massage util.inherits for perf increase
2011-06-11 08:51:48 +02:00
isaacs
4d64f36338
Closes GH-310 Format slashes properly
2011-04-01 17:40:19 -07:00
Ryan Dahl
55048cdf79
Update copyright headers
2011-03-14 17:37:05 -07:00
Devin Torres
8c6a7b5de4
Use more color in the repl, loosely inspired by TextMate's SunBurst theme
2010-12-03 16:07:20 -08:00
Ryan Dahl
558e5ba2b0
lint util.js and src/node.js
2010-12-02 12:27:26 -08:00
Ryan Dahl
dd53ceebe4
lint
2010-12-01 20:59:06 -08:00
Tim Cooijmans
d4b726a1a6
fix utils.inspect's detection of circular structures
2010-11-17 16:06:17 -08:00
Micheil Smith
e38eb0c5a4
Soft migration of sys -> util, Removal of deprecated utils module.
2010-10-11 15:21:36 -07:00
Karl Guertin
4f679fd8d0
Dependency free assert module with unit tests
2009-12-05 01:05:16 +01:00
Felix Geisendörfer
530328f12b
CommonJS testing for node.js
...
Refactored test suite to use the assert module for testing rather than
mjsunit.
2009-12-05 01:05:16 +01:00