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

fix(runtime): support restricted unsafe-eval environments #2018

Merged
merged 2 commits into from
Jan 24, 2024

Conversation

ScriptedAlchemy
Copy link
Member

Description

Prevent runtime error when unsafe-eval is restricted by policy

Webpack may transform globalThis into require.g, but that will be something the end user must manage if they cannot support unsafe-eval policy on runtime scripts.

Try to use new function and catch and return whatever globalThis is

Related Issue

#2015

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have updated the documentation.

@zhoushaw zhoushaw merged commit 4810337 into main Jan 24, 2024
7 checks passed
@zhoushaw zhoushaw deleted the fix/unsafe-eval branch January 24, 2024 08:21
@2heal1 2heal1 mentioned this pull request Feb 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants