test/script/basic/JDK-8007522.js

Wed, 03 Jun 2015 10:42:06 +0200

author
hannesw
date
Wed, 03 Jun 2015 10:42:06 +0200
changeset 1393
dcbf5e2121e3
parent 962
ac62e33a99b0
child 1205
4112748288bb
permissions
-rw-r--r--

8066220: Fuzzing bug: MethodHandle bug (Object,Object) != (boolean)Object
Reviewed-by: lagergren, attila, sundar

sundar@71 1 /*
sundar@71 2 * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
sundar@71 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
attila@962 4 *
sundar@71 5 * This code is free software; you can redistribute it and/or modify it
sundar@71 6 * under the terms of the GNU General Public License version 2 only, as
sundar@71 7 * published by the Free Software Foundation.
attila@962 8 *
sundar@71 9 * This code is distributed in the hope that it will be useful, but WITHOUT
sundar@71 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
sundar@71 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
sundar@71 12 * version 2 for more details (a copy is included in the LICENSE file that
sundar@71 13 * accompanied this code).
attila@962 14 *
sundar@71 15 * You should have received a copy of the GNU General Public License version
sundar@71 16 * 2 along with this work; if not, write to the Free Software Foundation,
sundar@71 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
attila@962 18 *
sundar@71 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
sundar@71 20 * or visit www.oracle.com if you need additional information or have any
sundar@71 21 * questions.
sundar@71 22 */
sundar@71 23
sundar@70 24 /**
sundar@70 25 * JDK-8007522: IllegalStateException thrown from String.prototype.search function
sundar@70 26 *
sundar@70 27 * @test
sundar@70 28 * @run
sundar@70 29 */
sundar@70 30
sundar@70 31 var str = "hello";
sundar@70 32 // search used to result in IllegalStateException
sundar@70 33 if (str.search(/foo/g) != -1) {
sundar@70 34 fail("String.prototype.search failed");
sundar@70 35 }
sundar@70 36

mercurial