Skip to content

lib: add protection in worker_thread.js #59258

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hotpineapple
Copy link

add getter and setter to protect global object's property _eval

add getter and setter to protect global object's property _eval
@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Jul 28, 2025
Copy link
Member

@himself65 himself65 left a comment

Choose a reason for hiding this comment

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

we had it here

addReadOnlyProcessAlias('_eval', '--eval');

is this necessary?

or we just just add writable: false

Putting ObjectDefineProperty on top level may cause some performance regression imo

@himself65 himself65 requested a review from joyeecheung July 28, 2025 20:46
Copy link

codecov bot commented Jul 29, 2025

Codecov Report

❌ Patch coverage is 67.85714% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.05%. Comparing base (0bbe7c3) to head (7080f38).
⚠️ Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/main/worker_thread.js 67.85% 9 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main   #59258    +/-   ##
========================================
  Coverage   90.05%   90.05%            
========================================
  Files         648      648            
  Lines      191106   191222   +116     
  Branches    37454    37477    +23     
========================================
+ Hits       172091   172196   +105     
+ Misses      11641    11634     -7     
- Partials     7374     7392    +18     
Files with missing lines Coverage Δ
lib/internal/main/worker_thread.js 92.02% <67.85%> (-2.39%) ⬇️

... and 37 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants