mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
fix: don't run the default analyze hooks if there's a custom one
This commit is contained in:
parent
7efe440f2e
commit
600a1e6f49
@ -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) {
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user