(a) No juvenile who has been subjected to an adjudication pursuant to a petition alleging him or her to be delinquent shall be tried later under criminal charges based upon facts alleged in the petition to find him or her delinquent.
(b) No juvenile who has been tried for a violation of the criminal laws of this state shall be later subjected to a delinquency proceeding arising out of the facts that formed the basis of the criminal charges.