diff --git a/src/bun.js/modules/AbortControllerModuleModule.h b/src/bun.js/modules/AbortControllerModuleModule.h index 07c8ccea03..31cd3d23de 100644 --- a/src/bun.js/modules/AbortControllerModuleModule.h +++ b/src/bun.js/modules/AbortControllerModuleModule.h @@ -41,14 +41,14 @@ inline void generateNativeModule_AbortControllerModule( // https://github.com/mysticatea/abort-controller/blob/a935d38e09eb95d6b633a8c42fcceec9969e7b05/dist/abort-controller.js#L125 abortController->putDirect( vm, signalIdent, abortSignal, - static_cast(PropertyAttribute::DontEnum)); + static_cast(PropertyAttribute::DontDelete)); abortController->putDirect( vm, controllerIdent, abortController, - static_cast(PropertyAttribute::DontEnum)); + static_cast(PropertyAttribute::DontDelete)); abortController->putDirect( vm, vm.propertyNames->defaultKeyword, abortController, - static_cast(PropertyAttribute::DontEnum)); + static_cast(PropertyAttribute::DontDelete)); } } // namespace Zig diff --git a/test/regression/issue/09739.test.ts b/test/regression/issue/09739.test.ts new file mode 100644 index 0000000000..e89b0a1ce3 --- /dev/null +++ b/test/regression/issue/09739.test.ts @@ -0,0 +1,12 @@ +import { test, expect } from "bun:test"; +const node_js_shim = require("./abort-controller-fixture"); + +test("AbortController from abort-controller fixture works when used with ESM -> CJS -> ESM", () => { + expect(node_js_shim.AbortController).toBe(AbortController); +}); + +test("AbortController from abort-controller fixture works when used with ESM -> ESM", async () => { + delete require.cache["abort-controller"]; + const node_js_shim = await import("abort-controller"); + expect(node_js_shim.AbortController).toBe(AbortController); +}); diff --git a/test/regression/issue/abort-controller-fixture.js b/test/regression/issue/abort-controller-fixture.js new file mode 100644 index 0000000000..7a5ee4a5e2 --- /dev/null +++ b/test/regression/issue/abort-controller-fixture.js @@ -0,0 +1,29 @@ +"use strict"; +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __exportStar = + (this && this.__exportStar) || + function (m, exports) { + for (var p in m) + if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); + }; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("abort-controller"), exports);