MCPcopy Create free account
hub / github.com/dchester/jsonpath / parseTryStatement

Function parseTryStatement

jsonpath.js:3169–3190  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3167 }
3168
3169 function parseTryStatement() {
3170 var block, handlers = [], finalizer = null;
3171
3172 expectKeyword('try');
3173
3174 block = parseBlock();
3175
3176 if (matchKeyword('catch')) {
3177 handlers.push(parseCatchClause());
3178 }
3179
3180 if (matchKeyword('finally')) {
3181 lex();
3182 finalizer = parseBlock();
3183 }
3184
3185 if (handlers.length === 0 && !finalizer) {
3186 throwError({}, Messages.NoCatchOrFinally);
3187 }
3188
3189 return delegate.createTryStatement(block, [], handlers, finalizer);
3190 }
3191
3192 // 12.15 The debugger statement
3193

Callers 1

parseStatementFunction · 0.85

Calls 6

expectKeywordFunction · 0.85
parseBlockFunction · 0.85
matchKeywordFunction · 0.85
parseCatchClauseFunction · 0.85
throwErrorFunction · 0.85
lexFunction · 0.70

Tested by

no test coverage detected