Commit f9014438 authored by Brandon Benvie's avatar Brandon Benvie Committed by koichik
Browse files

util: use getOwnPropertyDescripter

Change formatProperty in util.js to use Object.getOwnPropertyDescriptor
instead of __lookup[GS]etter__.

Use the cached value from the descriptor to reduce number of property
lookups from 3 to 1.

Fallback to standard lookup if the descriptor is empty. This doesn't
ever happen with normal JS objects (this function is called only when
the key exists) but apparently does with Node's custom ENV interface.

Fixes: #2109.
parent 3df7c90c
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