aboutsummaryrefslogtreecommitdiff
path: root/test/script/basic/parser/throwStat.js.EXPECTED
blob: d869cbda8dfb6ce1f4b6e1e3f204ac70e5a591c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
{
    "type": "Program",
    "body": [
        {
            "type": "ThrowStatement",
            "argument": {
                "type": "Identifier",
                "name": "err"
            }
        }
    ]
}
{
    "type": "Program",
    "body": [
        {
            "type": "ThrowStatement",
            "argument": {
                "type": "Literal",
                "value": "wrong"
            }
        }
    ]
}
{
    "type": "Program",
    "body": [
        {
            "type": "ThrowStatement",
            "argument": {
                "type": "NewExpression",
                "callee": {
                    "type": "Identifier",
                    "name": "TypeError"
                },
                "arguments": []
            }
        }
    ]
}
{
    "type": "Program",
    "body": [
        {
            "type": "ThrowStatement",
            "argument": {
                "type": "NewExpression",
                "callee": {
                    "type": "Identifier",
                    "name": "TypeError"
                },
                "arguments": [
                    {
                        "type": "Literal",
                        "value": "not an array"
                    }
                ]
            }
        }
    ]
}
{
    "type": "Program",
    "body": [
        {
            "type": "ThrowStatement",
            "argument": {
                "type": "ObjectExpression",
                "properties": [
                    {
                        "key": {
                            "type": "Identifier",
                            "name": "msg"
                        },
                        "value": {
                            "type": "Literal",
                            "value": "wrong!"
                        },
                        "kind": "init"
                    }
                ]
            }
        }
    ]
}