src: allow --disallow-code-generation-from-strings in workers#60549
src: allow --disallow-code-generation-from-strings in workers#60549mcollina wants to merge 2 commits intonodejs:mainfrom
Conversation
|
Review requested:
|
|
cc @legendecas I presume this is incorrect then. |
| @@ -703,6 +700,18 @@ Maybe<void> InitializeContextRuntime(Local<Context> context) { | |||
| // to the runtime flags, propagate the value to the embedder data. | |||
| bool is_code_generation_from_strings_allowed = | |||
There was a problem hiding this comment.
The V8Option{} is removed in node_options.cc for --disallow-code-generation-from-strings, this will always be true. Because the flag is not set in V8.
My comment at #60371 (comment) was answering the question "why aren't v8 options supported for a worker thread?" and to most V8 options, we should not change them for a single worker. However, we declared a same name flag In short, I think this PR should be good. |
legendecas
left a comment
There was a problem hiding this comment.
A side-effect of this could be add-ons using v8::Context::New API directly, and these contexts will always allow code generation regardless if --disallow-code-generation-from-strings is specified or not.
Make --disallow-code-generation-from-strings a per-isolate option instead of a V8-only option, allowing it to be passed via worker execArgv. Fixes: nodejs#60371
7c3a9d5 to
90d3623
Compare
|
@LegendCas @addaleax can you take another look? This should be ready. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #60549 +/- ##
==========================================
- Coverage 88.58% 88.52% -0.07%
==========================================
Files 704 703 -1
Lines 207777 208447 +670
Branches 40033 40196 +163
==========================================
+ Hits 184068 184525 +457
- Misses 15755 15936 +181
- Partials 7954 7986 +32
🚀 New features to boost your workflow:
|
Break long line to comply with 80-character limit.
|
Might need a format-cpp. |
Make
--disallow-code-generation-from-stringsa per-isolate option instead of a V8-only option, allowing it to be passed via workerexecArgv.Fixes: #60371