fix: don't run the default analyze hooks if there's a custom one

This commit is contained in:
Michael Rawlings 2022-02-02 22:24:33 -08:00
parent 7efe440f2e
commit 600a1e6f49
4 changed files with 25 additions and 4 deletions

View File

@ -14,10 +14,18 @@ import {
compareReserves,
} from "../../util/sections";
import { isOutputDOM } from "../../util/marko-config";
import analyzeAttributeTags from "../../util/nested-attribute-tags";
import customTag from "../../visitors/tag/custom-tag";
export default {
analyze(tag) {
reserveScope(ReserveType.Visit, getSection(tag), tag.node, "if", 3);
analyze: {
enter(tag) {
reserveScope(ReserveType.Visit, getSection(tag), tag.node, "if", 3);
customTag.analyze.enter(tag);
},
exit(tag) {
analyzeAttributeTags(tag);
},
},
translate: {
enter(tag) {

View File

@ -5,10 +5,18 @@ import * as writer from "../util/writer";
import * as walks from "../util/walks";
import { ReserveType, reserveScope, getSection } from "../util/sections";
import { callRuntime } from "../util/runtime";
import analyzeAttributeTags from "../util/nested-attribute-tags";
import customTag from "../visitors/tag/custom-tag";
export default {
analyze(tag) {
reserveScope(ReserveType.Visit, getSection(tag), tag.node, "for", 3);
analyze: {
enter(tag) {
reserveScope(ReserveType.Visit, getSection(tag), tag.node, "for", 3);
customTag.analyze.enter(tag);
},
exit(tag) {
analyzeAttributeTags(tag);
},
},
translate: {
enter(tag) {

View File

@ -9,6 +9,9 @@ import * as writer from "../util/writer";
import * as walks from "../util/walks";
export default {
analyze() {
// skip default custom tag analysis
},
translate: {
enter(tag) {
walks.enter(tag);

View File

@ -22,6 +22,7 @@ export default {
if (hook) {
hooks.enter(hook, tag);
return;
}
switch (analyzeTagNameType(tag)) {
@ -46,6 +47,7 @@ export default {
if (hook) {
hooks.exit(hook, tag);
return;
}
if (type === TagNameTypes.NativeTag) {