Commit 63f1970c authored by rossberg@chromium.org's avatar rossberg@chromium.org

Fix crasher in Object.getOwnPropertySymbols

R=arv@chromium.org, mstarzinger@chromium.org
BUG=346141
LOG=Y

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19539 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 94af17a8
...@@ -15492,8 +15492,7 @@ int Dictionary<Shape, Key>::NumberOfElementsFilterAttributes( ...@@ -15492,8 +15492,7 @@ int Dictionary<Shape, Key>::NumberOfElementsFilterAttributes(
int result = 0; int result = 0;
for (int i = 0; i < capacity; i++) { for (int i = 0; i < capacity; i++) {
Object* k = HashTable<Shape, Key>::KeyAt(i); Object* k = HashTable<Shape, Key>::KeyAt(i);
if (HashTable<Shape, Key>::IsKey(k) && if (HashTable<Shape, Key>::IsKey(k) && !FilterKey(k, filter)) {
!FilterKey(k, filter)) {
PropertyDetails details = DetailsAt(i); PropertyDetails details = DetailsAt(i);
if (details.IsDeleted()) continue; if (details.IsDeleted()) continue;
PropertyAttributes attr = details.attributes(); PropertyAttributes attr = details.attributes();
...@@ -15516,12 +15515,12 @@ void Dictionary<Shape, Key>::CopyKeysTo( ...@@ -15516,12 +15515,12 @@ void Dictionary<Shape, Key>::CopyKeysTo(
FixedArray* storage, FixedArray* storage,
PropertyAttributes filter, PropertyAttributes filter,
typename Dictionary<Shape, Key>::SortMode sort_mode) { typename Dictionary<Shape, Key>::SortMode sort_mode) {
ASSERT(storage->length() >= NumberOfEnumElements()); ASSERT(storage->length() >= NumberOfElementsFilterAttributes(filter));
int capacity = HashTable<Shape, Key>::Capacity(); int capacity = HashTable<Shape, Key>::Capacity();
int index = 0; int index = 0;
for (int i = 0; i < capacity; i++) { for (int i = 0; i < capacity; i++) {
Object* k = HashTable<Shape, Key>::KeyAt(i); Object* k = HashTable<Shape, Key>::KeyAt(i);
if (HashTable<Shape, Key>::IsKey(k)) { if (HashTable<Shape, Key>::IsKey(k) && !FilterKey(k, filter)) {
PropertyDetails details = DetailsAt(i); PropertyDetails details = DetailsAt(i);
if (details.IsDeleted()) continue; if (details.IsDeleted()) continue;
PropertyAttributes attr = details.attributes(); PropertyAttributes attr = details.attributes();
...@@ -15583,12 +15582,11 @@ void Dictionary<Shape, Key>::CopyKeysTo( ...@@ -15583,12 +15582,11 @@ void Dictionary<Shape, Key>::CopyKeysTo(
int index, int index,
PropertyAttributes filter, PropertyAttributes filter,
typename Dictionary<Shape, Key>::SortMode sort_mode) { typename Dictionary<Shape, Key>::SortMode sort_mode) {
ASSERT(storage->length() >= NumberOfElementsFilterAttributes( ASSERT(storage->length() >= NumberOfElementsFilterAttributes(filter));
static_cast<PropertyAttributes>(NONE)));
int capacity = HashTable<Shape, Key>::Capacity(); int capacity = HashTable<Shape, Key>::Capacity();
for (int i = 0; i < capacity; i++) { for (int i = 0; i < capacity; i++) {
Object* k = HashTable<Shape, Key>::KeyAt(i); Object* k = HashTable<Shape, Key>::KeyAt(i);
if (HashTable<Shape, Key>::IsKey(k)) { if (HashTable<Shape, Key>::IsKey(k) && !FilterKey(k, filter)) {
PropertyDetails details = DetailsAt(i); PropertyDetails details = DetailsAt(i);
if (details.IsDeleted()) continue; if (details.IsDeleted()) continue;
PropertyAttributes attr = details.attributes(); PropertyAttributes attr = details.attributes();
......
// 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.
// Flags: --harmony-symbols
var s = Symbol()
var o = {}
o[s] = 2
o[""] = 3
Object.getOwnPropertySymbols(o)
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