diff --git a/deps/v8_inspector/platform/inspector_protocol/CodeGenerator.py b/deps/v8_inspector/platform/inspector_protocol/CodeGenerator.py index 5107feb680860a..62f77a783a5b7e 100644 --- a/deps/v8_inspector/platform/inspector_protocol/CodeGenerator.py +++ b/deps/v8_inspector/platform/inspector_protocol/CodeGenerator.py @@ -180,6 +180,11 @@ def create_primitive_type_definition(type): "integer": "int", "boolean": "bool" } + defaults = { + "number": "0", + "integer": "0", + "boolean": "false" + } jsontypes = { "number": "TypeNumber", "integer": "TypeNumber", @@ -195,6 +200,7 @@ def create_primitive_type_definition(type): "raw_type": typedefs[type], "raw_pass_type": typedefs[type], "raw_return_type": typedefs[type], + "default_value": defaults[type] } type_definitions = {} diff --git a/deps/v8_inspector/platform/inspector_protocol/TypeBuilder_h.template b/deps/v8_inspector/platform/inspector_protocol/TypeBuilder_h.template index 75f67043282b63..144fcb149ffe97 100644 --- a/deps/v8_inspector/platform/inspector_protocol/TypeBuilder_h.template +++ b/deps/v8_inspector/platform/inspector_protocol/TypeBuilder_h.template @@ -187,7 +187,14 @@ public: } private: - {{type.id}}() { } + {{type.id}}() + { + {% for property in type.properties %} + {% if not(property.optional) and "default_value" in resolve_type(property) %} + m_{{property.name}} = {{resolve_type(property).default_value}}; + {%endif %} + {% endfor %} + } {% for property in type.properties %} {% if property.optional %} diff --git a/deps/v8_inspector/platform/v8_inspector/V8Compat.h b/deps/v8_inspector/platform/v8_inspector/V8Compat.h index 17d104f7736ea7..0f5b12cbb6cb07 100644 --- a/deps/v8_inspector/platform/v8_inspector/V8Compat.h +++ b/deps/v8_inspector/platform/v8_inspector/V8Compat.h @@ -7,7 +7,7 @@ #include -#if V8_MAJOR_VERSION < 5 || (V8_MAJOR_VERSION == 5 && V8_MINOR_VERSION < 2) +#if V8_MAJOR_VERSION < 5 || (V8_MAJOR_VERSION == 5 && V8_MINOR_VERSION < 1) namespace v8 { // In standalone V8 inspector this is expected to be noop anyways... @@ -23,6 +23,6 @@ class V8_EXPORT MicrotasksScope { } // namespace v8 -#endif // V8_MAJOR_VERSION < 5 || (V8_MAJOR_VERSION == 5 && V8_MINOR_VERSION < 2) +#endif // V8_MAJOR_VERSION < 5 || (V8_MAJOR_VERSION == 5 && V8_MINOR_VERSION < 1) #endif // V8Compat_h