nashorn/test/script/basic/parser/objectLitExpr.js.EXPECTED
author sundar
Thu, 12 Sep 2013 22:16:40 +0530
changeset 19894 195477810711
child 20213 414e257bb93e
permissions -rw-r--r--
8024693: Various minor issues with JSONWriter used by script parser API Reviewed-by: jlaskey, hannesw

{
    "type": "Program",
    "body": [
        {
            "type": "ExpressionStatement",
            "expression": {
                "type": "AssignmentExpression",
                "operator": "=",
                "left": {
                    "type": "Identifier",
                    "name": "obj"
                },
                "right": {
                    "type": "ObjectExpression",
                    "properties": []
                }
            }
        }
    ]
}
{
    "type": "Program",
    "body": [
        {
            "type": "ExpressionStatement",
            "expression": {
                "type": "AssignmentExpression",
                "operator": "=",
                "left": {
                    "type": "Identifier",
                    "name": "p"
                },
                "right": {
                    "type": "ObjectExpression",
                    "properties": [
                        {
                            "key": {
                                "type": "Identifier",
                                "name": "x"
                            },
                            "value": {
                                "type": "Literal",
                                "value": 10
                            },
                            "kind": "init"
                        },
                        {
                            "key": {
                                "type": "Identifier",
                                "name": "y"
                            },
                            "value": {
                                "type": "Literal",
                                "value": 2
                            },
                            "kind": "init"
                        }
                    ]
                }
            }
        }
    ]
}
{
    "type": "Program",
    "body": [
        {
            "type": "ExpressionStatement",
            "expression": {
                "type": "AssignmentExpression",
                "operator": "=",
                "left": {
                    "type": "Identifier",
                    "name": "p"
                },
                "right": {
                    "type": "ObjectExpression",
                    "properties": [
                        {
                            "key": {
                                "type": "Literal",
                                "value": "x"
                            },
                            "value": {
                                "type": "Literal",
                                "value": 10
                            },
                            "kind": "init"
                        },
                        {
                            "key": {
                                "type": "Literal",
                                "value": "y"
                            },
                            "value": {
                                "type": "Literal",
                                "value": 2
                            },
                            "kind": "init"
                        }
                    ]
                }
            }
        }
    ]
}
{
    "type": "Program",
    "body": [
        {
            "type": "ExpressionStatement",
            "expression": {
                "type": "AssignmentExpression",
                "operator": "=",
                "left": {
                    "type": "Identifier",
                    "name": "p"
                },
                "right": {
                    "type": "ObjectExpression",
                    "properties": [
                        {
                            "key": {
                                "type": "Identifier",
                                "name": "x"
                            },
                            "value": {
                                "type": "FunctionExpression",
                                "id": {
                                    "type": "Identifier",
                                    "name": "get x"
                                },
                                "params": [],
                                "defaults": [],
                                "rest": null,
                                "body": {
                                    "type": "BlockStatement",
                                    "body": [
                                        {
                                            "type": "ReturnStatement",
                                            "argument": {
                                                "type": "Identifier",
                                                "name": "xValue"
                                            }
                                        }
                                    ]
                                },
                                "generator": false,
                                "expression": false
                            },
                            "kind": "get"
                        },
                        {
                            "key": {
                                "type": "Identifier",
                                "name": "y"
                            },
                            "value": {
                                "type": "FunctionExpression",
                                "id": {
                                    "type": "Identifier",
                                    "name": "get y"
                                },
                                "params": [],
                                "defaults": [],
                                "rest": null,
                                "body": {
                                    "type": "BlockStatement",
                                    "body": [
                                        {
                                            "type": "ReturnStatement",
                                            "argument": {
                                                "type": "Identifier",
                                                "name": "yValue"
                                            }
                                        }
                                    ]
                                },
                                "generator": false,
                                "expression": false
                            },
                            "kind": "get"
                        }
                    ]
                }
            }
        }
    ]
}