| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 37979d7 commit d6f46a4
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -608,8 +608,18 @@ v8::ModifyCodeGenerationFromStringsResult ModifyCodeGenerationFromStrings( | |||
| 608 | 608 | bool is_code_like) { | |
| 609 | 609 | HandleScope scope(context->GetIsolate()); | |
| 610 | 610 | ||
| 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 | + } | ||
| 611 | 618 | 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()) { | ||
| 613 | 623 | // We do not expect the maybe_cache_generated_source_map to throw any more | |
| 614 | 624 | // exceptions. If it does, just ignore it. | |
| 615 | 625 | errors::TryCatchScope try_catch(env); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments