GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: make ModifyCodeGenerationFromStrings more robust · nodejs/node@1e7d101

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • node_errors.cc
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/node_errors.cc‎

Copy file name to clipboardExpand all lines: src/node_errors.cc
+11-1Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,8 +608,18 @@ v8::ModifyCodeGenerationFromStringsResult ModifyCodeGenerationFromStrings(
608608
bool is_code_like) {
609609
HandleScope scope(context->GetIsolate());
610610

611+
if (context->GetNumberOfEmbedderDataFields() <=
612+
ContextEmbedderIndex::kAllowCodeGenerationFromStrings) {
613+
// The context is not (yet) configured by Node.js for this. We don't
614+
// have enough information to make a decision, just allow it which is
615+
// the default.
616+
return {true, {}};
617+
}
611618
Environment* env = Environment::GetCurrent(context);
612-
if (env->source_maps_enabled()) {
619+
if (env == nullptr) {
620+
return {true, {}};
621+
}
622+
if (env->source_maps_enabled() && env->can_call_into_js()) {
613623
// We do not expect the maybe_cache_generated_source_map to throw any more
614624
// exceptions. If it does, just ignore it.
615625
errors::TryCatchScope try_catch(env);

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.