Skip to content

Commit

Permalink
Use buildUndefinedNode in accessor templates
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-mc committed Aug 23, 2019
1 parent 3f8d021 commit 3e6c955
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions packages/babel-helper-create-class-features-plugin/src/fields.js
Expand Up @@ -319,8 +319,8 @@ function buildPrivateStaticFieldInitSpec(prop, privateNamesMap) {
// configurable is false by default
// enumerable is false by default
// writable is false by default
get: ${getId ? getId.name : "null"},
set: ${setId ? setId.name : "null"}
get: ${getId ? getId.name : prop.scope.buildUndefinedNode()},
set: ${setId ? setId.name : prop.scope.buildUndefinedNode()}
}
`;
}
Expand Down Expand Up @@ -363,8 +363,8 @@ function buildPrivateMethodInitLoose(ref, prop, privateNamesMap) {
// configurable is false by default
// enumerable is false by default
// writable is false by default
get: ${getId ? getId.name : "undefined"},
set: ${setId ? setId.name : "undefined"}
get: ${getId ? getId.name : prop.scope.buildUndefinedNode()},
set: ${setId ? setId.name : prop.scope.buildUndefinedNode()}
});
`;
}
Expand All @@ -383,8 +383,8 @@ function buildPrivateInstanceMethodInitSpec(ref, prop, privateNamesMap) {

return template.statement.ast`
${id}.set(${ref}, {
get: ${getId ? getId.name : "undefined"},
set: ${setId ? setId.name : "undefined"}
get: ${getId ? getId.name : prop.scope.buildUndefinedNode()},
set: ${setId ? setId.name : prop.scope.buildUndefinedNode()}
});
`;
}
Expand Down Expand Up @@ -433,8 +433,8 @@ function buildPrivateStaticMethodInitLoose(ref, prop, state, privateNamesMap) {
// configurable is false by default
// enumerable is false by default
// writable is false by default
get: ${getId ? getId.name : "undefined"},
set: ${setId ? setId.name : "undefined"}
get: ${getId ? getId.name : prop.scope.buildUndefinedNode()},
set: ${setId ? setId.name : prop.scope.buildUndefinedNode()}
})
`;
}
Expand Down
@@ -1,7 +1,7 @@
class Cl {
constructor() {
Object.defineProperty(this, _privateFieldValue, {
get: undefined,
get: void 0,
set: _set_privateFieldValue
});
Object.defineProperty(this, _privateField, {
Expand Down
Expand Up @@ -2,7 +2,7 @@ class Cl {
constructor() {
Object.defineProperty(this, _privateFieldValue, {
get: _get_privateFieldValue,
set: undefined
set: void 0
});
Object.defineProperty(this, _privateField, {
writable: true,
Expand Down
@@ -1,7 +1,7 @@
class Cl {
constructor() {
_privateFieldValue.set(this, {
get: undefined,
get: void 0,
set: _set_privateFieldValue
});

Expand Down
Expand Up @@ -2,7 +2,7 @@ class Cl {
constructor() {
_privateFieldValue.set(this, {
get: _get_privateFieldValue,
set: undefined
set: void 0
});

_privateField.set(this, {
Expand Down
Expand Up @@ -18,6 +18,6 @@ Object.defineProperty(Cl, _PRIVATE_STATIC_FIELD, {
value: 0
});
Object.defineProperty(Cl, _privateStaticFieldValue, {
get: undefined,
get: void 0,
set: _set_privateStaticFieldValue
});
Expand Up @@ -19,5 +19,5 @@ Object.defineProperty(Cl, _PRIVATE_STATIC_FIELD, {
});
Object.defineProperty(Cl, _privateStaticFieldValue, {
get: _get_privateStaticFieldValue,
set: undefined
set: void 0
});
Expand Up @@ -14,6 +14,6 @@ var _PRIVATE_STATIC_FIELD = {
value: 0
};
var _privateStaticFieldValue = {
get: null,
get: void 0,
set: _set_privateStaticFieldValue
};
Expand Up @@ -15,5 +15,5 @@ var _PRIVATE_STATIC_FIELD = {
};
var _privateStaticFieldValue = {
get: _get_privateStaticFieldValue,
set: null
set: void 0
};

0 comments on commit 3e6c955

Please sign in to comment.