JDK-8019805.js revision 877:cf4d2252d444
1185377Ssam/*
2185377Ssam * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
3185377Ssam * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4185377Ssam *
5185377Ssam * This code is free software; you can redistribute it and/or modify it
6185377Ssam * under the terms of the GNU General Public License version 2 only, as
7185377Ssam * published by the Free Software Foundation.
8185377Ssam *
9185377Ssam * This code is distributed in the hope that it will be useful, but WITHOUT
10185377Ssam * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11185377Ssam * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12185377Ssam * version 2 for more details (a copy is included in the LICENSE file that
13185377Ssam * accompanied this code).
14185377Ssam *
15185377Ssam * You should have received a copy of the GNU General Public License version
16185377Ssam * 2 along with this work; if not, write to the Free Software Foundation,
17204644Srpaulo * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18185377Ssam *
19185377Ssam * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20185377Ssam * or visit www.oracle.com if you need additional information or have any
21185377Ssam * questions.
22185377Ssam */
23185377Ssam
24185377Ssam/**
25185377Ssam * JDK-8019805: for each (init; test; modify) is invalid
26185377Ssam *
27185377Ssam * @test
28185377Ssam * @run
29185377Ssam */
30185377Ssam
31185377Ssamtry {
32185377Ssam    eval("for each(var v=0;false;);");
33185377Ssam    print("FAILED: for each(var v=0; false;); should have thrown error");
34185377Ssam} catch (e) {
35185377Ssam    printError(e);
36185377Ssam}
37185377Ssam