Skip to content

Commit 14a6c9d

Browse files
committed
Remove function.expression
1 parent f6c9e12 commit 14a6c9d

12 files changed

+6
-297
lines changed

acorn-loose/src/expression.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,6 @@ lp.initFunction = function(node) {
540540
node.params = []
541541
if (this.options.ecmaVersion >= 6) {
542542
node.generator = false
543-
node.expression = false
544543
}
545544
if (this.options.ecmaVersion >= 8)
546545
node.async = false

acorn/src/expression.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ pp.parsePropertyName = function(prop) {
903903

904904
pp.initFunction = function(node) {
905905
node.id = null
906-
if (this.options.ecmaVersion >= 6) node.generator = node.expression = false
906+
if (this.options.ecmaVersion >= 6) node.generator = false
907907
if (this.options.ecmaVersion >= 8) node.async = false
908908
}
909909

@@ -964,7 +964,6 @@ pp.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) {
964964

965965
if (isExpression) {
966966
node.body = this.parseMaybeAssign(forInit)
967-
node.expression = true
968967
this.checkParams(node, false)
969968
} else {
970969
let nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params)
@@ -988,7 +987,6 @@ pp.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) {
988987
// Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval'
989988
if (this.strict && node.id) this.checkLValSimple(node.id, BIND_OUTSIDE)
990989
node.body = this.parseBlock(false, undefined, useStrict && !oldStrict)
991-
node.expression = false
992990
this.adaptDirectivePrologue(node.body.body)
993991
this.labels = oldLabels
994992
}

test/tests-async-iteration.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ test("async function f() { for await (x of xs); }", {
2323
"name": "f"
2424
},
2525
"generator": false,
26-
"expression": false,
2726
"async": true,
2827
"params": [],
2928
"body": {
@@ -76,7 +75,6 @@ test("async function f() { for await (var x of xs); }", {
7675
"name": "f"
7776
},
7877
"generator": false,
79-
"expression": false,
8078
"async": true,
8179
"params": [],
8280
"body": {
@@ -143,7 +141,6 @@ test("async function f() { for await (let x of xs); }", {
143141
"name": "f"
144142
},
145143
"generator": false,
146-
"expression": false,
147144
"async": true,
148145
"params": [],
149146
"body": {
@@ -210,7 +207,6 @@ test("async function f() { for\nawait (x of xs); }", {
210207
"name": "f"
211208
},
212209
"generator": false,
213-
"expression": false,
214210
"async": true,
215211
"params": [],
216212
"body": {
@@ -273,7 +269,6 @@ test("f = async function() { for await (x of xs); }", {
273269
"end": 45,
274270
"id": null,
275271
"generator": false,
276-
"expression": false,
277272
"async": true,
278273
"params": [],
279274
"body": {
@@ -338,7 +333,6 @@ test("f = async() => { for await (x of xs); }", {
338333
"end": 39,
339334
"id": null,
340335
"generator": false,
341-
"expression": false,
342336
"async": true,
343337
"params": [],
344338
"body": {
@@ -421,7 +415,6 @@ test("obj = { async f() { for await (x of xs); } }", {
421415
"end": 42,
422416
"id": null,
423417
"generator": false,
424-
"expression": false,
425418
"async": true,
426419
"params": [],
427420
"body": {
@@ -504,7 +497,6 @@ test("class A { async f() { for await (x of xs); } }", {
504497
"end": 44,
505498
"id": null,
506499
"generator": false,
507-
"expression": false,
508500
"async": true,
509501
"params": [],
510502
"body": {
@@ -676,7 +668,6 @@ test("async function* f() { await a; yield b; }", {
676668
"name": "f"
677669
},
678670
"generator": true,
679-
"expression": false,
680671
"async": true,
681672
"params": [],
682673
"body": {
@@ -759,7 +750,6 @@ test("f = async function*() { await a; yield b; }", {
759750
"end": 43,
760751
"id": null,
761752
"generator": true,
762-
"expression": false,
763753
"async": true,
764754
"params": [],
765755
"body": {
@@ -852,7 +842,6 @@ test("obj = { async* f() { await a; yield b; } }", {
852842
"end": 40,
853843
"id": null,
854844
"generator": true,
855-
"expression": false,
856845
"async": true,
857846
"params": [],
858847
"body": {
@@ -945,7 +934,6 @@ test("class A { async* f() { await a; yield b; } }", {
945934
"end": 42,
946935
"id": null,
947936
"generator": true,
948-
"expression": false,
949937
"async": true,
950938
"params": [],
951939
"body": {
@@ -1036,7 +1024,6 @@ test("class A { static async* f() { await a; yield b; } }", {
10361024
"end": 49,
10371025
"id": null,
10381026
"generator": true,
1039-
"expression": false,
10401027
"async": true,
10411028
"params": [],
10421029
"body": {
@@ -1255,7 +1242,6 @@ test("var gen = { async *method() {} }", {
12551242
"end": 30,
12561243
"id": null,
12571244
"generator": true,
1258-
"expression": false,
12591245
"async": true,
12601246
"params": [],
12611247
"body": {
@@ -1291,7 +1277,6 @@ test("export default async function*() {}", {
12911277
"end": 35,
12921278
"id": null,
12931279
"generator": true,
1294-
"expression": false,
12951280
"async": true,
12961281
"params": [],
12971282
"body": {

0 commit comments

Comments
 (0)