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

Side by Side Diff: src/objects.cc

Issue 2550423002: Propagate exceptions thrown by access check interceptors. (Closed)
Patch Set: Created 4 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
« no previous file with comments | « no previous file | test/cctest/test-access-checks.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <memory> 9 #include <memory>
10 #include <sstream> 10 #include <sstream>
(...skipping 1867 matching lines...) Expand 10 before | Expand all | Expand 10 after
1878 LookupIterator* it, Handle<Object> value, ShouldThrow should_throw) { 1878 LookupIterator* it, Handle<Object> value, ShouldThrow should_throw) {
1879 Isolate* isolate = it->isolate(); 1879 Isolate* isolate = it->isolate();
1880 Handle<JSObject> checked = it->GetHolder<JSObject>(); 1880 Handle<JSObject> checked = it->GetHolder<JSObject>();
1881 Handle<InterceptorInfo> interceptor = 1881 Handle<InterceptorInfo> interceptor =
1882 it->GetInterceptorForFailedAccessCheck(); 1882 it->GetInterceptorForFailedAccessCheck();
1883 if (interceptor.is_null()) { 1883 if (interceptor.is_null()) {
1884 if (AllCanWrite(it)) { 1884 if (AllCanWrite(it)) {
1885 return SetPropertyWithAccessor(it, value, should_throw); 1885 return SetPropertyWithAccessor(it, value, should_throw);
1886 } 1886 }
1887 } else { 1887 } else {
1888 Maybe<bool> result = SetPropertyWithInterceptorInternal( 1888 return SetPropertyWithInterceptorInternal(it, interceptor, should_throw,
1889 it, interceptor, should_throw, value); 1889 value);
1890 RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, Nothing<bool>());
1891 if (result.IsJust()) return result;
1892 } 1890 }
1893 1891
1894 isolate->ReportFailedAccessCheck(checked); 1892 isolate->ReportFailedAccessCheck(checked);
jochen (gone - plz use gerrit) 2016/12/06 10:05:22 maybe move these lines into the if () { } block, s
1895 RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, Nothing<bool>()); 1893 RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, Nothing<bool>());
1896 return Just(true); 1894 return Just(true);
1897 } 1895 }
1898 1896
1899 1897
1900 void JSObject::SetNormalizedProperty(Handle<JSObject> object, 1898 void JSObject::SetNormalizedProperty(Handle<JSObject> object,
1901 Handle<Name> name, 1899 Handle<Name> name,
1902 Handle<Object> value, 1900 Handle<Object> value,
1903 PropertyDetails details) { 1901 PropertyDetails details) {
1904 DCHECK(!object->HasFastProperties()); 1902 DCHECK(!object->HasFastProperties());
(...skipping 18597 matching lines...) Expand 10 before | Expand all | Expand 10 after
20502 // depend on this. 20500 // depend on this.
20503 return DICTIONARY_ELEMENTS; 20501 return DICTIONARY_ELEMENTS;
20504 } 20502 }
20505 DCHECK_LE(kind, LAST_ELEMENTS_KIND); 20503 DCHECK_LE(kind, LAST_ELEMENTS_KIND);
20506 return kind; 20504 return kind;
20507 } 20505 }
20508 } 20506 }
20509 20507
20510 } // namespace internal 20508 } // namespace internal
20511 } // namespace v8 20509 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-access-checks.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698