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

Method endCheckSwitch

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

Consistency of return statements is checked between the case statements. If there is no default, then the switch can fall through. If there is a default,we check to see if all code paths in the default return or if there is a code path that can fall through. @return logical OR of END_ flags

()

Source from the content-addressed store, hash-verified

709 * @return logical OR of END_* flags
710 */
711 private int endCheckSwitch() {
712 int rv = END_UNREACHED;
713
714 // examine the cases
715 // for (n = first.next; n != null; n = n.next)
716 // {
717 // if (n.type == Token.CASE) {
718 // rv |= ((Jump)n).target.endCheck();
719 // } else
720 // break;
721 // }
722
723 // // we don't care how the cases drop into each other
724 // rv &= ~END_DROPS_OFF;
725
726 // // examine the default
727 // n = ((Jump)this).getDefault();
728 // if (n != null)
729 // rv |= n.endCheck();
730 // else
731 // rv |= END_DROPS_OFF;
732
733 // // remove the switch block
734 // rv |= getIntProp(CONTROL_BLOCK_PROP, END_UNREACHED);
735
736 return rv;
737 }
738
739 /**
740 * If the block has a finally, return consistency is checked in the finally block. If all code

Callers 1

endCheckMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected