Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workaround for non-configurable props in the polyfill #22

Merged
merged 1 commit into from
Aug 27, 2023

Conversation

kolchurinvv
Copy link
Contributor

after bun hit 0.8.0 running a build and subsequently trying to run bun ./build/index.js resulted in a

➜ bun ./build/index.js
572 | }, globals = {
573 |   File
574 | };
575 | function installPolyfills() {
576 |   for (let name in globals)
577 |     Object.defineProperty(globalThis, name, {
        ^
TypeError: Attempting to change configurable attribute of unconfigurable property.
      at installPolyfills (/Users/vladimir/Dev_Projects/lime812-via-bunx/build/index.js:577:4)
      at /Users/vladimir/Dev_Projects/lime812-via-bunx/build/index.js:587:

i'm adding a check in a polyfill loop to skip any not configurable properties

@gornostay25 gornostay25 added the bug Something isn't working label Aug 27, 2023
Copy link
Owner

@gornostay25 gornostay25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your pull request. Please change let to const and I will accept this changes

@@ -19,6 +19,10 @@ const globals = {
};
export default function installPolyfills() {
for (const name in globals) {
let descriptor = Object.getOwnPropertyDescriptor(globalThis, name);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just use const for descriptor variable

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or I can do it by myself

@gornostay25 gornostay25 merged commit 856afd1 into gornostay25:master Aug 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants