]> git.proxmox.com Git - pve-eslint.git/blob - eslint/tests/fixtures/parsers/unknown-operators/unknown-logical-operator.js
first commit
[pve-eslint.git] / eslint / tests / fixtures / parsers / unknown-operators / unknown-logical-operator.js
1 /**
2 * The output AST has been modified to represent an unknown operator
3 * (replaced ?? with %%)
4 *
5 * Parser: babel-eslint v8.2.3
6 * (with this fix for tokens: https://github.com/babel/babel-eslint/pull/632)
7 * Source code:
8 * null ?? 'foo'
9 */
10
11 exports.parse = () => ({
12 type: "Program",
13 start: 0,
14 end: 13,
15 loc: {
16 start: {
17 line: 1,
18 column: 0
19 },
20 end: {
21 line: 1,
22 column: 13
23 }
24 },
25 range: [0, 13],
26 comments: [],
27 tokens: [
28 {
29 type: "Null",
30 value: "null",
31 start: 0,
32 end: 4,
33 loc: {
34 start: {
35 line: 1,
36 column: 0
37 },
38 end: {
39 line: 1,
40 column: 4
41 }
42 },
43 range: [0, 4]
44 },
45 {
46 type: "Punctuator",
47 value: "%%",
48 start: 5,
49 end: 7,
50 loc: {
51 start: {
52 line: 1,
53 column: 5
54 },
55 end: {
56 line: 1,
57 column: 7
58 }
59 },
60 range: [5, 7]
61 },
62 {
63 type: "String",
64 value: "'foo'",
65 start: 8,
66 end: 13,
67 loc: {
68 start: {
69 line: 1,
70 column: 8
71 },
72 end: {
73 line: 1,
74 column: 13
75 }
76 },
77 range: [8, 13]
78 }
79 ],
80 sourceType: "script",
81 body: [
82 {
83 type: "ExpressionStatement",
84 start: 0,
85 end: 13,
86 loc: {
87 start: {
88 line: 1,
89 column: 0
90 },
91 end: {
92 line: 1,
93 column: 13
94 }
95 },
96 range: [0, 13],
97 expression: {
98 type: "LogicalExpression",
99 start: 0,
100 end: 13,
101 loc: {
102 start: {
103 line: 1,
104 column: 0
105 },
106 end: {
107 line: 1,
108 column: 13
109 }
110 },
111 range: [0, 13],
112 left: {
113 type: "Literal",
114 start: 0,
115 end: 4,
116 loc: {
117 start: {
118 line: 1,
119 column: 0
120 },
121 end: {
122 line: 1,
123 column: 4
124 }
125 },
126 range: [0, 4],
127 value: null,
128 raw: "null",
129 _babelType: "Literal"
130 },
131 operator: "%%",
132 right: {
133 type: "Literal",
134 start: 8,
135 end: 13,
136 loc: {
137 start: {
138 line: 1,
139 column: 8
140 },
141 end: {
142 line: 1,
143 column: 13
144 }
145 },
146 range: [8, 13],
147 value: "foo",
148 raw: "'foo'",
149 _babelType: "Literal"
150 },
151 _babelType: "LogicalExpression"
152 },
153 _babelType: "ExpressionStatement"
154 }
155 ]
156 });