Commit c8239c08 authored by Julien Gilli's avatar Julien Gilli
Browse files

console: allow Object.prototype fields as labels

This is a backport of 6c3647c3 from
v0.12 to v0.10.

Console.prototype.timeEnd() returns NaN if the timer label
corresponds to a property on Object.prototype. In v0.12, this was fixed
by using Object.create(null) to construct the _times object

However, the version of V8 in the v0.10 branch makes this fix not work
as expected. In v0.10, this commit changes the _times object into a
array of objects of the form:

{ label: someLabel, time: staringWallClockTime }

someLabel can thus be any string, including any string that represents
any Object.prototype field.

Fixes #9116.

PR: #9215
PR-URL: https://github.com/joyent/node/pull/9215


Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
parent ad068480
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment