forked from facebook/hermes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlvalue-errors.js
More file actions
29 lines (24 loc) · 853 Bytes
/
lvalue-errors.js
File metadata and controls
29 lines (24 loc) · 853 Bytes
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
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// RUN: (%hermes -hermes-parser %s 2>&1 || true) | %FileCheck %s --match-full-lines
var x;
x + 1 = 10;
//CHECK: {{.*}}lvalue-errors.js:11:1: error: invalid assignment left-hand side
//CHECK-NEXT: x + 1 = 10;
//CHECK-NEXT: ^~~~~
for (x + 1 in x);
//CHECK: {{.*}}lvalue-errors.js:16:6: error: invalid assignment left-hand side
//CHECK-NEXT: for (x + 1 in x);
//CHECK-NEXT: ^~~~~
for (x + 1 of x);
//CHECK: {{.*}}lvalue-errors.js:21:6: error: invalid assignment left-hand side
//CHECK-NEXT: for (x + 1 of x);
//CHECK-NEXT: ^~~~~
++0;
//CHECK: {{.*}}lvalue-errors.js:26:3: error: invalid operand in update operation
//CHECK-NEXT: ++0;
//CHECK-NEXT: ^