varDecl.js revision 877:cf4d2252d444
1101704Smjacob/*
2101704Smjacob * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
3101704Smjacob * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4101704Smjacob *
5101704Smjacob * This code is free software; you can redistribute it and/or modify it
6101704Smjacob * under the terms of the GNU General Public License version 2 only, as
7101704Smjacob * published by the Free Software Foundation.
8101704Smjacob *
9101704Smjacob * This code is distributed in the hope that it will be useful, but WITHOUT
10101704Smjacob * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11101704Smjacob * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12101704Smjacob * version 2 for more details (a copy is included in the LICENSE file that
13101704Smjacob * accompanied this code).
14101704Smjacob *
15101704Smjacob * You should have received a copy of the GNU General Public License version
16101704Smjacob * 2 along with this work; if not, write to the Free Software Foundation,
17101704Smjacob * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18101704Smjacob *
19101704Smjacob * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20101704Smjacob * or visit www.oracle.com if you need additional information or have any
21101704Smjacob * questions.
22101704Smjacob */
23101704Smjacob
24101704Smjacob/**
25101704Smjacob * Tests to check variable declarations.
26101704Smjacob *
27101704Smjacob * @test
28101704Smjacob * @run
29101704Smjacob */
30101704Smjacob
31101704Smjacobload(__DIR__ + "util.js");
32101704Smjacob
33101704Smjacob// no initialization
34102199SmjacobprintParse("var a");
35101704SmjacobprintParse("var a, b");
36101704Smjacob
37101704Smjacob// init single, multiple
38101704SmjacobprintParse("var a = 'hello'");
39101704SmjacobprintParse("var a = 1, b = 2, c = 3");
40101704Smjacob