diff --git a/src/parser/function.js b/src/parser/function.js index 5adebe8ca..51ca34ca6 100644 --- a/src/parser/function.js +++ b/src/parser/function.js @@ -413,8 +413,9 @@ module.exports = { this.token === this.tok.T_ELLIPSIS && this.peek() === ")" ) { - result.push(this.node("variadicplaceholder")()); + const variadicNode = this.node("variadicplaceholder"); this.next(); + result.push(variadicNode()); } else if (this.token !== ")") { result = this.read_non_empty_argument_list(); } diff --git a/test/snapshot/__snapshots__/location.test.js.snap b/test/snapshot/__snapshots__/location.test.js.snap index cdd6fdd3d..49fa5f0cd 100644 --- a/test/snapshot/__snapshots__/location.test.js.snap +++ b/test/snapshot/__snapshots__/location.test.js.snap @@ -4270,11 +4270,11 @@ Program { "kind": "variadicplaceholder", "loc": Location { "end": Position { - "column": 51, + "column": 54, "line": 1, - "offset": 51, + "offset": 54, }, - "source": "", + "source": "...", "start": Position { "column": 51, "line": 1, @@ -11828,11 +11828,11 @@ Program { "kind": "variadicplaceholder", "loc": Location { "end": Position { - "column": 57, + "column": 60, "line": 1, - "offset": 57, + "offset": 60, }, - "source": "", + "source": "...", "start": Position { "column": 57, "line": 1,