~ubuntu-branches/ubuntu/raring/qtwebkit-source/raring-proposed

« back to all changes in this revision

Viewing changes to Source/JavaScriptCore/tests/mozilla/ecma_2/Exceptions/expression-004.js

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-02-18 14:24:18 UTC
  • Revision ID: package-import@ubuntu.com-20130218142418-eon0jmjg3nj438uy
Tags: upstream-2.3
ImportĀ upstreamĀ versionĀ 2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
}