Index: src/runtime/runtime-classes.cc |
diff --git a/src/runtime/runtime-classes.cc b/src/runtime/runtime-classes.cc |
index 5448159513bda41508a1c8cd1f72e859be74197a..62746683b1bf3378ccddaeefd2bf0c2f4116bb16 100644 |
--- a/src/runtime/runtime-classes.cc |
+++ b/src/runtime/runtime-classes.cc |
@@ -75,6 +75,20 @@ RUNTIME_FUNCTION(Runtime_ThrowIfStaticPrototype) { |
return *name; |
} |
+RUNTIME_FUNCTION(Runtime_ThrowIfMissingPrivateField) { |
+ HandleScope scope(isolate); |
+ DCHECK(args.length() == 2); |
+ CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); |
+ CONVERT_ARG_HANDLE_CHECKED(Name, name, 1); |
+ if (!object->IsJSReceiver() || |
+ !JSReceiver::HasOwnProperty(Handle<JSReceiver>::cast(object), name) |
+ .FromMaybe(false)) { // TODO(bakkot) check this doesn't trigger a |
+ // proxy trap |
+ THROW_NEW_ERROR_RETURN_FAILURE( |
+ isolate, NewTypeError(MessageTemplate::kMissingPrivateField)); |
+ } |
+ return *object; |
+} |
RUNTIME_FUNCTION(Runtime_HomeObjectSymbol) { |
DCHECK(args.length() == 0); |