refactor(MySQL) (#22619)

### What does this PR do?

### How did you verify your code works?

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Ciro Spaciari
2025-09-13 14:52:19 -07:00
committed by GitHub
parent 8e786c1cfc
commit beea7180f3
30 changed files with 2238 additions and 1901 deletions

View File

@@ -98,8 +98,8 @@ for (let i = 0; i < nativeStartIndex; i++) {
// TODO: there is no reason this cannot be converted automatically.
// import { ... } from '...' -> `const { ... } = require('...')`
const scannedImports = t.scanImports(input);
for (const imp of scannedImports) {
const scannedImports = t.scan(input);
for (const imp of scannedImports.imports) {
if (imp.kind === "import-statement") {
var isBuiltin = true;
try {
@@ -120,6 +120,14 @@ for (let i = 0; i < nativeStartIndex; i++) {
}
}
if (scannedImports.exports.includes("default") && scannedImports.exports.length > 1) {
const err = new Error(
`Using \`export default\` AND named exports together in builtin modules is unsupported. See src/js/README.md (from ${moduleList[i]})`,
);
err.name = "BunError";
err.fileName = moduleList[i];
throw err;
}
let importStatements: string[] = [];
const processed = sliceSourceCode(