Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

console: allow Object.prototype fields as labels #9215

Closed
wants to merge 1 commit into from

Commits on Feb 13, 2015

  1. console: allow Object.prototype fields as labels

    This is a backport of 6c3647c 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 nodejs#9116.
    Julien Gilli committed Feb 13, 2015
    Configuration menu
    Copy the full SHA
    5bf417c View commit details
    Browse the repository at this point in the history