nashorn/test/script/basic/JDK-8007522.js
author sundar
Tue, 05 Feb 2013 21:00:04 +0530
changeset 16214 299e3d0ec77e
child 16215 92f00bfd6059
permissions -rw-r--r--
8007522: IllegalStateException thrown from String.prototype.search function Reviewed-by: jlaskey

/**
 * JDK-8007522: IllegalStateException thrown from String.prototype.search function
 *
 * @test
 * @run
 */

var str = "hello";
// search used to result in IllegalStateException
if (str.search(/foo/g) != -1) {
    fail("String.prototype.search failed");
}