1// Copyright 2015 the V8 project authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5var global = this; 6 7assertEquals("object", typeof global); // Global object. 8 9var s = new Set(); 10s.add(global); // Puts a hash code on the global object. 11assertTrue(s.has(global)); 12for (var i = 0; i < 100; i++) { 13 // Force rehash. Global object is placed according to the hash code that it 14 // gets in the C++ runtime. 15 s.add(i); 16} 17 18// Hopefully still findable using the JS hash code. 19assertTrue(s.has(global)); 20