JDK-8007718.js revision 78:d5130a5803d1
1273562Smarcel/* 2273562Smarcel * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. 3273562Smarcel * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4273562Smarcel * 5273562Smarcel * This code is free software; you can redistribute it and/or modify it 6273562Smarcel * under the terms of the GNU General Public License version 2 only, as 7273562Smarcel * published by the Free Software Foundation. 8273562Smarcel * 9273562Smarcel * This code is distributed in the hope that it will be useful, but WITHOUT 10273562Smarcel * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11273562Smarcel * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12273562Smarcel * version 2 for more details (a copy is included in the LICENSE file that 13287111Smarcel * accompanied this code). 14273562Smarcel * 15273562Smarcel * You should have received a copy of the GNU General Public License version 16273562Smarcel * 2 along with this work; if not, write to the Free Software Foundation, 17273562Smarcel * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18273562Smarcel * 19273562Smarcel * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20273562Smarcel * or visit www.oracle.com if you need additional information or have any 21273562Smarcel * questions. 22273562Smarcel */ 23273562Smarcel 24273562Smarcel/** 25273562Smarcel * JDK-8007718: Make static RegExp properties fully compatible to other engines 26273562Smarcel * 27273562Smarcel * @test 28273562Smarcel * @run 29273562Smarcel */ 30273562Smarcel 31273562Smarcelfunction dumpRegExpProperties() { 32273562Smarcel for (var p in RegExp) { 33273562Smarcel print(p, RegExp[p], typeof RegExp[p]); 34273562Smarcel } 35273562Smarcel} 36273562Smarcel 37273562SmarceldumpRegExpProperties(); 38277353Smarcel 39273562Smarcel/abc/.exec("xyz"); 40273562SmarceldumpRegExpProperties(); 41322172Sphil 42322172Sphil/(b)(a)(r)/gmi.exec("FOOBARfoo"); 43322172SphildumpRegExpProperties(); 44322172Sphil 45322172Sphil"abcdefghijklmnopq".match(/(\w)(\w)(\w)(\w)(\w)(\w)(\w)(\w)(\w)(\w)(\w)/); 46322172SphildumpRegExpProperties(); 47322172Sphil 48322172Sphil"abcabcabcABCabcABC".split(/(b)/i); 49273562SmarceldumpRegExpProperties(); 50273562Smarcel 51273562Smarcel"foobarfoo".search(/bar/); 52273562SmarceldumpRegExpProperties(); 53273562Smarcel 54273562Smarcel/abc/.exec("xyz"); 55273562SmarceldumpRegExpProperties(); 56277353Smarcel