| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent bfabfb4 commit 0d70c79
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,9 +6,9 @@ const { | |||
| 6 | 6 | Error, | |
| 7 | 7 | ErrorCaptureStackTrace, | |
| 8 | 8 | MathMax, | |
| 9 | + ObjectAssign, | ||
| 9 | 10 | ObjectDefineProperty, | |
| 10 | 11 | ObjectGetPrototypeOf, | |
| 11 | - ObjectKeys, | ||
| 12 | 12 | String, | |
| 13 | 13 | StringPrototypeEndsWith, | |
| 14 | 14 | StringPrototypeRepeat, | |
@@ -46,11 +46,7 @@ const kReadableOperator = { | |||
| 46 | 46 | const kMaxShortLength = 12; | |
| 47 | 47 | ||
| 48 | 48 | function copyError(source) { | |
| 49 | - const keys = ObjectKeys(source); | ||
| 50 | - const target = { __proto__: ObjectGetPrototypeOf(source) }; | ||
| 51 | - for (const key of keys) { | ||
| 52 | - target[key] = source[key]; | ||
| 53 | - } | ||
| 49 | + const target = ObjectAssign({ __proto__: ObjectGetPrototypeOf(source) }, source); | ||
| 54 | 50 | ObjectDefineProperty(target, 'message', { __proto__: null, value: source.message }); | |
| 55 | 51 | return target; | |
| 56 | 52 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments