Revision: 21158
Author: [email protected]
Date: Tue May 6 08:34:48 2014 UTC
Log: Do not call setters of read-only accessors.
BUG=
TEST=mjsunit/readonly-accessor
[email protected]
Review URL: https://codereview.chromium.org/271433002
http://code.google.com/p/v8/source/detail?r=21158
Added:
/branches/bleeding_edge/test/mjsunit/readonly-accessor.js
Modified:
/branches/bleeding_edge/src/objects.cc
=======================================
--- /dev/null
+++ /branches/bleeding_edge/test/mjsunit/readonly-accessor.js Tue May 6
08:34:48 2014 UTC
@@ -0,0 +1,7 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var foo = {};
+foo.__proto__ = new String("bar");
+foo.length = 20;
=======================================
--- /branches/bleeding_edge/src/objects.cc Mon May 5 21:44:36 2014 UTC
+++ /branches/bleeding_edge/src/objects.cc Tue May 6 08:34:48 2014 UTC
@@ -3147,9 +3147,12 @@
}
case CALLBACKS: {
*done = true;
- Handle<Object> callback_object(result.GetCallbackObject(),
isolate);
- return SetPropertyWithCallback(object, callback_object, name,
value,
- handle(result.holder()),
strict_mode);
+ if (!result.IsReadOnly()) {
+ Handle<Object> callback_object(result.GetCallbackObject(),
isolate);
+ return SetPropertyWithCallback(object, callback_object, name,
value,
+ handle(result.holder()),
strict_mode);
+ }
+ break;
}
case HANDLER: {
Handle<JSProxy> proxy(result.proxy());
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.