Chromium Code Reviews| 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) { |
|
Dan Ehrenberg
2016/09/15 21:26:58
It'd be nice to have a comment somewhere explainin
bakkot
2016/09/17 00:11:10
Done.
|
| + 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 |
|
Dan Ehrenberg
2016/09/15 21:26:58
TODO can be rephrased to say that it in fact doesn
bakkot
2016/09/17 00:11:10
Done.
|
| + THROW_NEW_ERROR_RETURN_FAILURE( |
| + isolate, NewTypeError(MessageTemplate::kMissingPrivateField)); |
| + } |
| + return *object; |
| +} |
| RUNTIME_FUNCTION(Runtime_HomeObjectSymbol) { |
| DCHECK(args.length() == 0); |