OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/objects.h" | 5 #include "src/objects.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <iomanip> | 8 #include <iomanip> |
9 #include <memory> | 9 #include <memory> |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1044 } | 1044 } |
1045 | 1045 |
1046 | 1046 |
1047 // static | 1047 // static |
1048 MaybeHandle<Object> JSProxy::GetProperty(Isolate* isolate, | 1048 MaybeHandle<Object> JSProxy::GetProperty(Isolate* isolate, |
1049 Handle<JSProxy> proxy, | 1049 Handle<JSProxy> proxy, |
1050 Handle<Name> name, | 1050 Handle<Name> name, |
1051 Handle<Object> receiver, | 1051 Handle<Object> receiver, |
1052 bool* was_found) { | 1052 bool* was_found) { |
1053 *was_found = true; | 1053 *was_found = true; |
1054 if (receiver->IsJSGlobalObject()) { | |
1055 THROW_NEW_ERROR( | |
1056 isolate, | |
1057 NewTypeError(MessageTemplate::kReadGlobalReferenceThroughProxy, name), | |
1058 Object); | |
1059 } | |
1060 | 1054 |
1061 DCHECK(!name->IsPrivate()); | 1055 DCHECK(!name->IsPrivate()); |
1062 STACK_CHECK(isolate, MaybeHandle<Object>()); | 1056 STACK_CHECK(isolate, MaybeHandle<Object>()); |
1063 Handle<Name> trap_name = isolate->factory()->get_string(); | 1057 Handle<Name> trap_name = isolate->factory()->get_string(); |
1064 // 1. Assert: IsPropertyKey(P) is true. | 1058 // 1. Assert: IsPropertyKey(P) is true. |
1065 // 2. Let handler be the value of the [[ProxyHandler]] internal slot of O. | 1059 // 2. Let handler be the value of the [[ProxyHandler]] internal slot of O. |
1066 Handle<Object> handler(proxy->handler(), isolate); | 1060 Handle<Object> handler(proxy->handler(), isolate); |
1067 // 3. If handler is null, throw a TypeError exception. | 1061 // 3. If handler is null, throw a TypeError exception. |
1068 // 4. Assert: Type(handler) is Object. | 1062 // 4. Assert: Type(handler) is Object. |
1069 if (proxy->IsRevoked()) { | 1063 if (proxy->IsRevoked()) { |
(...skipping 19217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
20287 // depend on this. | 20281 // depend on this. |
20288 return DICTIONARY_ELEMENTS; | 20282 return DICTIONARY_ELEMENTS; |
20289 } | 20283 } |
20290 DCHECK_LE(kind, LAST_ELEMENTS_KIND); | 20284 DCHECK_LE(kind, LAST_ELEMENTS_KIND); |
20291 return kind; | 20285 return kind; |
20292 } | 20286 } |
20293 } | 20287 } |
20294 | 20288 |
20295 } // namespace internal | 20289 } // namespace internal |
20296 } // namespace v8 | 20290 } // namespace v8 |
OLD | NEW |