@@ -1,4 +1,5 @@
|
||||
import bindifyDecorators from "babel-helper-bindify-decorators";
|
||||
import type { NodePath } from "babel-traverse";
|
||||
import * as t from "babel-types";
|
||||
|
||||
export default function (classPath) {
|
||||
@@ -14,7 +15,7 @@ export default function (classPath) {
|
||||
path.replaceWith(uid);
|
||||
}
|
||||
|
||||
function memoiseDecorators(paths) {
|
||||
function memoiseDecorators(paths: Array<NodePath>) {
|
||||
if (!Array.isArray(paths) || !paths.length) return;
|
||||
|
||||
// ensure correct evaluation order of decorators
|
||||
@@ -31,7 +32,7 @@ export default function (classPath) {
|
||||
maybeMemoise(classPath.get("superClass"));
|
||||
memoiseDecorators(classPath.get("decorators"), true);
|
||||
|
||||
let methods = classPath.get("body.body");
|
||||
let methods: Array<NodePath> = classPath.get("body.body");
|
||||
for (let methodPath of methods) {
|
||||
if (methodPath.is("computed")) {
|
||||
maybeMemoise(methodPath.get("key"));
|
||||
|
||||
Reference in New Issue
Block a user