File tree Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ # E063: missing operator between expression and arrow function
2
+
3
+ The left-hand side of ` => ` must be a list of parameters. It is a syntax error if
4
+ the left-hand side looks like a function call:
5
+
6
+ let fs = require("fs");
7
+ let path = process.argv[2];
8
+ fs.readFile(path (err, data) => {
9
+ console.log(data);
10
+ });
11
+
12
+ To fix this error, make the left-hand side of ` => ` valid by adding an operator
13
+ (usually ` , ` ) before the parameter list:
14
+
15
+ let fs = require("fs");
16
+ let path = process.argv[2];
17
+ fs.readFile(path, (err, data) => {
18
+ console.log(data);
19
+ });
Original file line number Diff line number Diff line change
1
+ # E160: unexpected '=>'; expected parameter for arrow function, but got an expression instead
2
+
3
+ The left-hand side of ` => ` must be a list of parameters. It is a syntax error if
4
+ the left-hand side is instead an expression (such as a property access or a
5
+ function call):
6
+
7
+ if (this.mapSize => this.capacity) {
8
+ throw new Error("too many items");
9
+ }
10
+
11
+ let fs = require("fs");
12
+ let path = process.argv[2];
13
+ fs.mkdir(path () => console.log("done"));
14
+
15
+ To fix this error, replace ` => ` with the intended operator, such as ` >= ` :
16
+
17
+ if (this.mapSize >= this.capacity) {
18
+ throw new Error("too many items");
19
+ }
20
+
21
+ Alternatively, make the left-hand side of ` => ` valid by adding an operator
22
+ (usually ` , ` ) before the parameter list:
23
+
24
+ let fs = require("fs");
25
+ let path = process.argv[2];
26
+ fs.mkdir(path, () => console.log("done"));
You can’t perform that action at this time.
0 commit comments