A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/nodejs/node/commit/546dab29c1 below:

optimize copyError with ObjectAssign in primordials · nodejs/node@546dab2 · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+2

-6

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+2

-6

lines 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

}

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4