Skip to content

Commit 863df93

Browse files
committed
Remove spread operator calls with Object.assign
1 parent a4edc21 commit 863df93

File tree

1 file changed

+5
-5
lines changed
  • src/javascript/lib/core/erlang_compat

1 file changed

+5
-5
lines changed

src/javascript/lib/core/erlang_compat/maps.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function remove(key, map1) {
3636
return new ErlangTypes.Tuple(BADMAP, map1);
3737
}
3838

39-
const map2 = { ...map1 };
39+
const map2 = Object.assign({}, map1);
4040

4141
delete map2[key];
4242

@@ -87,7 +87,7 @@ function put(key, value, map1) {
8787
return new ErlangTypes.Tuple(BADMAP, map1);
8888
}
8989

90-
const map2 = { ...map1, [key]: value };
90+
const map2 = Object.assign({}, map1, { [key]: value });
9191

9292
return map2;
9393
}
@@ -101,7 +101,7 @@ function merge(map1, map2) {
101101
return new ErlangTypes.Tuple(BADMAP, map2);
102102
}
103103

104-
return { ...map1, ...map2 };
104+
return Object.assign({}, map1, map2);
105105
}
106106

107107
function update(key, value, map1) {
@@ -113,7 +113,7 @@ function update(key, value, map1) {
113113
return new ErlangTypes.Tuple(BADKEY, key);
114114
}
115115

116-
return { ...map1, [key]: value };
116+
return Object.assign({}, map1, { [key]: value });
117117
}
118118

119119
function get(...args) {
@@ -145,7 +145,7 @@ function take(key, map1) {
145145
}
146146

147147
const value = map1[key];
148-
const map2 = { ...map1 };
148+
const map2 = Object.assign({}, map1);
149149
delete map2[key];
150150

151151
return new ErlangTypes.Tuple(value, map2);

0 commit comments

Comments
 (0)