Skip to content

Commit

Permalink
Move value decl for early return
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-mc committed Jul 22, 2019
1 parent aecad63 commit 6ab7fb8
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -305,7 +305,7 @@ function buildPrivateInstanceFieldInitSpec(ref, prop, privateNamesMap) {
function buildPrivateStaticFieldInitSpec(prop, privateNamesMap) {
const privateName = privateNamesMap.get(prop.node.key.id.name);
const { id, getId, setId, initAdded } = privateName;
const value = prop.node.value || prop.scope.buildUndefinedNode();

if (!prop.isProperty() && (initAdded || !(getId || setId))) return;

if (getId || setId) {
Expand Down Expand Up @@ -345,6 +345,7 @@ function buildPrivateStaticFieldInitSpec(prop, privateNamesMap) {
}
}

const value = prop.node.value || prop.scope.buildUndefinedNode();
return template.statement.ast`
var ${id} = {
// configurable is false by default
Expand Down

0 comments on commit 6ab7fb8

Please sign in to comment.