8000 gen-mapping: Use `Object.assign` to avoid needing `getOwnPropertyDesc… · jridgewell/sourcemaps@dd0615a · GitHub
[go: up one dir, main page]

Skip to content

Commit dd0615a

Browse files
committed
gen-mapping: Use Object.assign to avoid needing getOwnPropertyDescriptors polyfill
esbuild transpiles object-spread syntax into a call to `Object.getOwnPropertyDescriptors`, which isn't defined in Node v6. Using Object.assign accomplishes the same goal without needing a polyfill.
1 parent 557ca37 commit dd0615a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/gen-mapping/src/gen-mapping.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,12 +287,11 @@ export function toDecodedMap(map: GenMapping): DecodedSourceMap {
287287
*/
288288
export function toEncodedMap(map: GenMapping): EncodedSourceMap {
289289
const decoded = toDecodedMap(map);
290-
return {
291-
...decoded,
290+
return Object.assign({}, decoded, {
292291
// originalScopes: decoded.originalScopes.map((os) => encodeOriginalScopes(os)),
293292
// generatedRanges: encodeGeneratedRanges(decoded.generatedRanges as GeneratedRange[]),
294293
mappings: encode(decoded.mappings as SourceMapSegment[][]),
295-
};
294+
});
296295
}
297296

298297
/**

0 commit comments

Comments
 (0)
0