Commit fe370261 authored by jarin@chromium.org's avatar jarin@chromium.org

When freezing global object, go through the property cell

R=verwaest@chromium.org
BUG=

Review URL: https://codereview.chromium.org/223613002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20469 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent d4ff6105
......@@ -5507,8 +5507,11 @@ static void FreezeDictionary(Dictionary* dictionary) {
PropertyDetails details = dictionary->DetailsAt(i);
int attrs = DONT_DELETE;
// READ_ONLY is an invalid attribute for JS setters/getters.
if (details.type() != CALLBACKS ||
!dictionary->ValueAt(i)->IsAccessorPair()) {
if (details.type() == CALLBACKS) {
Object* v = dictionary->ValueAt(i);
if (v->IsPropertyCell()) v = PropertyCell::cast(v)->value();
if (!v->IsAccessorPair()) attrs |= READ_ONLY;
} else {
attrs |= READ_ONLY;
}
details = details.CopyAddAttributes(
......
// 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.
__defineSetter__('x', function() { });
Object.freeze(this);
eval('const x = 1');
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment