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

Side by Side Diff: src/objects.cc

Issue 271433002: Do not call setters of read-only accessors. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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/mjsunit/readonly-accessor.js » ('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 "v8.h" 5 #include "v8.h"
6 6
7 #include "accessors.h" 7 #include "accessors.h"
8 #include "allocation-site-scopes.h" 8 #include "allocation-site-scopes.h"
9 #include "api.h" 9 #include "api.h"
10 #include "arguments.h" 10 #include "arguments.h"
(...skipping 3129 matching lines...) Expand 10 before | Expand all | Expand 10 after
3140 *done = result.IsReadOnly(); 3140 *done = result.IsReadOnly();
3141 break; 3141 break;
3142 case INTERCEPTOR: { 3142 case INTERCEPTOR: {
3143 PropertyAttributes attr = GetPropertyAttributeWithInterceptor( 3143 PropertyAttributes attr = GetPropertyAttributeWithInterceptor(
3144 handle(result.holder()), object, name, true); 3144 handle(result.holder()), object, name, true);
3145 *done = !!(attr & READ_ONLY); 3145 *done = !!(attr & READ_ONLY);
3146 break; 3146 break;
3147 } 3147 }
3148 case CALLBACKS: { 3148 case CALLBACKS: {
3149 *done = true; 3149 *done = true;
3150 Handle<Object> callback_object(result.GetCallbackObject(), isolate); 3150 if (!result.IsReadOnly()) {
3151 return SetPropertyWithCallback(object, callback_object, name, value, 3151 Handle<Object> callback_object(result.GetCallbackObject(), isolate);
3152 handle(result.holder()), strict_mode); 3152 return SetPropertyWithCallback(object, callback_object, name, value,
3153 handle(result.holder()), strict_mode);
3154 }
3155 break;
3153 } 3156 }
3154 case HANDLER: { 3157 case HANDLER: {
3155 Handle<JSProxy> proxy(result.proxy()); 3158 Handle<JSProxy> proxy(result.proxy());
3156 return JSProxy::SetPropertyViaPrototypesWithHandler( 3159 return JSProxy::SetPropertyViaPrototypesWithHandler(
3157 proxy, object, name, value, attributes, strict_mode, done); 3160 proxy, object, name, value, attributes, strict_mode, done);
3158 } 3161 }
3159 case NONEXISTENT: 3162 case NONEXISTENT:
3160 UNREACHABLE(); 3163 UNREACHABLE();
3161 break; 3164 break;
3162 } 3165 }
(...skipping 14109 matching lines...) Expand 10 before | Expand all | Expand 10 after
17272 #define ERROR_MESSAGES_TEXTS(C, T) T, 17275 #define ERROR_MESSAGES_TEXTS(C, T) T,
17273 static const char* error_messages_[] = { 17276 static const char* error_messages_[] = {
17274 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 17277 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
17275 }; 17278 };
17276 #undef ERROR_MESSAGES_TEXTS 17279 #undef ERROR_MESSAGES_TEXTS
17277 return error_messages_[reason]; 17280 return error_messages_[reason];
17278 } 17281 }
17279 17282
17280 17283
17281 } } // namespace v8::internal 17284 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/readonly-accessor.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698