0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-21 21:19:50 +01:00
nodejs/test/parallel/test-console-with-frozen-intrinsics.js
Vinicius Lourenço 890760b8e5
console: fix issues with frozen intrinsics
PR-URL: https://github.com/nodejs/node/pull/54070
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
2024-07-30 04:38:21 +00:00

31 lines
684 B
JavaScript

// flags: --frozen-intrinsics
'use strict';
require('../common');
console.clear();
const consoleMethods = ['log', 'info', 'warn', 'error', 'debug', 'trace'];
for (const method of consoleMethods) {
console[method]('foo');
console[method]('foo', 'bar');
console[method]('%s %s', 'foo', 'bar', 'hop');
}
console.dir({ slashes: '\\\\' });
console.dirxml({ slashes: '\\\\' });
console.time('label');
console.timeLog('label', 'hi');
console.timeEnd('label');
console.assert(true, 'true');
console.count('label');
console.countReset('label');
console.group('label');
console.groupCollapsed('label');
console.groupEnd();
console.table([{ a: 1, b: 2 }, { a: 'foo', b: 'bar' }]);