Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
lib: simplify own keys retrieval
This replacement can save us a function call, two array spreadings, and an array concatenation. PR-URL: #24582 Refs: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect/ownKeys#Description Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
- Loading branch information
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @@ -1,9 +1,7 @@ | ||
| 'use strict'; | ||
|
|
||
| const copyProps = (unsafe, safe) => { | ||
| for (const key of Reflect.ownKeys(unsafe)) { | ||
| if (!Object.getOwnPropertyDescriptor(safe, key)) { | ||
| Object.defineProperty( | ||
| safe, | ||