2020-03-27 11:08:42 -07:00
|
|
|
// Copyright 2020 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.
|
|
|
|
|
|
|
|
#include "src/execution/isolate.h"
|
|
|
|
#include "src/heap/factory.h"
|
|
|
|
#include "test/unittests/test-utils.h"
|
|
|
|
|
|
|
|
namespace v8 {
|
|
|
|
namespace internal {
|
|
|
|
|
|
|
|
using EnumIndexOverflowTest = TestWithNativeContextAndZone;
|
|
|
|
|
|
|
|
TEST_F(EnumIndexOverflowTest, GlobalObject) {
|
2024-08-14 20:41:00 +02:00
|
|
|
DirectHandle<GlobalDictionary> dictionary(
|
2021-02-24 14:47:06 +01:00
|
|
|
isolate()->global_object()->global_dictionary(kAcquireLoad), isolate());
|
2020-03-27 11:08:42 -07:00
|
|
|
dictionary->set_next_enumeration_index(
|
|
|
|
PropertyDetails::DictionaryStorageField::kMax);
|
2024-09-17 12:09:47 +02:00
|
|
|
DirectHandle<Object> value(Smi::FromInt(static_cast<int>(42)), isolate());
|
2025-04-29 08:03:15 +02:00
|
|
|
DirectHandle<Name> name = factory()->InternalizeUtf8String("eeeee");
|
2020-03-27 11:08:42 -07:00
|
|
|
JSObject::AddProperty(isolate(), isolate()->global_object(), name, value,
|
|
|
|
NONE);
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace internal
|
|
|
|
} // namespace v8
|