Skip to content

Commit

Permalink
[[FIX]] Correct binding power of AwaitExpression
Browse files Browse the repository at this point in the history
  • Loading branch information
jugglinmike authored and rwaldron committed Jun 6, 2019
1 parent 8cfd55d commit af04b1e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/jshint.js
Expand Up @@ -5298,7 +5298,7 @@ var JSHINT = (function() {
error("E024", this, "await");
}

expression(context, 0);
expression(context, 10);
return this;
} else {
this.exps = false;
Expand Down
10 changes: 10 additions & 0 deletions tests/unit/parser.js
Expand Up @@ -9591,6 +9591,16 @@ exports.asyncFunctions.awaitOperator = function (test) {
"};",
], { esversion: 8 });

// Regression test for gh-3395
TestRun(test, "within object initializer")
.test([
"void async function() {",
" void {",
" x: await 0,",
" };",
"};"
], { esversion: 8 });

test.done();
};

Expand Down

0 comments on commit af04b1e

Please sign in to comment.