Skip to content

Commit

Permalink
noCallClass -> noClassCalls
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Feb 11, 2021
1 parent 68c22d2 commit e91a94f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/babel-core/src/config/validation/options.js
Expand Up @@ -341,7 +341,7 @@ export const assumptionsNames = new Set<string>([
"iterableIsArray",
"mutableTemplateObject",
"newableArrowFunctions",
"noCallClass",
"noClassCalls",
"noDocumentAll",
"objectRestNoSymbols",
"privateFieldsAsProperties",
Expand Down
4 changes: 2 additions & 2 deletions packages/babel-plugin-transform-classes/src/index.js
Expand Up @@ -25,7 +25,7 @@ export default declare((api, options) => {
const constantSuper = api.assumption("constantSuper") ?? options.loose;
const superIsCallableConstructor =
api.assumption("superIsCallableConstructor") ?? options.loose;
const noCallClass = api.assumption("noCallClass") ?? options.loose;
const noClassCalls = api.assumption("noClassCalls") ?? options.loose;

// todo: investigate traversal requeueing
const VISITED = Symbol();
Expand Down Expand Up @@ -68,7 +68,7 @@ export default declare((api, options) => {
setClassMethods,
constantSuper,
superIsCallableConstructor,
noCallClass,
noClassCalls,
}),
);

Expand Down
4 changes: 2 additions & 2 deletions packages/babel-plugin-transform-classes/src/transformClass.js
Expand Up @@ -15,7 +15,7 @@ type ClassAssumptions = {
setClassMethods: boolean,
constantSuper: boolean,
superIsCallableConstructor: boolean,
noCallClass: boolean,
noClassCalls: boolean,
};

function buildConstructor(classRef, constructorBody, node) {
Expand Down Expand Up @@ -671,7 +671,7 @@ export default function transformClass(
buildBody();

// make sure this class isn't directly called (with A() instead new A())
if (!assumptions.noCallClass) {
if (!assumptions.noClassCalls) {
constructorBody.body.unshift(
t.expressionStatement(
t.callExpression(classState.file.addHelper("classCallCheck"), [
Expand Down
Expand Up @@ -7,6 +7,6 @@
"transform-block-scoping"
],
"assumptions": {
"noCallClass": true
"noClassCalls": true
}
}

0 comments on commit e91a94f

Please sign in to comment.