Skip to content

Commit

Permalink
Fix accessorIsGenerator
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed Sep 1, 2020
1 parent d3a6a44 commit 27e0be0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"dependencies": {
"@angular/compiler": "10.0.14",
"@babel/code-frame": "7.10.4",
"@babel/parser": "7.11.3",
"@babel/parser": "7.11.5",
"@glimmer/syntax": "0.60.0",
"@iarna/toml": "2.2.5",
"@typescript-eslint/typescript-estree": "3.10.1",
Expand Down
8 changes: 5 additions & 3 deletions src/language-js/printer-estree.js
Original file line number Diff line number Diff line change
Expand Up @@ -3682,15 +3682,17 @@ function printMethod(path, options, print) {
if (value.async) {
parts.push("async ");
}
if (value.generator) {
parts.push("*");
}
} else {
assert.ok(kind === "get" || kind === "set");

parts.push(kind, " ");
}

// A `getter`/`setter` can't be a generator, but it's recoverable
if (value.generator) {
parts.push("*");
}

parts.push(
printPropertyKey(path, options, print),
node.optional || node.key.optional ? "?" : "",
Expand Down
4 changes: 2 additions & 2 deletions tests/js/objects/__snapshots__/jsfmt.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ printWidth: 80
// https://github.com/babel/babel/pull/11921/
({
get iterator() {},
set iterator(iter) {},
get *iterator() {},
set *iterator(iter) {},
});
================================================================================
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,10 @@
chalk "^2.0.0"
js-tokens "^4.0.0"

"@babel/parser@7.11.2":
version "7.11.2"
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.11.2.tgz#0882ab8a455df3065ea2dcb4c753b2460a24bead"
integrity sha512-Vuj/+7vLo6l1Vi7uuO+1ngCDNeVmNbTngcJFKCR/oEtz8tKz0CJxZEGmPt9KcIloZhOZ3Zit6xbpXT2MDlS9Vw==
"@babel/parser@7.11.5":
version "7.11.5"
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.11.5.tgz#c7ff6303df71080ec7a4f5b8c003c58f1cf51037"
integrity sha512-X9rD8qqm695vgmeaQ4fvz/o3+Wk4ZzQvSHkDBgpYKxpD4qTAUm88ZKtHkVqIOsYFFbIQ6wQYhC6q7pjqVK0E0Q==

"@babel/parser@^7.1.0", "@babel/parser@^7.10.4", "@babel/parser@^7.11.0", "@babel/parser@^7.11.4":
version "7.11.4"
Expand Down

0 comments on commit 27e0be0

Please sign in to comment.