Commit 11d34188 authored by Julien Puydt's avatar Julien Puydt

Update upstream source from tag 'upstream/1.4.4'

Update to upstream version '1.4.4'
with Debian dir d3cbb5573fba6d8b92aacb5a6d186d0877be31c0
parents 4a8c679b 44fc3ef2
# sourcemap-codec changelog
## 1.4.4
* Use Uint32Array, yikes ([#77](https://github.com/Rich-Harris/sourcemap-codec/pull/77))
## 1.4.3
* Use Uint16Array to prevent overflow ([#75](https://github.com/Rich-Harris/sourcemap-codec/pull/75))
......
{
"name": "sourcemap-codec",
"version": "1.4.3",
"version": "1.4.4",
"description": "Encode/decode sourcemap mappings",
"main": "dist/sourcemap-codec.umd.js",
"module": "dist/sourcemap-codec.es.js",
......
......@@ -27,12 +27,12 @@ export function decode(mappings: string): SourceMapMappings {
const c = mappings.charCodeAt(i);
if (c === 44) { // ","
if (segment.length) line.push(new Int16Array(segment) as any);
if (segment.length) line.push(new Int32Array(segment) as any);
segment = [];
j = 0;
} else if (c === 59) { // ";"
if (segment.length) line.push(new Int16Array(segment) as any);
if (segment.length) line.push(new Int32Array(segment) as any);
segment = [];
j = 0;
decoded.push(line);
......@@ -85,7 +85,7 @@ export function decode(mappings: string): SourceMapMappings {
}
}
if (segment.length) line.push(new Int16Array(segment) as any);
if (segment.length) line.push(new Int32Array(segment) as any);
decoded.push(line);
return decoded;
......
......@@ -133,6 +133,18 @@ describe('sourcemap-codec', () => {
[282, 0, 13, 34]
]
]
},
{
// Make sure Int16 isn't being used
encoded: "gw+BAAAA,w+BAAAA,w+BAAAA,w+BAAAA",
decoded: [
[
[32000,0,0,0,0],
[33000,0,0,0,0],
[34000,0,0,0,0],
[35000,0,0,0,0]
]
]
}
];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment