MCPcopy Create free account
hub / github.com/mozilla/rhino / endCheckTry

Method endCheckTry

rhino/src/main/java/org/mozilla/javascript/Node.java:747–782  ·  view source on GitHub ↗

If the block has a finally, return consistency is checked in the finally block. If all code paths in the finally returns, then the returns in the try-catch blocks don't matter. If there is a code path that does not return or if there is no finally block, the returns of the try and catch blocks are c

()

Source from the content-addressed store, hash-verified

745 * @return logical OR of END_* flags
746 */
747 private int endCheckTry() {
748 int rv = END_UNREACHED;
749
750 // a TryStatement isn't a jump - needs rewriting
751
752 // check the finally if it exists
753 // n = ((Jump)this).getFinally();
754 // if(n != null) {
755 // rv = n.next.first.endCheck();
756 // } else {
757 // rv = END_DROPS_OFF;
758 // }
759
760 // // if the finally block always returns, then none of the returns
761 // // in the try or catch blocks matter
762 // if ((rv & END_DROPS_OFF) != 0) {
763 // rv &= ~END_DROPS_OFF;
764
765 // // examine the try block
766 // rv |= first.endCheck();
767
768 // // check each catch block
769 // n = ((Jump)this).target;
770 // if (n != null)
771 // {
772 // // point to the first catch_scope
773 // for (n = n.next.first; n != null; n = n.next.next)
774 // {
775 // // check the block of user code in the catch_scope
776 // rv |= n.next.first.next.first.endCheck();
777 // }
778 // }
779 // }
780
781 return rv;
782 }
783
784 /**
785 * Return statement in the loop body must be consistent. The default assumption for any kind of

Callers 1

endCheckMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected