console: use consolePropAttributes for k-bind properties (reland)

This is a reland of https://github.com/nodejs/node/pull/26850.
It was speculatively reverted but it turned out that this did not
cause any trouble.

PR-URL: https://github.com/nodejs/node/pull/27352
Refs: https://github.com/nodejs/node/pull/26943
Refs: https://github.com/nodejs/node/pull/26850
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
Ruben Bridgewater 2019-04-23 02:04:31 +02:00
parent d088587b7b
commit 6bfde6a81d
No known key found for this signature in database
GPG Key ID: F07496B3EB3C1762

View File

@ -177,15 +177,13 @@ Console.prototype[kBindProperties] = function(ignoreErrors, colorMode) {
...consolePropAttributes, ...consolePropAttributes,
value: Boolean(ignoreErrors) value: Boolean(ignoreErrors)
}, },
'_times': { ...consolePropAttributes, value: new Map() } '_times': { ...consolePropAttributes, value: new Map() },
});
// TODO(joyeecheung): use consolePropAttributes for these
// Corresponds to https://console.spec.whatwg.org/#count-map // Corresponds to https://console.spec.whatwg.org/#count-map
this[kCounts] = new Map(); [kCounts]: { ...consolePropAttributes, value: new Map() },
this[kColorMode] = colorMode; [kColorMode]: { ...consolePropAttributes, value: colorMode },
this[kIsConsole] = true; [kIsConsole]: { ...consolePropAttributes, value: true },
this[kGroupIndent] = ''; [kGroupIndent]: { ...consolePropAttributes, value: '' }
});
}; };
// Make a function that can serve as the callback passed to `stream.write()`. // Make a function that can serve as the callback passed to `stream.write()`.