initial import
[vuplus_webkit] / Source / JavaScriptCore / tests / mozilla / ecma_2 / Exceptions / expression-004.js
1 /**
2     File Name:          expression-004.js
3     Corresponds To:     11.2.1-4-n.js
4     ECMA Section:       11.2.1 Property Accessors
5     Description:
6
7     Author:             christine@netscape.com
8     Date:               09 september 1998
9 */
10     var SECTION = "expression-004";
11     var VERSION = "JS1_4";
12     var TITLE   = "Property Accessors";
13     writeHeaderToLog( SECTION + " "+TITLE );
14     startTest();
15
16     var tc = 0;
17     var testcases = new Array();
18
19     var OBJECT = new Property( "null", null, "null", 0 );
20
21     var result    = "Failed";
22     var exception = "No exception thrown";
23     var expect    = "Passed";
24
25     try {
26         result = OBJECT.value.toString();
27     } catch ( e ) {
28         result = expect;
29         exception = e.toString();
30     }
31
32     testcases[tc++] = new TestCase(
33         SECTION,
34         "Get the toString value of an object whose value is null "+
35         "(threw " + exception +")",
36         expect,
37         result );
38
39     test();
40
41 function Property( object, value, string, number ) {
42     this.object = object;
43     this.string = String(value);
44     this.number = Number(value);
45     this.value = value;
46 }