diff options
Diffstat (limited to 'src/test/fixtures/img-bug.js')
-rw-r--r-- | src/test/fixtures/img-bug.js | 105 |
1 files changed, 58 insertions, 47 deletions
diff --git a/src/test/fixtures/img-bug.js b/src/test/fixtures/img-bug.js index 1d5ec8a82..89b6d464d 100644 --- a/src/test/fixtures/img-bug.js +++ b/src/test/fixtures/img-bug.js @@ -1,48 +1,59 @@ -const hi = () => ({ - its_ireelevant: () => true, -}); -const hey = () => ({ - any_name_will_do: () => 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" }; +function hey() { + const well = { + baz: function () {}, + }; +} + +function yo() { + const hi = { + yo: function () {}, + }; +} + +// function yo() { +// const hi = { +// yo: function () {}, +// }; // } + +// This bug is the same as function-scope-bug.jsx, except this time, +// it's specific to scopes created in property definitions +// That means, either arrow functions or non-arrow functions + +// ESBUILD +// Scope: (5 -1) | Scope (5, -100) +// Scope: (6 12) | Scope (6, 12) +// Scope: (7 15) | Scope (7, 15) +// Scope: (6 43) | Scope (6, 43) +// Scope: (7 55) | Scope (7, 55) +// Scope: (6 78) | Scope (6, 78) +// Scope: (7 81) | Scope (7, 81) + +// Scope (6, 106) +// Scope (7, 118) + +// Scope: (5 -1) | Scope (5, -100) +// Scope: (6 12) | Scope (6, 12) +// Scope: (7 15) | Scope (7, 15) +// Scope: (6 43) | Scope (6, 43) +// Scope: (7 55) | Scope (7, 55) +// Scope: (6 78) | Scope (6, 78) +// Scope: (7 81) | Scope (7, 81) +// Scope: (6 106) | Scope (6, 106) +// Scope: (7 118) | Scope (7, 118) + +// ESBUILD + +// Scope: (5 -1) +// Scope: (6 12) +// Scope: (7 15) +// Scope: (6 43) +// Scope: (7 55) +// Scope: (6 78) +// Scope: (7 81) +// Scope: (6 106) +// Scope: (7 118) +// Scope: (6 141) +// Scope: (7 144) +// Scope: (6 169) +// Scope: (7 181) |