MCPcopy
hub / github.com/evanw/esbuild / propertyAccessBugWorkaroundForWebKit

Function propertyAccessBugWorkaroundForWebKit

scripts/js-api-tests.js:7377–7402  ·  view source on GitHub ↗
({ esbuild })

Source from the content-addressed store, hash-verified

7375 },
7376
7377 async propertyAccessBugWorkaroundForWebKit({ esbuild }) {
7378 const check = async (target, input, expected) =>
7379 assert.strictEqual((await esbuild.transform(input, { target })).code, expected)
7380 await Promise.all([
7381 check('safari16.2', `x(class{}.y=z)`, `x((class {\n}).y = z);\n`),
7382 check('safari16.3', `x(class{}.y=z)`, `x(class {\n}.y = z);\n`),
7383
7384 check('safari16.2', `x(function(){}.y=z)`, `x((function() {\n}).y = z);\n`),
7385 check('safari16.3', `x(function(){}.y=z)`, `x(function() {\n}.y = z);\n`),
7386
7387 check('safari16.2', `x(function*(){}.y=z)`, `x((function* () {\n}).y = z);\n`),
7388 check('safari16.3', `x(function*(){}.y=z)`, `x(function* () {\n}.y = z);\n`),
7389
7390 check('safari16.2', `x(async function(){}.y=z)`, `x((async function() {\n}).y = z);\n`),
7391 check('safari16.3', `x(async function(){}.y=z)`, `x(async function() {\n}.y = z);\n`),
7392
7393 check('safari16.2', `x(async function*(){}.y=z)`, `x((async function* () {\n}).y = z);\n`),
7394 check('safari16.3', `x(async function*(){}.y=z)`, `x(async function* () {\n}.y = z);\n`),
7395
7396 // This should not be enabled by default
7397 check('esnext', `x(class{}.y=z)`, `x(class {\n}.y = z);\n`),
7398
7399 // This doesn't need to be applied for methods in object literals
7400 check('safari16.2', `x({f(a=-1){}}.y=z)`, `x({ f(a = -1) {\n} }.y = z);\n`),
7401 ])
7402 },
7403
7404 async multipleEngineTargets({ esbuild }) {
7405 const check = async (target, expected) =>

Callers

nothing calls this directly

Calls 1

checkFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…