--- /dev/null 2013-02-05 17:07:01.494007089 +0530 +++ new/test/script/basic/JDK-8007522.js 2013-02-05 20:04:19.100273803 +0530 @@ -0,0 +1,13 @@ +/** + * 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"); +} +