diff options
author | 2021-05-13 17:44:50 -0700 | |
---|---|---|
committer | 2021-05-13 17:44:50 -0700 | |
commit | ca4120afec54fc20295a4a7d3ce6f8c29eccd84c (patch) | |
tree | 6619890c616bde65b3798b28fb99018b1eac71e3 /src/test/fixtures/img-bug.js | |
parent | 2eb09c1fec3a11067066602e2d6613e817a06630 (diff) | |
download | bun-ca4120afec54fc20295a4a7d3ce6f8c29eccd84c.tar.gz bun-ca4120afec54fc20295a4a7d3ce6f8c29eccd84c.tar.zst bun-ca4120afec54fc20295a4a7d3ce6f8c29eccd84c.zip |
bug fixes galore
Former-commit-id: 72439452918caa05a32d4e3607910901fa2f4f85
Diffstat (limited to 'src/test/fixtures/img-bug.js')
-rw-r--r-- | src/test/fixtures/img-bug.js | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/src/test/fixtures/img-bug.js b/src/test/fixtures/img-bug.js new file mode 100644 index 000000000..207f59a09 --- /dev/null +++ b/src/test/fixtures/img-bug.js @@ -0,0 +1,61 @@ +function get() { + if (true) { + if (true) { + if (true) { + console.log("HI"); + if (true) { + return { hi: () => true }; + } + } + } + + if (true) { + if (true) { + if (true) { + return { hi: () => true }; + } + } + } + } +} +// function getWidths(width, layout, sizes) { +// if (sizes && (layout === "fill" || layout === "responsive")) { +// // Find all the "vw" percent sizes used in the sizes prop +// const percentSizes = [...sizes.matchAll(/(^|\s)(1?\d?\d)vw/g)].map((m) => +// parseInt(m[2]) +// ); +// if (percentSizes.length) { + +// // const smallestRatio = Math.min(...percentSizes) * 0.01; +// // return { +// // widths: allSizes.filter( +// // (s) => s >= configDeviceSizes[0] * smallestRatio +// // ), +// // kind: "w", +// // }; +// } +// return { widths: allSizes, kind: "w" }; +// } +// if ( +// typeof width !== "number" || +// layout === "fill" || +// layout === "responsive" +// ) { +// return { widths: configDeviceSizes, kind: "w" }; +// } +// // const widths = [ +// // ...new Set( // > This means that most OLED screens that say they are 3x resolution, +// // // > are actually 3x in the green color, but only 1.5x in the red and +// // // > blue colors. Showing a 3x resolution image in the app vs a 2x +// // // > resolution image will be visually the same, though the 3x image +// // // > takes significantly more data. Even true 3x resolution screens are +// // // > wasteful as the human eye cannot see that level of detail without +// // // > something like a magnifying glass. +// // // https://blog.twitter.com/engineering/en_us/topics/infrastructure/2019/capping-image-fidelity-on-ultra-high-resolution-devices.html +// // [width, width * 2 /*, width * 3*/].map( +// // (w) => allSizes.find((p) => p >= w) || allSizes[allSizes.length - 1] +// // ) +// // ), +// // ]; +// // return { widths, kind: "x" }; +// } |