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

Method pop

contributed/jsonparser/jsonparser.js:220–229  ·  view source on GitHub ↗
(nodeType)

Source from the content-addressed store, hash-verified

218
219 // Pops the current node if its type matches 'nodeType', invokes 'match', and updates the current node.
220 pop(nodeType) {
221 if (this.node.type !== nodeType)
222 return false;
223 this.doEvent("onMatch");
224 this.node = this.node.prev;
225 // Keeps down node (node.next) for any field with a primitive value, else drops it (provides no value).
226 if (!(this.node.type === NodeType.field && this.node.next.type <= NodeType.string))
227 this.node.next = undefined; // Drops down node (provides no value).
228 return true;
229 }
230
231 // Pushes a new node with the specified type onto the stack and invokes 'setup'.
232 push(nodeType) {

Callers 15

compileDataViewFunction · 0.45
buildMethod · 0.45
launchFunction · 0.45
onCreateMethod · 0.45
deepEqualTestFunction · 0.45
okFunction · 0.45
notOkFunction · 0.45
equalFunction · 0.45
testFunction · 0.45
deepEqualTestFunction · 0.45
okFunction · 0.45
notOkFunction · 0.45

Calls 1

doEventMethod · 0.95

Tested by 2

testFunction · 0.36
testFunction · 0.36