initial import
[vuplus_webkit] / Source / JavaScriptCore / tests / mozilla / ecma_2 / Statements / if-001.js
1 /**
2  *  File Name:          if-001.js
3  *  ECMA Section:
4  *  Description:        The if statement
5  *
6  *  Verify that assignment in the if expression is evaluated correctly.
7  *  Verifies the fix for bug http://scopus/bugsplat/show_bug.cgi?id=148822.
8  *
9  *  Author:             christine@netscape.com
10  *  Date:               28 August 1998
11  */
12     var SECTION = "for-001";
13     var VERSION = "ECMA_2";
14     var TITLE   = "The if  statement";
15     var BUGNUMBER="148822";
16
17     startTest();
18     writeHeaderToLog( SECTION + " "+ TITLE);
19
20     var tc = 0;
21     var testcases = new Array();
22
23     var a = 0;
24     var b = 0;
25     var result = "passed";
26
27     if ( a = b ) {
28         result = "failed:  a = b should return 0";
29     }
30
31     testcases[tc++] = new TestCase(
32         SECTION,
33         "if ( a = b ), where a and b are both equal to 0",
34         "passed",
35         result );
36
37
38     test();
39