Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Side by Side Diff: src/objects.cc

Issue 1529303003: Throw TypeError when reading global references through a JSProxy (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Also add test Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <sstream> 9 #include <sstream>
10 10
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after
821 } \ 821 } \
822 } while (false) 822 } while (false)
823 823
824 824
825 // static 825 // static
826 MaybeHandle<Object> JSProxy::GetProperty(Isolate* isolate, 826 MaybeHandle<Object> JSProxy::GetProperty(Isolate* isolate,
827 Handle<JSProxy> proxy, 827 Handle<JSProxy> proxy,
828 Handle<Name> name, 828 Handle<Name> name,
829 Handle<Object> receiver, 829 Handle<Object> receiver,
830 LanguageMode language_mode) { 830 LanguageMode language_mode) {
831 if (receiver->IsJSGlobalObject()) {
832 THROW_NEW_ERROR(
833 isolate,
834 NewTypeError(MessageTemplate::kReadGlobalReferenceThroughProxy, name),
835 Object);
836 }
837
831 STACK_CHECK(MaybeHandle<Object>()); 838 STACK_CHECK(MaybeHandle<Object>());
832 Handle<Name> trap_name = isolate->factory()->get_string(); 839 Handle<Name> trap_name = isolate->factory()->get_string();
833 // 1. Assert: IsPropertyKey(P) is true. 840 // 1. Assert: IsPropertyKey(P) is true.
834 // 2. Let handler be the value of the [[ProxyHandler]] internal slot of O. 841 // 2. Let handler be the value of the [[ProxyHandler]] internal slot of O.
835 Handle<Object> handler(proxy->handler(), isolate); 842 Handle<Object> handler(proxy->handler(), isolate);
836 // 3. If handler is null, throw a TypeError exception. 843 // 3. If handler is null, throw a TypeError exception.
837 // 4. Assert: Type(handler) is Object. 844 // 4. Assert: Type(handler) is Object.
838 if (proxy->IsRevoked()) { 845 if (proxy->IsRevoked()) {
839 THROW_NEW_ERROR(isolate, 846 THROW_NEW_ERROR(isolate,
840 NewTypeError(MessageTemplate::kProxyRevoked, trap_name), 847 NewTypeError(MessageTemplate::kProxyRevoked, trap_name),
(...skipping 18524 matching lines...) Expand 10 before | Expand all | Expand 10 after
19365 if (cell->value() != *new_value) { 19372 if (cell->value() != *new_value) {
19366 cell->set_value(*new_value); 19373 cell->set_value(*new_value);
19367 Isolate* isolate = cell->GetIsolate(); 19374 Isolate* isolate = cell->GetIsolate();
19368 cell->dependent_code()->DeoptimizeDependentCodeGroup( 19375 cell->dependent_code()->DeoptimizeDependentCodeGroup(
19369 isolate, DependentCode::kPropertyCellChangedGroup); 19376 isolate, DependentCode::kPropertyCellChangedGroup);
19370 } 19377 }
19371 } 19378 }
19372 19379
19373 } // namespace internal 19380 } // namespace internal
19374 } // namespace v8 19381 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698