Browse Source

LibJS: Remove Object(Object& prototype) footgun

This constructor was easily confused with a copy constructor, and it was
possible to accidentally copy-construct Objects in at least one way that
we dicovered (via generic ThrowCompletionOr construction).

This patch adds a mandatory ConstructWithPrototypeTag parameter to the
constructor to disambiguate it.
Andreas Kling 2 years ago
parent
commit
4abdb68655
90 changed files with 100 additions and 99 deletions
  1. 4 4
      Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp
  2. 1 1
      Tests/LibWasm/test-wasm.cpp
  3. 1 1
      Userland/Applications/Spreadsheet/JSIntegration.cpp
  4. 1 1
      Userland/Libraries/LibJS/Runtime/AggregateErrorPrototype.cpp
  5. 1 1
      Userland/Libraries/LibJS/Runtime/ArgumentsObject.cpp
  6. 1 1
      Userland/Libraries/LibJS/Runtime/Array.cpp
  7. 2 2
      Userland/Libraries/LibJS/Runtime/ArrayBuffer.cpp
  8. 1 1
      Userland/Libraries/LibJS/Runtime/ArrayIterator.cpp
  9. 1 1
      Userland/Libraries/LibJS/Runtime/AsyncFromSyncIterator.cpp
  10. 1 1
      Userland/Libraries/LibJS/Runtime/AsyncFunctionPrototype.cpp
  11. 1 1
      Userland/Libraries/LibJS/Runtime/AsyncGenerator.cpp
  12. 1 1
      Userland/Libraries/LibJS/Runtime/AsyncIteratorPrototype.cpp
  13. 1 1
      Userland/Libraries/LibJS/Runtime/AtomicsObject.cpp
  14. 1 1
      Userland/Libraries/LibJS/Runtime/BigIntObject.cpp
  15. 1 1
      Userland/Libraries/LibJS/Runtime/BigIntPrototype.cpp
  16. 1 1
      Userland/Libraries/LibJS/Runtime/BooleanObject.cpp
  17. 1 1
      Userland/Libraries/LibJS/Runtime/ConsoleObject.cpp
  18. 1 1
      Userland/Libraries/LibJS/Runtime/DataView.cpp
  19. 1 1
      Userland/Libraries/LibJS/Runtime/Date.cpp
  20. 1 1
      Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp
  21. 1 1
      Userland/Libraries/LibJS/Runtime/Error.cpp
  22. 1 1
      Userland/Libraries/LibJS/Runtime/FinalizationRegistry.cpp
  23. 1 1
      Userland/Libraries/LibJS/Runtime/FunctionObject.cpp
  24. 1 1
      Userland/Libraries/LibJS/Runtime/GeneratorFunctionPrototype.cpp
  25. 1 1
      Userland/Libraries/LibJS/Runtime/GeneratorObject.cpp
  26. 1 1
      Userland/Libraries/LibJS/Runtime/Intl/Collator.cpp
  27. 1 1
      Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormat.cpp
  28. 1 1
      Userland/Libraries/LibJS/Runtime/Intl/DisplayNames.cpp
  29. 1 1
      Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp
  30. 1 1
      Userland/Libraries/LibJS/Runtime/Intl/Intl.cpp
  31. 1 1
      Userland/Libraries/LibJS/Runtime/Intl/ListFormat.cpp
  32. 2 2
      Userland/Libraries/LibJS/Runtime/Intl/Locale.cpp
  33. 1 1
      Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.cpp
  34. 1 1
      Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormat.cpp
  35. 1 1
      Userland/Libraries/LibJS/Runtime/Intl/SegmentIterator.cpp
  36. 1 1
      Userland/Libraries/LibJS/Runtime/Intl/Segmenter.cpp
  37. 1 1
      Userland/Libraries/LibJS/Runtime/Intl/Segments.cpp
  38. 1 1
      Userland/Libraries/LibJS/Runtime/IteratorPrototype.cpp
  39. 1 1
      Userland/Libraries/LibJS/Runtime/JSONObject.cpp
  40. 1 1
      Userland/Libraries/LibJS/Runtime/Map.cpp
  41. 1 1
      Userland/Libraries/LibJS/Runtime/MapIterator.cpp
  42. 1 1
      Userland/Libraries/LibJS/Runtime/MathObject.cpp
  43. 1 1
      Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.cpp
  44. 1 1
      Userland/Libraries/LibJS/Runtime/NumberObject.cpp
  45. 2 2
      Userland/Libraries/LibJS/Runtime/Object.cpp
  46. 2 1
      Userland/Libraries/LibJS/Runtime/Object.h
  47. 1 1
      Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp
  48. 1 1
      Userland/Libraries/LibJS/Runtime/Promise.cpp
  49. 1 1
      Userland/Libraries/LibJS/Runtime/PrototypeObject.h
  50. 1 1
      Userland/Libraries/LibJS/Runtime/ReflectObject.cpp
  51. 2 2
      Userland/Libraries/LibJS/Runtime/RegExpObject.cpp
  52. 1 1
      Userland/Libraries/LibJS/Runtime/RegExpStringIterator.cpp
  53. 1 1
      Userland/Libraries/LibJS/Runtime/Set.cpp
  54. 1 1
      Userland/Libraries/LibJS/Runtime/SetIterator.cpp
  55. 1 1
      Userland/Libraries/LibJS/Runtime/ShadowRealm.cpp
  56. 1 1
      Userland/Libraries/LibJS/Runtime/StringIterator.cpp
  57. 1 1
      Userland/Libraries/LibJS/Runtime/StringObject.cpp
  58. 1 1
      Userland/Libraries/LibJS/Runtime/SymbolObject.cpp
  59. 1 1
      Userland/Libraries/LibJS/Runtime/SymbolPrototype.cpp
  60. 1 1
      Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp
  61. 1 1
      Userland/Libraries/LibJS/Runtime/Temporal/Duration.cpp
  62. 1 1
      Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp
  63. 1 1
      Userland/Libraries/LibJS/Runtime/Temporal/Now.cpp
  64. 1 1
      Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp
  65. 1 1
      Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTime.cpp
  66. 1 1
      Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDay.cpp
  67. 1 1
      Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.cpp
  68. 1 1
      Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp
  69. 1 1
      Userland/Libraries/LibJS/Runtime/Temporal/Temporal.cpp
  70. 1 1
      Userland/Libraries/LibJS/Runtime/Temporal/TimeZone.cpp
  71. 1 1
      Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.cpp
  72. 1 1
      Userland/Libraries/LibJS/Runtime/TypedArray.cpp
  73. 1 1
      Userland/Libraries/LibJS/Runtime/TypedArray.h
  74. 1 1
      Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp
  75. 1 1
      Userland/Libraries/LibJS/Runtime/WeakMap.cpp
  76. 2 2
      Userland/Libraries/LibJS/Runtime/WeakRef.cpp
  77. 1 1
      Userland/Libraries/LibJS/Runtime/WeakSet.cpp
  78. 1 1
      Userland/Libraries/LibWeb/Bindings/CSSNamespace.cpp
  79. 1 1
      Userland/Libraries/LibWeb/Bindings/LocationPrototype.h
  80. 1 1
      Userland/Libraries/LibWeb/Bindings/PlatformObject.cpp
  81. 1 1
      Userland/Libraries/LibWeb/Bindings/WindowPrototype.h
  82. 1 1
      Userland/Libraries/LibWeb/DOM/IDLEventListener.cpp
  83. 1 1
      Userland/Libraries/LibWeb/WebAssembly/WebAssemblyInstanceObject.cpp
  84. 1 1
      Userland/Libraries/LibWeb/WebAssembly/WebAssemblyInstanceObjectPrototype.h
  85. 1 1
      Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryPrototype.h
  86. 1 1
      Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleObject.cpp
  87. 1 1
      Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModulePrototype.h
  88. 2 2
      Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp
  89. 1 1
      Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTableObject.cpp
  90. 1 1
      Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTablePrototype.h

+ 4 - 4
Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp

@@ -2436,15 +2436,15 @@ namespace Web::Bindings {
         // https://webidl.spec.whatwg.org/#es-DOMException-specialness
         // https://webidl.spec.whatwg.org/#es-DOMException-specialness
         // Object.getPrototypeOf(DOMException.prototype) === Error.prototype
         // Object.getPrototypeOf(DOMException.prototype) === Error.prototype
         generator.append(R"~~~(
         generator.append(R"~~~(
-    : Object(*realm.intrinsics().error_prototype())
+    : Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().error_prototype())
 )~~~");
 )~~~");
     } else if (!interface.parent_name.is_empty()) {
     } else if (!interface.parent_name.is_empty()) {
         generator.append(R"~~~(
         generator.append(R"~~~(
-    : Object(ensure_web_prototype<@prototype_base_class@>(realm, "@parent_name@"))
+    : Object(ConstructWithPrototypeTag::Tag, ensure_web_prototype<@prototype_base_class@>(realm, "@parent_name@"))
 )~~~");
 )~~~");
     } else {
     } else {
         generator.append(R"~~~(
         generator.append(R"~~~(
-    : Object(*realm.intrinsics().object_prototype())
+    : Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().object_prototype())
 )~~~");
 )~~~");
     }
     }
 
 
@@ -2873,7 +2873,7 @@ using namespace Web::WebIDL;
 namespace Web::Bindings {
 namespace Web::Bindings {
 
 
 @prototype_class@::@prototype_class@(JS::Realm& realm)
 @prototype_class@::@prototype_class@(JS::Realm& realm)
-    : Object(*realm.intrinsics().iterator_prototype())
+    : Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().iterator_prototype())
 {
 {
 }
 }
 
 

+ 1 - 1
Tests/LibWasm/test-wasm.cpp

@@ -38,7 +38,7 @@ class WebAssemblyModule final : public JS::Object {
 
 
 public:
 public:
     explicit WebAssemblyModule(JS::Object& prototype)
     explicit WebAssemblyModule(JS::Object& prototype)
-        : JS::Object(prototype)
+        : JS::Object(ConstructWithPrototypeTag::Tag, prototype)
     {
     {
         m_machine.enable_instruction_count_limit();
         m_machine.enable_instruction_count_limit();
     }
     }

+ 1 - 1
Userland/Applications/Spreadsheet/JSIntegration.cpp

@@ -371,7 +371,7 @@ JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::get_column_bound)
 }
 }
 
 
 WorkbookObject::WorkbookObject(JS::Realm& realm, Workbook& workbook)
 WorkbookObject::WorkbookObject(JS::Realm& realm, Workbook& workbook)
-    : JS::Object(*realm.intrinsics().object_prototype())
+    : JS::Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().object_prototype())
     , m_workbook(workbook)
     , m_workbook(workbook)
 {
 {
 }
 }

+ 1 - 1
Userland/Libraries/LibJS/Runtime/AggregateErrorPrototype.cpp

@@ -11,7 +11,7 @@
 namespace JS {
 namespace JS {
 
 
 AggregateErrorPrototype::AggregateErrorPrototype(Realm& realm)
 AggregateErrorPrototype::AggregateErrorPrototype(Realm& realm)
-    : Object(*realm.intrinsics().error_prototype())
+    : Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().error_prototype())
 {
 {
 }
 }
 
 

+ 1 - 1
Userland/Libraries/LibJS/Runtime/ArgumentsObject.cpp

@@ -11,7 +11,7 @@
 namespace JS {
 namespace JS {
 
 
 ArgumentsObject::ArgumentsObject(Realm& realm, Environment& environment)
 ArgumentsObject::ArgumentsObject(Realm& realm, Environment& environment)
-    : Object(*realm.intrinsics().object_prototype())
+    : Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().object_prototype())
     , m_environment(environment)
     , m_environment(environment)
 {
 {
 }
 }

+ 1 - 1
Userland/Libraries/LibJS/Runtime/Array.cpp

@@ -61,7 +61,7 @@ NonnullGCPtr<Array> Array::create_from(Realm& realm, Vector<Value> const& elemen
 }
 }
 
 
 Array::Array(Object& prototype)
 Array::Array(Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
 {
 {
 }
 }
 
 

+ 2 - 2
Userland/Libraries/LibJS/Runtime/ArrayBuffer.cpp

@@ -31,14 +31,14 @@ NonnullGCPtr<ArrayBuffer> ArrayBuffer::create(Realm& realm, ByteBuffer* buffer)
 }
 }
 
 
 ArrayBuffer::ArrayBuffer(ByteBuffer buffer, Object& prototype)
 ArrayBuffer::ArrayBuffer(ByteBuffer buffer, Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
     , m_buffer(move(buffer))
     , m_buffer(move(buffer))
     , m_detach_key(js_undefined())
     , m_detach_key(js_undefined())
 {
 {
 }
 }
 
 
 ArrayBuffer::ArrayBuffer(ByteBuffer* buffer, Object& prototype)
 ArrayBuffer::ArrayBuffer(ByteBuffer* buffer, Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
     , m_buffer(buffer)
     , m_buffer(buffer)
     , m_detach_key(js_undefined())
     , m_detach_key(js_undefined())
 {
 {

+ 1 - 1
Userland/Libraries/LibJS/Runtime/ArrayIterator.cpp

@@ -15,7 +15,7 @@ NonnullGCPtr<ArrayIterator> ArrayIterator::create(Realm& realm, Value array, Obj
 }
 }
 
 
 ArrayIterator::ArrayIterator(Value array, Object::PropertyKind iteration_kind, Object& prototype)
 ArrayIterator::ArrayIterator(Value array, Object::PropertyKind iteration_kind, Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
     , m_array(array)
     , m_array(array)
     , m_iteration_kind(iteration_kind)
     , m_iteration_kind(iteration_kind)
 {
 {

+ 1 - 1
Userland/Libraries/LibJS/Runtime/AsyncFromSyncIterator.cpp

@@ -17,7 +17,7 @@ NonnullGCPtr<AsyncFromSyncIterator> AsyncFromSyncIterator::create(Realm& realm,
 }
 }
 
 
 AsyncFromSyncIterator::AsyncFromSyncIterator(Realm& realm, Iterator sync_iterator_record)
 AsyncFromSyncIterator::AsyncFromSyncIterator(Realm& realm, Iterator sync_iterator_record)
-    : Object(*realm.intrinsics().async_from_sync_iterator_prototype())
+    : Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().async_from_sync_iterator_prototype())
     , m_sync_iterator_record(sync_iterator_record)
     , m_sync_iterator_record(sync_iterator_record)
 {
 {
 }
 }

+ 1 - 1
Userland/Libraries/LibJS/Runtime/AsyncFunctionPrototype.cpp

@@ -10,7 +10,7 @@
 namespace JS {
 namespace JS {
 
 
 AsyncFunctionPrototype::AsyncFunctionPrototype(Realm& realm)
 AsyncFunctionPrototype::AsyncFunctionPrototype(Realm& realm)
-    : Object(*realm.intrinsics().function_prototype())
+    : Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().function_prototype())
 {
 {
 }
 }
 
 

+ 1 - 1
Userland/Libraries/LibJS/Runtime/AsyncGenerator.cpp

@@ -12,7 +12,7 @@
 namespace JS {
 namespace JS {
 
 
 AsyncGenerator::AsyncGenerator(Object& prototype)
 AsyncGenerator::AsyncGenerator(Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
 {
 {
 }
 }
 
 

+ 1 - 1
Userland/Libraries/LibJS/Runtime/AsyncIteratorPrototype.cpp

@@ -9,7 +9,7 @@
 namespace JS {
 namespace JS {
 
 
 AsyncIteratorPrototype::AsyncIteratorPrototype(Realm& realm)
 AsyncIteratorPrototype::AsyncIteratorPrototype(Realm& realm)
-    : Object(*realm.intrinsics().object_prototype())
+    : Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().object_prototype())
 {
 {
 }
 }
 
 

+ 1 - 1
Userland/Libraries/LibJS/Runtime/AtomicsObject.cpp

@@ -125,7 +125,7 @@ static ThrowCompletionOr<Value> perform_atomic_operation(VM& vm, TypedArrayBase&
 }
 }
 
 
 AtomicsObject::AtomicsObject(Realm& realm)
 AtomicsObject::AtomicsObject(Realm& realm)
-    : Object(*realm.intrinsics().object_prototype())
+    : Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().object_prototype())
 {
 {
 }
 }
 
 

+ 1 - 1
Userland/Libraries/LibJS/Runtime/BigIntObject.cpp

@@ -15,7 +15,7 @@ NonnullGCPtr<BigIntObject> BigIntObject::create(Realm& realm, BigInt& bigint)
 }
 }
 
 
 BigIntObject::BigIntObject(BigInt& bigint, Object& prototype)
 BigIntObject::BigIntObject(BigInt& bigint, Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
     , m_bigint(bigint)
     , m_bigint(bigint)
 {
 {
 }
 }

+ 1 - 1
Userland/Libraries/LibJS/Runtime/BigIntPrototype.cpp

@@ -18,7 +18,7 @@
 namespace JS {
 namespace JS {
 
 
 BigIntPrototype::BigIntPrototype(Realm& realm)
 BigIntPrototype::BigIntPrototype(Realm& realm)
-    : Object(*realm.intrinsics().object_prototype())
+    : Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().object_prototype())
 {
 {
 }
 }
 
 

+ 1 - 1
Userland/Libraries/LibJS/Runtime/BooleanObject.cpp

@@ -15,7 +15,7 @@ NonnullGCPtr<BooleanObject> BooleanObject::create(Realm& realm, bool value)
 }
 }
 
 
 BooleanObject::BooleanObject(bool value, Object& prototype)
 BooleanObject::BooleanObject(bool value, Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
     , m_value(value)
     , m_value(value)
 {
 {
 }
 }

+ 1 - 1
Userland/Libraries/LibJS/Runtime/ConsoleObject.cpp

@@ -13,7 +13,7 @@
 namespace JS {
 namespace JS {
 
 
 ConsoleObject::ConsoleObject(Realm& realm)
 ConsoleObject::ConsoleObject(Realm& realm)
-    : Object(*realm.intrinsics().object_prototype())
+    : Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().object_prototype())
     , m_console(make<Console>(realm))
     , m_console(make<Console>(realm))
 {
 {
 }
 }

+ 1 - 1
Userland/Libraries/LibJS/Runtime/DataView.cpp

@@ -14,7 +14,7 @@ NonnullGCPtr<DataView> DataView::create(Realm& realm, ArrayBuffer* viewed_buffer
 }
 }
 
 
 DataView::DataView(ArrayBuffer* viewed_buffer, size_t byte_length, size_t byte_offset, Object& prototype)
 DataView::DataView(ArrayBuffer* viewed_buffer, size_t byte_length, size_t byte_offset, Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
     , m_viewed_array_buffer(viewed_buffer)
     , m_viewed_array_buffer(viewed_buffer)
     , m_byte_length(byte_length)
     , m_byte_length(byte_length)
     , m_byte_offset(byte_offset)
     , m_byte_offset(byte_offset)

+ 1 - 1
Userland/Libraries/LibJS/Runtime/Date.cpp

@@ -27,7 +27,7 @@ NonnullGCPtr<Date> Date::create(Realm& realm, double date_value)
 }
 }
 
 
 Date::Date(double date_value, Object& prototype)
 Date::Date(double date_value, Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
     , m_date_value(date_value)
     , m_date_value(date_value)
 {
 {
 }
 }

+ 1 - 1
Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp

@@ -208,7 +208,7 @@ ThrowCompletionOr<Object*> ECMAScriptFunctionObject::internal_construct(MarkedVe
     // 3. If kind is base, then
     // 3. If kind is base, then
     if (kind == ConstructorKind::Base) {
     if (kind == ConstructorKind::Base) {
         // a. Let thisArgument be ? OrdinaryCreateFromConstructor(newTarget, "%Object.prototype%").
         // a. Let thisArgument be ? OrdinaryCreateFromConstructor(newTarget, "%Object.prototype%").
-        this_argument = TRY(ordinary_create_from_constructor<Object>(vm, new_target, &Intrinsics::object_prototype));
+        this_argument = TRY(ordinary_create_from_constructor<Object>(vm, new_target, &Intrinsics::object_prototype, ConstructWithPrototypeTag::Tag));
     }
     }
 
 
     ExecutionContext callee_context(heap());
     ExecutionContext callee_context(heap());

+ 1 - 1
Userland/Libraries/LibJS/Runtime/Error.cpp

@@ -29,7 +29,7 @@ NonnullGCPtr<Error> Error::create(Realm& realm, DeprecatedString const& message)
 }
 }
 
 
 Error::Error(Object& prototype)
 Error::Error(Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
 {
 {
     populate_stack();
     populate_stack();
 }
 }

+ 1 - 1
Userland/Libraries/LibJS/Runtime/FinalizationRegistry.cpp

@@ -10,7 +10,7 @@
 namespace JS {
 namespace JS {
 
 
 FinalizationRegistry::FinalizationRegistry(Realm& realm, JobCallback cleanup_callback, Object& prototype)
 FinalizationRegistry::FinalizationRegistry(Realm& realm, JobCallback cleanup_callback, Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
     , WeakContainer(heap())
     , WeakContainer(heap())
     , m_realm(realm)
     , m_realm(realm)
     , m_cleanup_callback(move(cleanup_callback))
     , m_cleanup_callback(move(cleanup_callback))

+ 1 - 1
Userland/Libraries/LibJS/Runtime/FunctionObject.cpp

@@ -19,7 +19,7 @@ FunctionObject::FunctionObject(Realm& realm, Object* prototype)
 }
 }
 
 
 FunctionObject::FunctionObject(Object& prototype)
 FunctionObject::FunctionObject(Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
 {
 {
 }
 }
 
 

+ 1 - 1
Userland/Libraries/LibJS/Runtime/GeneratorFunctionPrototype.cpp

@@ -11,7 +11,7 @@
 namespace JS {
 namespace JS {
 
 
 GeneratorFunctionPrototype::GeneratorFunctionPrototype(Realm& realm)
 GeneratorFunctionPrototype::GeneratorFunctionPrototype(Realm& realm)
-    : Object(*realm.intrinsics().function_prototype())
+    : Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().function_prototype())
 {
 {
 }
 }
 
 

+ 1 - 1
Userland/Libraries/LibJS/Runtime/GeneratorObject.cpp

@@ -36,7 +36,7 @@ ThrowCompletionOr<NonnullGCPtr<GeneratorObject>> GeneratorObject::create(Realm&
 }
 }
 
 
 GeneratorObject::GeneratorObject(Realm&, Object& prototype, ExecutionContext context)
 GeneratorObject::GeneratorObject(Realm&, Object& prototype, ExecutionContext context)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
     , m_execution_context(move(context))
     , m_execution_context(move(context))
 {
 {
 }
 }

+ 1 - 1
Userland/Libraries/LibJS/Runtime/Intl/Collator.cpp

@@ -10,7 +10,7 @@ namespace JS::Intl {
 
 
 // 10 Collator Objects, https://tc39.es/ecma402/#collator-objects
 // 10 Collator Objects, https://tc39.es/ecma402/#collator-objects
 Collator::Collator(Object& prototype)
 Collator::Collator(Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
 {
 {
 }
 }
 
 

+ 1 - 1
Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormat.cpp

@@ -26,7 +26,7 @@ static Crypto::SignedBigInteger const s_one_million_bigint { 1'000'000 };
 
 
 // 11 DateTimeFormat Objects, https://tc39.es/ecma402/#datetimeformat-objects
 // 11 DateTimeFormat Objects, https://tc39.es/ecma402/#datetimeformat-objects
 DateTimeFormat::DateTimeFormat(Object& prototype)
 DateTimeFormat::DateTimeFormat(Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
 {
 {
 }
 }
 
 

+ 1 - 1
Userland/Libraries/LibJS/Runtime/Intl/DisplayNames.cpp

@@ -12,7 +12,7 @@ namespace JS::Intl {
 
 
 // 12 DisplayNames Objects, https://tc39.es/ecma402/#intl-displaynames-objects
 // 12 DisplayNames Objects, https://tc39.es/ecma402/#intl-displaynames-objects
 DisplayNames::DisplayNames(Object& prototype)
 DisplayNames::DisplayNames(Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
 {
 {
 }
 }
 
 

+ 1 - 1
Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp

@@ -20,7 +20,7 @@ namespace JS::Intl {
 
 
 // 1 DurationFormat Objects, https://tc39.es/proposal-intl-duration-format/#durationformat-objects
 // 1 DurationFormat Objects, https://tc39.es/proposal-intl-duration-format/#durationformat-objects
 DurationFormat::DurationFormat(Object& prototype)
 DurationFormat::DurationFormat(Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
 {
 {
 }
 }
 
 

+ 1 - 1
Userland/Libraries/LibJS/Runtime/Intl/Intl.cpp

@@ -28,7 +28,7 @@ namespace JS::Intl {
 
 
 // 8 The Intl Object, https://tc39.es/ecma402/#intl-object
 // 8 The Intl Object, https://tc39.es/ecma402/#intl-object
 Intl::Intl(Realm& realm)
 Intl::Intl(Realm& realm)
-    : Object(*realm.intrinsics().object_prototype())
+    : Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().object_prototype())
 {
 {
 }
 }
 
 

+ 1 - 1
Userland/Libraries/LibJS/Runtime/Intl/ListFormat.cpp

@@ -14,7 +14,7 @@ namespace JS::Intl {
 
 
 // 13 ListFormat Objects, https://tc39.es/ecma402/#listformat-objects
 // 13 ListFormat Objects, https://tc39.es/ecma402/#listformat-objects
 ListFormat::ListFormat(Object& prototype)
 ListFormat::ListFormat(Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
 {
 {
 }
 }
 
 

+ 2 - 2
Userland/Libraries/LibJS/Runtime/Intl/Locale.cpp

@@ -21,12 +21,12 @@ NonnullGCPtr<Locale> Locale::create(Realm& realm, ::Locale::LocaleID const& loca
 
 
 // 14 Locale Objects, https://tc39.es/ecma402/#locale-objects
 // 14 Locale Objects, https://tc39.es/ecma402/#locale-objects
 Locale::Locale(Object& prototype)
 Locale::Locale(Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
 {
 {
 }
 }
 
 
 Locale::Locale(::Locale::LocaleID const& locale_id, Object& prototype)
 Locale::Locale(::Locale::LocaleID const& locale_id, Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
 {
 {
     set_locale(locale_id.to_deprecated_string());
     set_locale(locale_id.to_deprecated_string());
 
 

+ 1 - 1
Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.cpp

@@ -21,7 +21,7 @@
 namespace JS::Intl {
 namespace JS::Intl {
 
 
 NumberFormatBase::NumberFormatBase(Object& prototype)
 NumberFormatBase::NumberFormatBase(Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
 {
 {
 }
 }
 
 

+ 1 - 1
Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormat.cpp

@@ -17,7 +17,7 @@ namespace JS::Intl {
 
 
 // 17 RelativeTimeFormat Objects, https://tc39.es/ecma402/#relativetimeformat-objects
 // 17 RelativeTimeFormat Objects, https://tc39.es/ecma402/#relativetimeformat-objects
 RelativeTimeFormat::RelativeTimeFormat(Object& prototype)
 RelativeTimeFormat::RelativeTimeFormat(Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
 {
 {
 }
 }
 
 

+ 1 - 1
Userland/Libraries/LibJS/Runtime/Intl/SegmentIterator.cpp

@@ -24,7 +24,7 @@ NonnullGCPtr<SegmentIterator> SegmentIterator::create(Realm& realm, Segmenter& s
 
 
 // 18.6 Segment Iterator Objects, https://tc39.es/ecma402/#sec-segment-iterator-objects
 // 18.6 Segment Iterator Objects, https://tc39.es/ecma402/#sec-segment-iterator-objects
 SegmentIterator::SegmentIterator(Realm& realm, Segmenter& segmenter, Utf16View const& string, Segments const& segments)
 SegmentIterator::SegmentIterator(Realm& realm, Segmenter& segmenter, Utf16View const& string, Segments const& segments)
-    : Object(*realm.intrinsics().intl_segment_iterator_prototype())
+    : Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().intl_segment_iterator_prototype())
     , m_iterating_segmenter(segmenter)
     , m_iterating_segmenter(segmenter)
     , m_iterated_string(string)
     , m_iterated_string(string)
     , m_segments(segments)
     , m_segments(segments)

+ 1 - 1
Userland/Libraries/LibJS/Runtime/Intl/Segmenter.cpp

@@ -14,7 +14,7 @@ namespace JS::Intl {
 
 
 // 18 Segmenter Objects, https://tc39.es/ecma402/#segmenter-objects
 // 18 Segmenter Objects, https://tc39.es/ecma402/#segmenter-objects
 Segmenter::Segmenter(Object& prototype)
 Segmenter::Segmenter(Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
 {
 {
 }
 }
 
 

+ 1 - 1
Userland/Libraries/LibJS/Runtime/Intl/Segments.cpp

@@ -23,7 +23,7 @@ NonnullGCPtr<Segments> Segments::create(Realm& realm, Segmenter& segmenter, Utf1
 
 
 // 18.5 Segments Objects, https://tc39.es/ecma402/#sec-segments-objects
 // 18.5 Segments Objects, https://tc39.es/ecma402/#sec-segments-objects
 Segments::Segments(Realm& realm, Segmenter& segmenter, Utf16String string)
 Segments::Segments(Realm& realm, Segmenter& segmenter, Utf16String string)
-    : Object(*realm.intrinsics().intl_segments_prototype())
+    : Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().intl_segments_prototype())
     , m_segments_segmenter(segmenter)
     , m_segments_segmenter(segmenter)
     , m_segments_string(move(string))
     , m_segments_string(move(string))
 {
 {

+ 1 - 1
Userland/Libraries/LibJS/Runtime/IteratorPrototype.cpp

@@ -12,7 +12,7 @@ namespace JS {
 
 
 // 27.1.2 The %IteratorPrototype% Object, https://tc39.es/ecma262/#sec-%iteratorprototype%-object
 // 27.1.2 The %IteratorPrototype% Object, https://tc39.es/ecma262/#sec-%iteratorprototype%-object
 IteratorPrototype::IteratorPrototype(Realm& realm)
 IteratorPrototype::IteratorPrototype(Realm& realm)
-    : Object(*realm.intrinsics().object_prototype())
+    : Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().object_prototype())
 {
 {
 }
 }
 
 

+ 1 - 1
Userland/Libraries/LibJS/Runtime/JSONObject.cpp

@@ -27,7 +27,7 @@
 namespace JS {
 namespace JS {
 
 
 JSONObject::JSONObject(Realm& realm)
 JSONObject::JSONObject(Realm& realm)
-    : Object(*realm.intrinsics().object_prototype())
+    : Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().object_prototype())
 {
 {
 }
 }
 
 

+ 1 - 1
Userland/Libraries/LibJS/Runtime/Map.cpp

@@ -14,7 +14,7 @@ NonnullGCPtr<Map> Map::create(Realm& realm)
 }
 }
 
 
 Map::Map(Object& prototype)
 Map::Map(Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
 {
 {
 }
 }
 
 

+ 1 - 1
Userland/Libraries/LibJS/Runtime/MapIterator.cpp

@@ -15,7 +15,7 @@ NonnullGCPtr<MapIterator> MapIterator::create(Realm& realm, Map& map, Object::Pr
 }
 }
 
 
 MapIterator::MapIterator(Map& map, Object::PropertyKind iteration_kind, Object& prototype)
 MapIterator::MapIterator(Map& map, Object::PropertyKind iteration_kind, Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
     , m_map(map)
     , m_map(map)
     , m_iteration_kind(iteration_kind)
     , m_iteration_kind(iteration_kind)
     , m_iterator(static_cast<Map const&>(map).begin())
     , m_iterator(static_cast<Map const&>(map).begin())

+ 1 - 1
Userland/Libraries/LibJS/Runtime/MathObject.cpp

@@ -16,7 +16,7 @@
 namespace JS {
 namespace JS {
 
 
 MathObject::MathObject(Realm& realm)
 MathObject::MathObject(Realm& realm)
-    : Object(*realm.intrinsics().object_prototype())
+    : Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().object_prototype())
 {
 {
 }
 }
 
 

+ 1 - 1
Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.cpp

@@ -11,7 +11,7 @@
 namespace JS {
 namespace JS {
 
 
 ModuleNamespaceObject::ModuleNamespaceObject(Realm& realm, Module* module, Vector<FlyString> exports)
 ModuleNamespaceObject::ModuleNamespaceObject(Realm& realm, Module* module, Vector<FlyString> exports)
-    : Object(*realm.intrinsics().object_prototype())
+    : Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().object_prototype())
     , m_module(module)
     , m_module(module)
     , m_exports(move(exports))
     , m_exports(move(exports))
 {
 {

+ 1 - 1
Userland/Libraries/LibJS/Runtime/NumberObject.cpp

@@ -15,7 +15,7 @@ NonnullGCPtr<NumberObject> NumberObject::create(Realm& realm, double value)
 }
 }
 
 
 NumberObject::NumberObject(double value, Object& prototype)
 NumberObject::NumberObject(double value, Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
     , m_value(value)
     , m_value(value)
 {
 {
 }
 }

+ 2 - 2
Userland/Libraries/LibJS/Runtime/Object.cpp

@@ -34,7 +34,7 @@ NonnullGCPtr<Object> Object::create(Realm& realm, Object* prototype)
     else if (prototype == realm.intrinsics().object_prototype())
     else if (prototype == realm.intrinsics().object_prototype())
         return *realm.heap().allocate<Object>(realm, *realm.intrinsics().new_object_shape());
         return *realm.heap().allocate<Object>(realm, *realm.intrinsics().new_object_shape());
     else
     else
-        return *realm.heap().allocate<Object>(realm, *prototype);
+        return *realm.heap().allocate<Object>(realm, ConstructWithPrototypeTag::Tag, *prototype);
 }
 }
 
 
 Object::Object(GlobalObjectTag, Realm& realm)
 Object::Object(GlobalObjectTag, Realm& realm)
@@ -56,7 +56,7 @@ Object::Object(Realm& realm, Object* prototype)
         set_prototype(prototype);
         set_prototype(prototype);
 }
 }
 
 
-Object::Object(Object& prototype)
+Object::Object(ConstructWithPrototypeTag, Object& prototype)
 {
 {
     m_shape = prototype.shape().realm().intrinsics().empty_object_shape();
     m_shape = prototype.shape().realm().intrinsics().empty_object_shape();
     VERIFY(m_shape);
     VERIFY(m_shape);

+ 2 - 1
Userland/Libraries/LibJS/Runtime/Object.h

@@ -191,11 +191,12 @@ public:
 protected:
 protected:
     enum class GlobalObjectTag { Tag };
     enum class GlobalObjectTag { Tag };
     enum class ConstructWithoutPrototypeTag { Tag };
     enum class ConstructWithoutPrototypeTag { Tag };
+    enum class ConstructWithPrototypeTag { Tag };
 
 
     Object(GlobalObjectTag, Realm&);
     Object(GlobalObjectTag, Realm&);
     Object(ConstructWithoutPrototypeTag, Realm&);
     Object(ConstructWithoutPrototypeTag, Realm&);
     Object(Realm&, Object* prototype);
     Object(Realm&, Object* prototype);
-    explicit Object(Object& prototype);
+    Object(ConstructWithPrototypeTag, Object& prototype);
     explicit Object(Shape&);
     explicit Object(Shape&);
 
 
     void set_prototype(Object*);
     void set_prototype(Object*);

+ 1 - 1
Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp

@@ -70,7 +70,7 @@ ThrowCompletionOr<Object*> ObjectConstructor::construct(FunctionObject& new_targ
     auto& realm = *vm.current_realm();
     auto& realm = *vm.current_realm();
 
 
     if (&new_target != this)
     if (&new_target != this)
-        return TRY(ordinary_create_from_constructor<Object>(vm, new_target, &Intrinsics::object_prototype));
+        return TRY(ordinary_create_from_constructor<Object>(vm, new_target, &Intrinsics::object_prototype, ConstructWithPrototypeTag::Tag));
     auto value = vm.argument(0);
     auto value = vm.argument(0);
     if (value.is_nullish())
     if (value.is_nullish())
         return Object::create(realm, realm.intrinsics().object_prototype()).ptr();
         return Object::create(realm, realm.intrinsics().object_prototype()).ptr();

+ 1 - 1
Userland/Libraries/LibJS/Runtime/Promise.cpp

@@ -49,7 +49,7 @@ NonnullGCPtr<Promise> Promise::create(Realm& realm)
 
 
 // 27.2 Promise Objects, https://tc39.es/ecma262/#sec-promise-objects
 // 27.2 Promise Objects, https://tc39.es/ecma262/#sec-promise-objects
 Promise::Promise(Object& prototype)
 Promise::Promise(Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
 {
 {
 }
 }
 
 

+ 1 - 1
Userland/Libraries/LibJS/Runtime/PrototypeObject.h

@@ -57,7 +57,7 @@ public:
 
 
 protected:
 protected:
     explicit PrototypeObject(Object& prototype)
     explicit PrototypeObject(Object& prototype)
-        : Object(prototype)
+        : Object(ConstructWithPrototypeTag::Tag, prototype)
     {
     {
     }
     }
 };
 };

+ 1 - 1
Userland/Libraries/LibJS/Runtime/ReflectObject.cpp

@@ -16,7 +16,7 @@
 namespace JS {
 namespace JS {
 
 
 ReflectObject::ReflectObject(Realm& realm)
 ReflectObject::ReflectObject(Realm& realm)
-    : Object(*realm.intrinsics().object_prototype())
+    : Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().object_prototype())
 {
 {
 }
 }
 
 

+ 2 - 2
Userland/Libraries/LibJS/Runtime/RegExpObject.cpp

@@ -135,12 +135,12 @@ NonnullGCPtr<RegExpObject> RegExpObject::create(Realm& realm, Regex<ECMA262> reg
 }
 }
 
 
 RegExpObject::RegExpObject(Object& prototype)
 RegExpObject::RegExpObject(Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
 {
 {
 }
 }
 
 
 RegExpObject::RegExpObject(Regex<ECMA262> regex, DeprecatedString pattern, DeprecatedString flags, Object& prototype)
 RegExpObject::RegExpObject(Regex<ECMA262> regex, DeprecatedString pattern, DeprecatedString flags, Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
     , m_pattern(move(pattern))
     , m_pattern(move(pattern))
     , m_flags(move(flags))
     , m_flags(move(flags))
     , m_regex(move(regex))
     , m_regex(move(regex))

+ 1 - 1
Userland/Libraries/LibJS/Runtime/RegExpStringIterator.cpp

@@ -16,7 +16,7 @@ NonnullGCPtr<RegExpStringIterator> RegExpStringIterator::create(Realm& realm, Ob
 }
 }
 
 
 RegExpStringIterator::RegExpStringIterator(Object& prototype, Object& regexp_object, Utf16String string, bool global, bool unicode)
 RegExpStringIterator::RegExpStringIterator(Object& prototype, Object& regexp_object, Utf16String string, bool global, bool unicode)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
     , m_regexp_object(regexp_object)
     , m_regexp_object(regexp_object)
     , m_string(move(string))
     , m_string(move(string))
     , m_global(global)
     , m_global(global)

+ 1 - 1
Userland/Libraries/LibJS/Runtime/Set.cpp

@@ -14,7 +14,7 @@ NonnullGCPtr<Set> Set::create(Realm& realm)
 }
 }
 
 
 Set::Set(Object& prototype)
 Set::Set(Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
 {
 {
 }
 }
 
 

+ 1 - 1
Userland/Libraries/LibJS/Runtime/SetIterator.cpp

@@ -15,7 +15,7 @@ NonnullGCPtr<SetIterator> SetIterator::create(Realm& realm, Set& set, Object::Pr
 }
 }
 
 
 SetIterator::SetIterator(Set& set, Object::PropertyKind iteration_kind, Object& prototype)
 SetIterator::SetIterator(Set& set, Object::PropertyKind iteration_kind, Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
     , m_set(set)
     , m_set(set)
     , m_iteration_kind(iteration_kind)
     , m_iteration_kind(iteration_kind)
     , m_iterator(static_cast<Set const&>(set).begin())
     , m_iterator(static_cast<Set const&>(set).begin())

+ 1 - 1
Userland/Libraries/LibJS/Runtime/ShadowRealm.cpp

@@ -20,7 +20,7 @@
 namespace JS {
 namespace JS {
 
 
 ShadowRealm::ShadowRealm(Realm& shadow_realm, ExecutionContext execution_context, Object& prototype)
 ShadowRealm::ShadowRealm(Realm& shadow_realm, ExecutionContext execution_context, Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
     , m_shadow_realm(shadow_realm)
     , m_shadow_realm(shadow_realm)
     , m_execution_context(move(execution_context))
     , m_execution_context(move(execution_context))
 {
 {

+ 1 - 1
Userland/Libraries/LibJS/Runtime/StringIterator.cpp

@@ -16,7 +16,7 @@ NonnullGCPtr<StringIterator> StringIterator::create(Realm& realm, DeprecatedStri
 }
 }
 
 
 StringIterator::StringIterator(DeprecatedString string, Object& prototype)
 StringIterator::StringIterator(DeprecatedString string, Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
     , m_string(move(string))
     , m_string(move(string))
     , m_iterator(Utf8View(m_string).begin())
     , m_iterator(Utf8View(m_string).begin())
 {
 {

+ 1 - 1
Userland/Libraries/LibJS/Runtime/StringObject.cpp

@@ -21,7 +21,7 @@ NonnullGCPtr<StringObject> StringObject::create(Realm& realm, PrimitiveString& p
 }
 }
 
 
 StringObject::StringObject(PrimitiveString& string, Object& prototype)
 StringObject::StringObject(PrimitiveString& string, Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
     , m_string(string)
     , m_string(string)
 {
 {
 }
 }

+ 1 - 1
Userland/Libraries/LibJS/Runtime/SymbolObject.cpp

@@ -16,7 +16,7 @@ NonnullGCPtr<SymbolObject> SymbolObject::create(Realm& realm, Symbol& primitive_
 }
 }
 
 
 SymbolObject::SymbolObject(Symbol& symbol, Object& prototype)
 SymbolObject::SymbolObject(Symbol& symbol, Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
     , m_symbol(symbol)
     , m_symbol(symbol)
 {
 {
 }
 }

+ 1 - 1
Userland/Libraries/LibJS/Runtime/SymbolPrototype.cpp

@@ -19,7 +19,7 @@
 namespace JS {
 namespace JS {
 
 
 SymbolPrototype::SymbolPrototype(Realm& realm)
 SymbolPrototype::SymbolPrototype(Realm& realm)
-    : Object(*realm.intrinsics().object_prototype())
+    : Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().object_prototype())
 {
 {
 }
 }
 
 

+ 1 - 1
Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp

@@ -28,7 +28,7 @@ namespace JS::Temporal {
 
 
 // 12 Temporal.Calendar Objects, https://tc39.es/proposal-temporal/#sec-temporal-calendar-objects
 // 12 Temporal.Calendar Objects, https://tc39.es/proposal-temporal/#sec-temporal-calendar-objects
 Calendar::Calendar(DeprecatedString identifier, Object& prototype)
 Calendar::Calendar(DeprecatedString identifier, Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
     , m_identifier(move(identifier))
     , m_identifier(move(identifier))
 {
 {
 }
 }

+ 1 - 1
Userland/Libraries/LibJS/Runtime/Temporal/Duration.cpp

@@ -24,7 +24,7 @@ namespace JS::Temporal {
 
 
 // 7 Temporal.Duration Objects, https://tc39.es/proposal-temporal/#sec-temporal-duration-objects
 // 7 Temporal.Duration Objects, https://tc39.es/proposal-temporal/#sec-temporal-duration-objects
 Duration::Duration(double years, double months, double weeks, double days, double hours, double minutes, double seconds, double milliseconds, double microseconds, double nanoseconds, Object& prototype)
 Duration::Duration(double years, double months, double weeks, double days, double hours, double minutes, double seconds, double milliseconds, double microseconds, double nanoseconds, Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
     , m_years(years)
     , m_years(years)
     , m_months(months)
     , m_months(months)
     , m_weeks(weeks)
     , m_weeks(weeks)

+ 1 - 1
Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp

@@ -24,7 +24,7 @@ namespace JS::Temporal {
 
 
 // 8 Temporal.Instant Objects, https://tc39.es/proposal-temporal/#sec-temporal-instant-objects
 // 8 Temporal.Instant Objects, https://tc39.es/proposal-temporal/#sec-temporal-instant-objects
 Instant::Instant(BigInt const& nanoseconds, Object& prototype)
 Instant::Instant(BigInt const& nanoseconds, Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
     , m_nanoseconds(nanoseconds)
     , m_nanoseconds(nanoseconds)
 {
 {
 }
 }

+ 1 - 1
Userland/Libraries/LibJS/Runtime/Temporal/Now.cpp

@@ -22,7 +22,7 @@ namespace JS::Temporal {
 
 
 // 2 The Temporal.Now Object, https://tc39.es/proposal-temporal/#sec-temporal-now-object
 // 2 The Temporal.Now Object, https://tc39.es/proposal-temporal/#sec-temporal-now-object
 Now::Now(Realm& realm)
 Now::Now(Realm& realm)
-    : Object(*realm.intrinsics().object_prototype())
+    : Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().object_prototype())
 {
 {
 }
 }
 
 

+ 1 - 1
Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp

@@ -24,7 +24,7 @@ namespace JS::Temporal {
 
 
 // 3 Temporal.PlainDate Objects, https://tc39.es/proposal-temporal/#sec-temporal-plaindate-objects
 // 3 Temporal.PlainDate Objects, https://tc39.es/proposal-temporal/#sec-temporal-plaindate-objects
 PlainDate::PlainDate(i32 year, u8 month, u8 day, Object& calendar, Object& prototype)
 PlainDate::PlainDate(i32 year, u8 month, u8 day, Object& calendar, Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
     , m_iso_year(year)
     , m_iso_year(year)
     , m_iso_month(month)
     , m_iso_month(month)
     , m_iso_day(day)
     , m_iso_day(day)

+ 1 - 1
Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTime.cpp

@@ -25,7 +25,7 @@ namespace JS::Temporal {
 
 
 // 5 Temporal.PlainDateTime Objects, https://tc39.es/proposal-temporal/#sec-temporal-plaindatetime-objects
 // 5 Temporal.PlainDateTime Objects, https://tc39.es/proposal-temporal/#sec-temporal-plaindatetime-objects
 PlainDateTime::PlainDateTime(i32 iso_year, u8 iso_month, u8 iso_day, u8 iso_hour, u8 iso_minute, u8 iso_second, u16 iso_millisecond, u16 iso_microsecond, u16 iso_nanosecond, Object& calendar, Object& prototype)
 PlainDateTime::PlainDateTime(i32 iso_year, u8 iso_month, u8 iso_day, u8 iso_hour, u8 iso_minute, u8 iso_second, u16 iso_millisecond, u16 iso_microsecond, u16 iso_nanosecond, Object& calendar, Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
     , m_iso_year(iso_year)
     , m_iso_year(iso_year)
     , m_iso_month(iso_month)
     , m_iso_month(iso_month)
     , m_iso_day(iso_day)
     , m_iso_day(iso_day)

+ 1 - 1
Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDay.cpp

@@ -20,7 +20,7 @@ namespace JS::Temporal {
 
 
 // 10 Temporal.PlainMonthDay Objects, https://tc39.es/proposal-temporal/#sec-temporal-plainmonthday-objects
 // 10 Temporal.PlainMonthDay Objects, https://tc39.es/proposal-temporal/#sec-temporal-plainmonthday-objects
 PlainMonthDay::PlainMonthDay(u8 iso_month, u8 iso_day, i32 iso_year, Object& calendar, Object& prototype)
 PlainMonthDay::PlainMonthDay(u8 iso_month, u8 iso_day, i32 iso_year, Object& calendar, Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
     , m_iso_year(iso_year)
     , m_iso_year(iso_year)
     , m_iso_month(iso_month)
     , m_iso_month(iso_month)
     , m_iso_day(iso_day)
     , m_iso_day(iso_day)

+ 1 - 1
Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.cpp

@@ -24,7 +24,7 @@ namespace JS::Temporal {
 
 
 // 4 Temporal.PlainTime Objects, https://tc39.es/proposal-temporal/#sec-temporal-plaintime-objects
 // 4 Temporal.PlainTime Objects, https://tc39.es/proposal-temporal/#sec-temporal-plaintime-objects
 PlainTime::PlainTime(u8 iso_hour, u8 iso_minute, u8 iso_second, u16 iso_millisecond, u16 iso_microsecond, u16 iso_nanosecond, Calendar& calendar, Object& prototype)
 PlainTime::PlainTime(u8 iso_hour, u8 iso_minute, u8 iso_second, u16 iso_millisecond, u16 iso_microsecond, u16 iso_nanosecond, Calendar& calendar, Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
     , m_iso_hour(iso_hour)
     , m_iso_hour(iso_hour)
     , m_iso_minute(iso_minute)
     , m_iso_minute(iso_minute)
     , m_iso_second(iso_second)
     , m_iso_second(iso_second)

+ 1 - 1
Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp

@@ -19,7 +19,7 @@ namespace JS::Temporal {
 
 
 // 9 Temporal.PlainYearMonth Objects, https://tc39.es/proposal-temporal/#sec-temporal-plainyearmonth-objects
 // 9 Temporal.PlainYearMonth Objects, https://tc39.es/proposal-temporal/#sec-temporal-plainyearmonth-objects
 PlainYearMonth::PlainYearMonth(i32 iso_year, u8 iso_month, u8 iso_day, Object& calendar, Object& prototype)
 PlainYearMonth::PlainYearMonth(i32 iso_year, u8 iso_month, u8 iso_day, Object& calendar, Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
     , m_iso_year(iso_year)
     , m_iso_year(iso_year)
     , m_iso_month(iso_month)
     , m_iso_month(iso_month)
     , m_iso_day(iso_day)
     , m_iso_day(iso_day)

+ 1 - 1
Userland/Libraries/LibJS/Runtime/Temporal/Temporal.cpp

@@ -22,7 +22,7 @@ namespace JS::Temporal {
 
 
 // 1 The Temporal Object, https://tc39.es/proposal-temporal/#sec-temporal-objects
 // 1 The Temporal Object, https://tc39.es/proposal-temporal/#sec-temporal-objects
 Temporal::Temporal(Realm& realm)
 Temporal::Temporal(Realm& realm)
-    : Object(*realm.intrinsics().object_prototype())
+    : Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().object_prototype())
 {
 {
 }
 }
 
 

+ 1 - 1
Userland/Libraries/LibJS/Runtime/Temporal/TimeZone.cpp

@@ -25,7 +25,7 @@ namespace JS::Temporal {
 
 
 // 11 Temporal.TimeZone Objects, https://tc39.es/proposal-temporal/#sec-temporal-timezone-objects
 // 11 Temporal.TimeZone Objects, https://tc39.es/proposal-temporal/#sec-temporal-timezone-objects
 TimeZone::TimeZone(Object& prototype)
 TimeZone::TimeZone(Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
 {
 {
 }
 }
 
 

+ 1 - 1
Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.cpp

@@ -22,7 +22,7 @@ namespace JS::Temporal {
 
 
 // 6 Temporal.ZonedDateTime Objects, https://tc39.es/proposal-temporal/#sec-temporal-zoneddatetime-objects
 // 6 Temporal.ZonedDateTime Objects, https://tc39.es/proposal-temporal/#sec-temporal-zoneddatetime-objects
 ZonedDateTime::ZonedDateTime(BigInt const& nanoseconds, Object& time_zone, Object& calendar, Object& prototype)
 ZonedDateTime::ZonedDateTime(BigInt const& nanoseconds, Object& time_zone, Object& calendar, Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
     , m_nanoseconds(nanoseconds)
     , m_nanoseconds(nanoseconds)
     , m_time_zone(time_zone)
     , m_time_zone(time_zone)
     , m_calendar(calendar)
     , m_calendar(calendar)

+ 1 - 1
Userland/Libraries/LibJS/Runtime/TypedArray.cpp

@@ -459,7 +459,7 @@ void TypedArrayBase::visit_edges(Visitor& visitor)
     }                                                                                                                            \
     }                                                                                                                            \
                                                                                                                                  \
                                                                                                                                  \
     PrototypeName::PrototypeName(Object& prototype)                                                                              \
     PrototypeName::PrototypeName(Object& prototype)                                                                              \
-        : Object(prototype)                                                                                                      \
+        : Object(ConstructWithPrototypeTag::Tag, prototype)                                                                      \
     {                                                                                                                            \
     {                                                                                                                            \
     }                                                                                                                            \
     }                                                                                                                            \
                                                                                                                                  \
                                                                                                                                  \

+ 1 - 1
Userland/Libraries/LibJS/Runtime/TypedArray.h

@@ -62,7 +62,7 @@ public:
 
 
 protected:
 protected:
     TypedArrayBase(Object& prototype, IntrinsicConstructor intrinsic_constructor)
     TypedArrayBase(Object& prototype, IntrinsicConstructor intrinsic_constructor)
-        : Object(prototype)
+        : Object(ConstructWithPrototypeTag::Tag, prototype)
         , m_intrinsic_constructor(intrinsic_constructor)
         , m_intrinsic_constructor(intrinsic_constructor)
     {
     {
     }
     }

+ 1 - 1
Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp

@@ -17,7 +17,7 @@
 namespace JS {
 namespace JS {
 
 
 TypedArrayPrototype::TypedArrayPrototype(Realm& realm)
 TypedArrayPrototype::TypedArrayPrototype(Realm& realm)
-    : Object(*realm.intrinsics().object_prototype())
+    : Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().object_prototype())
 {
 {
 }
 }
 
 

+ 1 - 1
Userland/Libraries/LibJS/Runtime/WeakMap.cpp

@@ -14,7 +14,7 @@ NonnullGCPtr<WeakMap> WeakMap::create(Realm& realm)
 }
 }
 
 
 WeakMap::WeakMap(Object& prototype)
 WeakMap::WeakMap(Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
     , WeakContainer(heap())
     , WeakContainer(heap())
 {
 {
 }
 }

+ 2 - 2
Userland/Libraries/LibJS/Runtime/WeakRef.cpp

@@ -19,7 +19,7 @@ NonnullGCPtr<WeakRef> WeakRef::create(Realm& realm, Symbol& value)
 }
 }
 
 
 WeakRef::WeakRef(Object& value, Object& prototype)
 WeakRef::WeakRef(Object& value, Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
     , WeakContainer(heap())
     , WeakContainer(heap())
     , m_value(&value)
     , m_value(&value)
     , m_last_execution_generation(vm().execution_generation())
     , m_last_execution_generation(vm().execution_generation())
@@ -27,7 +27,7 @@ WeakRef::WeakRef(Object& value, Object& prototype)
 }
 }
 
 
 WeakRef::WeakRef(Symbol& value, Object& prototype)
 WeakRef::WeakRef(Symbol& value, Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
     , WeakContainer(heap())
     , WeakContainer(heap())
     , m_value(&value)
     , m_value(&value)
     , m_last_execution_generation(vm().execution_generation())
     , m_last_execution_generation(vm().execution_generation())

+ 1 - 1
Userland/Libraries/LibJS/Runtime/WeakSet.cpp

@@ -14,7 +14,7 @@ NonnullGCPtr<WeakSet> WeakSet::create(Realm& realm)
 }
 }
 
 
 WeakSet::WeakSet(Object& prototype)
 WeakSet::WeakSet(Object& prototype)
-    : Object(prototype)
+    : Object(ConstructWithPrototypeTag::Tag, prototype)
     , WeakContainer(heap())
     , WeakContainer(heap())
 {
 {
 }
 }

+ 1 - 1
Userland/Libraries/LibWeb/Bindings/CSSNamespace.cpp

@@ -14,7 +14,7 @@
 namespace Web::Bindings {
 namespace Web::Bindings {
 
 
 CSSNamespace::CSSNamespace(JS::Realm& realm)
 CSSNamespace::CSSNamespace(JS::Realm& realm)
-    : JS::Object(*realm.intrinsics().object_prototype())
+    : JS::Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().object_prototype())
 {
 {
 }
 }
 
 

+ 1 - 1
Userland/Libraries/LibWeb/Bindings/LocationPrototype.h

@@ -19,7 +19,7 @@ class LocationPrototype final : public JS::Object {
 
 
 public:
 public:
     explicit LocationPrototype(JS::Realm& realm)
     explicit LocationPrototype(JS::Realm& realm)
-        : JS::Object(*realm.intrinsics().object_prototype())
+        : JS::Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().object_prototype())
     {
     {
     }
     }
 };
 };

+ 1 - 1
Userland/Libraries/LibWeb/Bindings/PlatformObject.cpp

@@ -17,7 +17,7 @@ PlatformObject::PlatformObject(JS::Realm& realm)
 }
 }
 
 
 PlatformObject::PlatformObject(JS::Object& prototype)
 PlatformObject::PlatformObject(JS::Object& prototype)
-    : JS::Object(prototype)
+    : JS::Object(ConstructWithPrototypeTag::Tag, prototype)
 {
 {
 }
 }
 
 

+ 1 - 1
Userland/Libraries/LibWeb/Bindings/WindowPrototype.h

@@ -17,7 +17,7 @@ class WindowPrototype final : public JS::Object {
 
 
 public:
 public:
     explicit WindowPrototype(JS::Realm& realm)
     explicit WindowPrototype(JS::Realm& realm)
-        : JS::Object(cached_web_prototype(realm, "EventTarget"))
+        : JS::Object(ConstructWithPrototypeTag::Tag, cached_web_prototype(realm, "EventTarget"))
     {
     {
     }
     }
 };
 };

+ 1 - 1
Userland/Libraries/LibWeb/DOM/IDLEventListener.cpp

@@ -14,7 +14,7 @@ JS::NonnullGCPtr<IDLEventListener> IDLEventListener::create(JS::Realm& realm, JS
 }
 }
 
 
 IDLEventListener::IDLEventListener(JS::Realm& realm, JS::NonnullGCPtr<WebIDL::CallbackType> callback)
 IDLEventListener::IDLEventListener(JS::Realm& realm, JS::NonnullGCPtr<WebIDL::CallbackType> callback)
-    : JS::Object(*realm.intrinsics().object_prototype())
+    : JS::Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().object_prototype())
     , m_callback(move(callback))
     , m_callback(move(callback))
 {
 {
 }
 }

+ 1 - 1
Userland/Libraries/LibWeb/WebAssembly/WebAssemblyInstanceObject.cpp

@@ -19,7 +19,7 @@
 namespace Web::Bindings {
 namespace Web::Bindings {
 
 
 WebAssemblyInstanceObject::WebAssemblyInstanceObject(JS::Realm& realm, size_t index)
 WebAssemblyInstanceObject::WebAssemblyInstanceObject(JS::Realm& realm, size_t index)
-    : Object(Bindings::ensure_web_prototype<WebAssemblyInstancePrototype>(realm, "WebAssemblyInstancePrototype"))
+    : Object(ConstructWithPrototypeTag::Tag, Bindings::ensure_web_prototype<WebAssemblyInstancePrototype>(realm, "WebAssemblyInstancePrototype"))
     , m_index(index)
     , m_index(index)
 {
 {
 }
 }

+ 1 - 1
Userland/Libraries/LibWeb/WebAssembly/WebAssemblyInstanceObjectPrototype.h

@@ -18,7 +18,7 @@ class WebAssemblyInstancePrototype final : public JS::Object {
 
 
 public:
 public:
     explicit WebAssemblyInstancePrototype(JS::Realm& realm)
     explicit WebAssemblyInstancePrototype(JS::Realm& realm)
-        : JS::Object(*realm.intrinsics().object_prototype())
+        : JS::Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().object_prototype())
     {
     {
     }
     }
 
 

+ 1 - 1
Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryPrototype.h

@@ -18,7 +18,7 @@ class WebAssemblyMemoryPrototype final : public JS::Object {
 
 
 public:
 public:
     explicit WebAssemblyMemoryPrototype(JS::Realm& realm)
     explicit WebAssemblyMemoryPrototype(JS::Realm& realm)
-        : JS::Object(*realm.intrinsics().object_prototype())
+        : JS::Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().object_prototype())
     {
     {
     }
     }
 
 

+ 1 - 1
Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleObject.cpp

@@ -11,7 +11,7 @@
 namespace Web::Bindings {
 namespace Web::Bindings {
 
 
 WebAssemblyModuleObject::WebAssemblyModuleObject(JS::Realm& realm, size_t index)
 WebAssemblyModuleObject::WebAssemblyModuleObject(JS::Realm& realm, size_t index)
-    : Object(Bindings::ensure_web_prototype<WebAssemblyModulePrototype>(realm, "WebAssemblyModulePrototype"))
+    : Object(ConstructWithPrototypeTag::Tag, Bindings::ensure_web_prototype<WebAssemblyModulePrototype>(realm, "WebAssemblyModulePrototype"))
     , m_index(index)
     , m_index(index)
 {
 {
 }
 }

+ 1 - 1
Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModulePrototype.h

@@ -18,7 +18,7 @@ class WebAssemblyModulePrototype final : public JS::Object {
 
 
 public:
 public:
     explicit WebAssemblyModulePrototype(JS::Realm& realm)
     explicit WebAssemblyModulePrototype(JS::Realm& realm)
-        : JS::Object(*realm.intrinsics().object_prototype())
+        : JS::Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().object_prototype())
     {
     {
     }
     }
 };
 };

+ 2 - 2
Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp

@@ -26,7 +26,7 @@
 namespace Web::Bindings {
 namespace Web::Bindings {
 
 
 WebAssemblyObject::WebAssemblyObject(JS::Realm& realm)
 WebAssemblyObject::WebAssemblyObject(JS::Realm& realm)
-    : Object(*realm.intrinsics().object_prototype())
+    : Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().object_prototype())
 {
 {
     s_abstract_machine.enable_instruction_count_limit();
     s_abstract_machine.enable_instruction_count_limit();
 }
 }
@@ -483,7 +483,7 @@ JS::NativeFunction* create_native_function(JS::VM& vm, Wasm::FunctionAddress add
 }
 }
 
 
 WebAssemblyMemoryObject::WebAssemblyMemoryObject(JS::Realm& realm, Wasm::MemoryAddress address)
 WebAssemblyMemoryObject::WebAssemblyMemoryObject(JS::Realm& realm, Wasm::MemoryAddress address)
-    : Object(Bindings::ensure_web_prototype<WebAssemblyMemoryPrototype>(realm, "WebAssemblyMemoryPrototype"))
+    : Object(ConstructWithPrototypeTag::Tag, Bindings::ensure_web_prototype<WebAssemblyMemoryPrototype>(realm, "WebAssemblyMemoryPrototype"))
     , m_address(address)
     , m_address(address)
 {
 {
 }
 }

+ 1 - 1
Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTableObject.cpp

@@ -11,7 +11,7 @@
 namespace Web::Bindings {
 namespace Web::Bindings {
 
 
 WebAssemblyTableObject::WebAssemblyTableObject(JS::Realm& realm, Wasm::TableAddress address)
 WebAssemblyTableObject::WebAssemblyTableObject(JS::Realm& realm, Wasm::TableAddress address)
-    : Object(Bindings::ensure_web_prototype<WebAssemblyTablePrototype>(realm, "WebAssemblyTablePrototype"))
+    : Object(ConstructWithPrototypeTag::Tag, Bindings::ensure_web_prototype<WebAssemblyTablePrototype>(realm, "WebAssemblyTablePrototype"))
     , m_address(address)
     , m_address(address)
 {
 {
 }
 }

+ 1 - 1
Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTablePrototype.h

@@ -18,7 +18,7 @@ class WebAssemblyTablePrototype final : public JS::Object {
 
 
 public:
 public:
     explicit WebAssemblyTablePrototype(JS::Realm& realm)
     explicit WebAssemblyTablePrototype(JS::Realm& realm)
-        : JS::Object(*realm.intrinsics().object_prototype())
+        : JS::Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().object_prototype())
     {
     {
     }
     }