| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a12bc2d commit 40d4fee
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -238,6 +238,15 @@ undefined | |||
| 238 | 238 | > | |
| 239 | 239 | ``` | |
| 240 | 240 | ||
| 241 | + ### console.debug(data[, ...args]) | ||
| 242 | + <!-- YAML | ||
| 243 | + added: v8.0.0 | ||
| 244 | + --> | ||
| 245 | + * `data` {any} | ||
| 246 | + * `...args` {any} | ||
| 247 | + | ||
| 248 | + The `console.debug()` function is an alias for [`console.log()`][]. | ||
| 249 | + | ||
| 241 | 250 | ### console.dir(obj[, options]) | |
| 242 | 251 | <!-- YAML | |
| 243 | 252 | added: v0.1.101 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -134,6 +134,9 @@ Console.prototype.log = function log(...args) { | |||
| 134 | 134 | }; | |
| 135 | 135 | ||
| 136 | 136 | ||
| 137 | + Console.prototype.debug = Console.prototype.log; | ||
| 138 | + | ||
| 139 | + | ||
| 137 | 140 | Console.prototype.info = Console.prototype.log; | |
| 138 | 141 | ||
| 139 | 142 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -69,6 +69,13 @@ console.log('%s %s', 'foo', 'bar', 'hop'); | |||
| 69 | 69 | console.log({ slashes: '\\\\' }); | |
| 70 | 70 | console.log(custom_inspect); | |
| 71 | 71 | ||
| 72 | + // test console.debug() goes to stdout | ||
| 73 | + console.debug('foo'); | ||
| 74 | + console.debug('foo', 'bar'); | ||
| 75 | + console.debug('%s %s', 'foo', 'bar', 'hop'); | ||
| 76 | + console.debug({ slashes: '\\\\' }); | ||
| 77 | + console.debug(custom_inspect); | ||
| 78 | + | ||
| 72 | 79 | // test console.info() goes to stdout | |
| 73 | 80 | console.info('foo'); | |
| 74 | 81 | console.info('foo', 'bar'); | |
@@ -154,6 +161,10 @@ for (const expected of expectedStrings) { | |||
| 154 | 161 | assert.strictEqual(errStrings.shift(), `${expected}\n`); | |
| 155 | 162 | } | |
| 156 | 163 | ||
| 164 | + for (const expected of expectedStrings) { | ||
| 165 | + assert.strictEqual(strings.shift(), `${expected}\n`); | ||
| 166 | + } | ||
| 167 | + | ||
| 157 | 168 | assert.strictEqual(strings.shift(), | |
| 158 | 169 | "{ foo: 'bar', inspect: [Function: inspect] }\n"); | |
| 159 | 170 | assert.strictEqual(strings.shift(), | |
| Back | FazBrowse Home | New Git URL |
0 commit comments