@@ -6348,6 +6348,8 @@ typedef void (*FailedAccessCheckCallback)(Local<Object> target,
6348
6348
* Callback to check if code generation from strings is allowed. See
6349
6349
* Context::AllowCodeGenerationFromStrings.
6350
6350
*/
6351
+ typedef bool (*DeprecatedAllowCodeGenerationFromStringsCallback)(
6352
+ Local<Context> context);
6351
6353
typedef bool (*AllowCodeGenerationFromStringsCallback)(Local<Context> context,
6352
6354
Local<String> source);
6353
6355
@@ -7636,6 +7638,9 @@ class V8_EXPORT Isolate {
7636
7638
*/
7637
7639
void SetAllowCodeGenerationFromStringsCallback(
7638
7640
AllowCodeGenerationFromStringsCallback callback);
7641
+ V8_DEPRECATED("Use callback with source parameter.",
7642
+ void SetAllowCodeGenerationFromStringsCallback(
7643
+ DeprecatedAllowCodeGenerationFromStringsCallback callback));
7639
7644
7640
7645
/**
7641
7646
* Embedder over{ride|load} injection points for wasm APIs. The expectation
@@ -7796,6 +7801,15 @@ class V8_EXPORT V8 {
7796
7801
"Use isolate version",
7797
7802
void SetFatalErrorHandler(FatalErrorCallback that));
7798
7803
7804
+ /**
7805
+ * Set the callback to invoke to check if code generation from
7806
+ * strings should be allowed.
7807
+ */
7808
+ V8_INLINE static V8_DEPRECATED(
7809
+ "Use isolate version",
7810
+ void SetAllowCodeGenerationFromStringsCallback(
7811
+ DeprecatedAllowCodeGenerationFromStringsCallback that));
7812
+
7799
7813
/**
7800
7814
* Check if V8 is dead and therefore unusable. This is the case after
7801
7815
* fatal errors such as out-of-memory situations.
@@ -10275,6 +10289,14 @@ void* Context::GetAlignedPointerFromEmbedderData(int index) {
10275
10289
#endif
10276
10290
}
10277
10291
10292
+ void V8::SetAllowCodeGenerationFromStringsCallback(
10293
+ DeprecatedAllowCodeGenerationFromStringsCallback callback) {
10294
+ Isolate* isolate = Isolate::GetCurrent();
10295
+ isolate->SetAllowCodeGenerationFromStringsCallback(
10296
+ reinterpret_cast<AllowCodeGenerationFromStringsCallback>(callback));
10297
+ }
10298
+
10299
+
10278
10300
bool V8::IsDead() {
10279
10301
Isolate* isolate = Isolate::GetCurrent();
10280
10302
return isolate->IsDead();
0 commit comments