@@ -1729,12 +1729,12 @@ class V8_EXPORT StackFrame {
17291729enum StateTag {
17301730 JS,
17311731 GC,
1732- PARSER,
1733- BYTECODE_COMPILER,
17341732 COMPILER,
17351733 OTHER,
17361734 EXTERNAL,
1737- IDLE
1735+ IDLE,
1736+ PARSER,
1737+ BYTECODE_COMPILER
17381738};
17391739
17401740// A RegisterState represents the current state of registers used
@@ -6348,6 +6348,8 @@ typedef void (*FailedAccessCheckCallback)(Local<Object> target,
63486348 * Callback to check if code generation from strings is allowed. See
63496349 * Context::AllowCodeGenerationFromStrings.
63506350 */
6351+ typedef bool (*DeprecatedAllowCodeGenerationFromStringsCallback)(
6352+ Local<Context> context);
63516353typedef bool (*AllowCodeGenerationFromStringsCallback)(Local<Context> context,
63526354 Local<String> source);
63536355
@@ -7636,6 +7638,9 @@ class V8_EXPORT Isolate {
76367638 */
76377639 void SetAllowCodeGenerationFromStringsCallback(
76387640 AllowCodeGenerationFromStringsCallback callback);
7641+ V8_DEPRECATED("Use callback with source parameter.",
7642+ void SetAllowCodeGenerationFromStringsCallback(
7643+ DeprecatedAllowCodeGenerationFromStringsCallback callback));
76397644
76407645 /**
76417646 * Embedder over{ride|load} injection points for wasm APIs. The expectation
@@ -7796,6 +7801,15 @@ class V8_EXPORT V8 {
77967801 "Use isolate version",
77977802 void SetFatalErrorHandler(FatalErrorCallback that));
77987803
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+
77997813 /**
78007814 * Check if V8 is dead and therefore unusable. This is the case after
78017815 * fatal errors such as out-of-memory situations.
@@ -8205,12 +8219,8 @@ class V8_EXPORT SnapshotCreator {
82058219 * Set the default context to be included in the snapshot blob.
82068220 * The snapshot will not contain the global proxy, and we expect one or a
82078221 * global object template to create one, to be provided upon deserialization.
8208- *
8209- * \param callback optional callback to serialize internal fields.
82108222 */
8211- void SetDefaultContext(Local<Context> context,
8212- SerializeInternalFieldsCallback callback =
8213- SerializeInternalFieldsCallback());
8223+ void SetDefaultContext(Local<Context> context);
82148224
82158225 /**
82168226 * Add additional context to be included in the snapshot blob.
@@ -8562,9 +8572,7 @@ class V8_EXPORT Context {
85628572 static Local<Context> New(
85638573 Isolate* isolate, ExtensionConfiguration* extensions = NULL,
85648574 MaybeLocal<ObjectTemplate> global_template = MaybeLocal<ObjectTemplate>(),
8565- MaybeLocal<Value> global_object = MaybeLocal<Value>(),
8566- DeserializeInternalFieldsCallback internal_fields_deserializer =
8567- DeserializeInternalFieldsCallback());
8575+ MaybeLocal<Value> global_object = MaybeLocal<Value>());
85688576
85698577 /**
85708578 * Create a new context from a (non-default) context snapshot. There
@@ -9021,8 +9029,8 @@ class Internals {
90219029 static const int kNodeIsIndependentShift = 3;
90229030 static const int kNodeIsActiveShift = 4;
90239031
9024- static const int kJSApiObjectType = 0xbd ;
9025- static const int kJSObjectType = 0xbe ;
9032+ static const int kJSApiObjectType = 0xbb ;
9033+ static const int kJSObjectType = 0xbc ;
90269034 static const int kFirstNonstringType = 0x80;
90279035 static const int kOddballType = 0x82;
90289036 static const int kForeignType = 0x86;
@@ -10275,6 +10283,14 @@ void* Context::GetAlignedPointerFromEmbedderData(int index) {
1027510283#endif
1027610284}
1027710285
10286+ void V8::SetAllowCodeGenerationFromStringsCallback(
10287+ DeprecatedAllowCodeGenerationFromStringsCallback callback) {
10288+ Isolate* isolate = Isolate::GetCurrent();
10289+ isolate->SetAllowCodeGenerationFromStringsCallback(
10290+ reinterpret_cast<AllowCodeGenerationFromStringsCallback>(callback));
10291+ }
10292+
10293+
1027810294bool V8::IsDead() {
1027910295 Isolate* isolate = Isolate::GetCurrent();
1028010296 return isolate->IsDead();
0 commit comments