MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / onStartElement

Method onStartElement

tools/xsbug-log/xsbug-machine.js:64–110  ·  view source on GitHub ↗
(name, attributes)

Source from the content-addressed store, hash-verified

62 }
63
64 onStartElement(name, attributes) {
65 const parent = this.current;
66 const current = attributes;
67 switch (name) {
68 case 'xsbug':
69 break;
70 case 'breakpoint':
71 case 'instrument':
72 case 'file':
73 case 'frame':
74 parent.children.push(current);
75 current.parent = parent;
76 break;
77 case 'node':
78 case 'property':
79 parent.children.push(current);
80 current.parent = parent;
81 current.children = [];
82 break;
83
84 case 'break':
85 case 'bubble':
86 case 'eval':
87 case 'log':
88 case 'ps':
89 case 'samples':
90 current.data = "";
91 break;
92
93 case 'result':
94 current.children = [];
95 current.data = "";
96 break;
97
98 case 'breakpoints':
99 case 'instruments':
100 case 'files':
101 case 'frames':
102 case 'global':
103 case 'grammar':
104 case 'local':
105 current.children = [];
106 break;
107
108 }
109 this.current = current;
110 }
111 onEndElement(name) {
112 const current = this.current;
113 this.current = null;

Callers 1

constructorMethod · 0.95

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected