1// Copyright 2014 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 5// Flags: --expose-externalize-string --expose-gc 6 7var re = /(B)/; 8var cons1 = "0123456789" + "ABCDEFGHIJ"; 9var cons2 = "0123456789\u1234" + "ABCDEFGHIJ"; 10gc(); 11gc(); // Promote cons. 12 13try { externalizeString(cons1, false); } catch (e) { } 14try { externalizeString(cons2, true); } catch (e) { } 15 16var slice1 = cons1.slice(1,-1); 17var slice2 = cons2.slice(1,-1); 18for (var i = 0; i < 10; i++) { 19 assertEquals(["B", "B"], re.exec(slice1)); 20 assertEquals(["B", "B"], re.exec(slice2)); 21} 22