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

Side by Side Diff: src/objects.cc

Issue 559403002: Expect access check in JSObject::DefineAccessor. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 months 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | test/cctest/test-api.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/allocation-site-scopes.h" 8 #include "src/allocation-site-scopes.h"
9 #include "src/api.h" 9 #include "src/api.h"
10 #include "src/arguments.h" 10 #include "src/arguments.h"
(...skipping 6129 matching lines...) Expand 10 before | Expand all | Expand 10 after
6140 if (is_element) { 6140 if (is_element) {
6141 DefineElementAccessor(object, index, getter, setter, attributes); 6141 DefineElementAccessor(object, index, getter, setter, attributes);
6142 } else { 6142 } else {
6143 DCHECK(getter->IsSpecFunction() || getter->IsUndefined() || 6143 DCHECK(getter->IsSpecFunction() || getter->IsUndefined() ||
6144 getter->IsNull()); 6144 getter->IsNull());
6145 DCHECK(setter->IsSpecFunction() || setter->IsUndefined() || 6145 DCHECK(setter->IsSpecFunction() || setter->IsUndefined() ||
6146 setter->IsNull()); 6146 setter->IsNull());
6147 // At least one of the accessors needs to be a new value. 6147 // At least one of the accessors needs to be a new value.
6148 DCHECK(!getter->IsNull() || !setter->IsNull()); 6148 DCHECK(!getter->IsNull() || !setter->IsNull());
6149 LookupIterator it(object, name, LookupIterator::OWN_SKIP_INTERCEPTOR); 6149 LookupIterator it(object, name, LookupIterator::OWN_SKIP_INTERCEPTOR);
6150 CHECK_NE(LookupIterator::ACCESS_CHECK, it.state()); 6150 if (it.state() == LookupIterator::ACCESS_CHECK) {
6151 // We already did an access check before. We do have access.
6152 it.Next();
6153 }
6151 if (!getter->IsNull()) { 6154 if (!getter->IsNull()) {
6152 it.TransitionToAccessorProperty(ACCESSOR_GETTER, getter, attributes); 6155 it.TransitionToAccessorProperty(ACCESSOR_GETTER, getter, attributes);
6153 } 6156 }
6154 if (!setter->IsNull()) { 6157 if (!setter->IsNull()) {
6155 it.TransitionToAccessorProperty(ACCESSOR_SETTER, setter, attributes); 6158 it.TransitionToAccessorProperty(ACCESSOR_SETTER, setter, attributes);
6156 } 6159 }
6157 } 6160 }
6158 6161
6159 if (is_observed) { 6162 if (is_observed) {
6160 const char* type = preexists ? "reconfigure" : "add"; 6163 const char* type = preexists ? "reconfigure" : "add";
(...skipping 10237 matching lines...) Expand 10 before | Expand all | Expand 10 after
16398 #define ERROR_MESSAGES_TEXTS(C, T) T, 16401 #define ERROR_MESSAGES_TEXTS(C, T) T,
16399 static const char* error_messages_[] = { 16402 static const char* error_messages_[] = {
16400 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 16403 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
16401 }; 16404 };
16402 #undef ERROR_MESSAGES_TEXTS 16405 #undef ERROR_MESSAGES_TEXTS
16403 return error_messages_[reason]; 16406 return error_messages_[reason];
16404 } 16407 }
16405 16408
16406 16409
16407 } } // namespace v8::internal 16410 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698