view test/script/basic/parser/objectLitExpr.js.EXPECTED @ 561:917b16e509bd

8024693: Various minor issues with JSONWriter used by script parser API Reviewed-by: jlaskey, hannesw
author sundar
date Thu, 12 Sep 2013 22:16:40 +0530
parents
children 821b0b610861
line wrap: on
line source
{
    "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"
                        }
                    ]
                }
            }
        }
    ]
}