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 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1070 } | 1070 } |
1071 | 1071 |
1072 | 1072 |
1073 // static | 1073 // static |
1074 MaybeHandle<Object> JSProxy::GetProperty(Isolate* isolate, | 1074 MaybeHandle<Object> JSProxy::GetProperty(Isolate* isolate, |
1075 Handle<JSProxy> proxy, | 1075 Handle<JSProxy> proxy, |
1076 Handle<Name> name, | 1076 Handle<Name> name, |
1077 Handle<Object> receiver, | 1077 Handle<Object> receiver, |
1078 bool* was_found) { | 1078 bool* was_found) { |
1079 *was_found = true; | 1079 *was_found = true; |
1080 if (receiver->IsJSGlobalObject()) { | |
1081 THROW_NEW_ERROR( | |
1082 isolate, | |
1083 NewTypeError(MessageTemplate::kReadGlobalReferenceThroughProxy, name), | |
Toon Verwaest
2017/02/08 16:47:51
What about removing the message too?
| |
1084 Object); | |
1085 } | |
1086 | 1080 |
1087 DCHECK(!name->IsPrivate()); | 1081 DCHECK(!name->IsPrivate()); |
1088 STACK_CHECK(isolate, MaybeHandle<Object>()); | 1082 STACK_CHECK(isolate, MaybeHandle<Object>()); |
1089 Handle<Name> trap_name = isolate->factory()->get_string(); | 1083 Handle<Name> trap_name = isolate->factory()->get_string(); |
1090 // 1. Assert: IsPropertyKey(P) is true. | 1084 // 1. Assert: IsPropertyKey(P) is true. |
1091 // 2. Let handler be the value of the [[ProxyHandler]] internal slot of O. | 1085 // 2. Let handler be the value of the [[ProxyHandler]] internal slot of O. |
1092 Handle<Object> handler(proxy->handler(), isolate); | 1086 Handle<Object> handler(proxy->handler(), isolate); |
1093 // 3. If handler is null, throw a TypeError exception. | 1087 // 3. If handler is null, throw a TypeError exception. |
1094 // 4. Assert: Type(handler) is Object. | 1088 // 4. Assert: Type(handler) is Object. |
1095 if (proxy->IsRevoked()) { | 1089 if (proxy->IsRevoked()) { |
(...skipping 18929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
20025 // depend on this. | 20019 // depend on this. |
20026 return DICTIONARY_ELEMENTS; | 20020 return DICTIONARY_ELEMENTS; |
20027 } | 20021 } |
20028 DCHECK_LE(kind, LAST_ELEMENTS_KIND); | 20022 DCHECK_LE(kind, LAST_ELEMENTS_KIND); |
20029 return kind; | 20023 return kind; |
20030 } | 20024 } |
20031 } | 20025 } |
20032 | 20026 |
20033 } // namespace internal | 20027 } // namespace internal |
20034 } // namespace v8 | 20028 } // namespace v8 |
OLD | NEW |