test/script/basic/parser/primaryExpr.js.EXPECTED

Thu, 12 Sep 2013 22:16:40 +0530

author
sundar
date
Thu, 12 Sep 2013 22:16:40 +0530
changeset 551
917b16e509bd
parent 0
b1a7da25b547
permissions
-rw-r--r--

8024693: Various minor issues with JSONWriter used by script parser API
Reviewed-by: jlaskey, hannesw

     1 {
     2     "type": "Program",
     3     "body": [
     4         {
     5             "type": "ExpressionStatement",
     6             "expression": {
     7                 "type": "ThisExpression"
     8             }
     9         }
    10     ]
    11 }
    12 {
    13     "type": "Program",
    14     "body": [
    15         {
    16             "type": "ExpressionStatement",
    17             "expression": {
    18                 "type": "Identifier",
    19                 "name": "foo"
    20             }
    21         }
    22     ]
    23 }
    24 {
    25     "type": "Program",
    26     "body": [
    27         {
    28             "type": "ExpressionStatement",
    29             "expression": {
    30                 "type": "Literal",
    31                 "value": null
    32             }
    33         }
    34     ]
    35 }
    36 {
    37     "type": "Program",
    38     "body": [
    39         {
    40             "type": "ExpressionStatement",
    41             "expression": {
    42                 "type": "Literal",
    43                 "value": true
    44             }
    45         }
    46     ]
    47 }
    48 {
    49     "type": "Program",
    50     "body": [
    51         {
    52             "type": "ExpressionStatement",
    53             "expression": {
    54                 "type": "Literal",
    55                 "value": false
    56             }
    57         }
    58     ]
    59 }
    60 {
    61     "type": "Program",
    62     "body": [
    63         {
    64             "type": "ExpressionStatement",
    65             "expression": {
    66                 "type": "Literal",
    67                 "value": 33
    68             }
    69         }
    70     ]
    71 }
    72 {
    73     "type": "Program",
    74     "body": [
    75         {
    76             "type": "ExpressionStatement",
    77             "expression": {
    78                 "type": "Literal",
    79                 "value": 3.14
    80             }
    81         }
    82     ]
    83 }
    84 {
    85     "type": "Program",
    86     "body": [
    87         {
    88             "type": "ExpressionStatement",
    89             "expression": {
    90                 "type": "BinaryExpression",
    91                 "operator": "*",
    92                 "left": {
    93                     "type": "BinaryExpression",
    94                     "operator": "+",
    95                     "left": {
    96                         "type": "Literal",
    97                         "value": 10
    98                     },
    99                     "right": {
   100                         "type": "Literal",
   101                         "value": 3
   102                     }
   103                 },
   104                 "right": {
   105                     "type": "Literal",
   106                     "value": 2
   107                 }
   108             }
   109         }
   110     ]
   111 }
   112 {
   113     "type": "Program",
   114     "body": [
   115         {
   116             "type": "ExpressionStatement",
   117             "expression": {
   118                 "type": "ObjectExpression",
   119                 "properties": []
   120             }
   121         }
   122     ]
   123 }
   124 {
   125     "type": "Program",
   126     "body": [
   127         {
   128             "type": "ExpressionStatement",
   129             "expression": {
   130                 "type": "ObjectExpression",
   131                 "properties": [
   132                     {
   133                         "key": {
   134                             "type": "Identifier",
   135                             "name": "x"
   136                         },
   137                         "value": {
   138                             "type": "Literal",
   139                             "value": 3
   140                         },
   141                         "kind": "init"
   142                     }
   143                 ]
   144             }
   145         }
   146     ]
   147 }
   148 {
   149     "type": "Program",
   150     "body": [
   151         {
   152             "type": "ExpressionStatement",
   153             "expression": {
   154                 "type": "ArrayExpression",
   155                 "elements": []
   156             }
   157         }
   158     ]
   159 }
   160 {
   161     "type": "Program",
   162     "body": [
   163         {
   164             "type": "ExpressionStatement",
   165             "expression": {
   166                 "type": "ArrayExpression",
   167                 "elements": [
   168                     null,
   169                     null
   170                 ]
   171             }
   172         }
   173     ]
   174 }
   175 {
   176     "type": "Program",
   177     "body": [
   178         {
   179             "type": "ExpressionStatement",
   180             "expression": {
   181                 "type": "ArrayExpression",
   182                 "elements": [
   183                     {
   184                         "type": "Literal",
   185                         "value": 4
   186                     },
   187                     {
   188                         "type": "Literal",
   189                         "value": 5
   190                     },
   191                     {
   192                         "type": "Literal",
   193                         "value": 5
   194                     }
   195                 ]
   196             }
   197         }
   198     ]
   199 }

mercurial