
37 Cal.App.4th 260 (1995)
43 Cal. Rptr. 543
In re ROTTANAK K., a Person Coming Under the Juvenile Court Law.
THE PEOPLE, Plaintiff and Appellant,
v.
ROTTANAK K., Defendant and Respondent.
Docket No. F021807.
Court of Appeals of California, Fifth District.
July 31, 1995.
*263 COUNSEL
Daniel E. Lungren, Attorney General, George Williamson, Chief Assistant Attorney General, Robert R. Anderson, Assistant Attorney General, Ward A. Campbell and George M. Hendrickson, Deputy Attorneys General, for Plaintiff and Appellant.
Margaret A. McKnight, under appointment by the Court of Appeal, for Defendant and Respondent.
OPINION
DIBIASO, Acting P.J.
We hold that the People have a right to appeal an order by the juvenile court sustaining, without leave to amend, a demurrer to an enhancement allegation pled in a petition brought pursuant to Welfare and Institutions Code section 602. We further hold that Penal Code section 12022.1 applies to a minor who has been released from custody, pending a jurisdictional hearing, under a "general release."

PROCEDURAL HISTORY
On February 28, 1994, a subsequent ward petition was filed in Stanislaus County Superior (Juvenile) Court, alleging that Rottanak K., born September *264 4, 1978, came within the provisions of Welfare and Institutions Code[1] section 602 by committing residential robbery (Pen. Code, § 212.5, count I), burglary (Pen. Code, § 459, count II), and vehicle theft (Veh. Code, § 10851, count III), and by violating a condition of probation (count IV). With regard to counts I through III, it was further alleged that Rottanak had previously been convicted of a felony two or more times (Pen. Code, § 1203, subd. (e)(4)), and that when he committed the instant offenses he had been generally released pending a jurisdictional hearing on an earlier felony offense (Pen. Code, § 12022.1). The petition also alleged that previous dispositions and orders had not been effective. Rottanak denied all allegations.[2]
On March 17, 1994, Rottanak filed a demurrer to the Penal Code section 1203, subdivision (e)(4) and 12022.1 allegations. After the public defender's office declared a conflict and new counsel was appointed, Rottanak filed a second demurrer which raised a new challenge to the Penal Code section 12022.1 allegations.[3]
A hearing on the demurrer was held on May 5, 1994. In a written statement of findings and orders filed on May 6, 1994, the juvenile court sustained Rottanak's demurrer without leave to amend as to both special allegations. After a contested jurisdictional hearing, the juvenile court found to be true the allegations contained in counts II through IV, and not to be true the allegation contained in count I.[4] Rottanak was subsequently committed to the California Youth Authority for a maximum term of 128 months.
The People's notice of appeal was filed on June 16, 1994.

DISCUSSION

I. People's Right to Appeal

(1a) The People challenge the juvenile court's ruling which sustained Rottanak's demurrer as to the Penal Code section 12022.1 allegations of the *265 subsequent ward petition.[5] As a threshold matter, we must determine whether the People have the right to a review of the ruling by an appeal to this court. The People say this right is conferred upon them by subdivision (b)(4) of section 800; Rottanak contends the appeal is improper and must be dismissed.
(2) "It is settled that the right of appeal is statutory and that a judgment or order is not appealable unless expressly made so by statute.... The orders, judgments and decrees of a juvenile court which are appealable are restricted to those enumerated in section 800...." (People v. Chi Ko Wong (1976) 18 Cal.3d 698, 709 [135 Cal. Rptr. 392, 557 P.2d 976], citations omitted [disapproved on other grounds in People v. Green (1980) 27 Cal.3d 1, 33-34 (164 Cal. Rptr. 1, 609 P.2d 468)]; People v. Superior Court (Arthur R.) (1988) 199 Cal. App.3d 494, 497 [244 Cal. Rptr. 841].)
Section 800 provides in relevant part:
"(b) An appeal may be taken by the people from any of the following:
"(1) A ruling on a motion to suppress pursuant to Section 700.1 even if the judgment is a dismissal of the petition or any count or counts of the petition. However, no appeal by the people shall lie as to any count which, if the people are successful, will be the basis for further proceedings subjecting any person to double jeopardy.
"(2) An order made after judgment entered pursuant to Section 777 or 785.
"(3) An order modifying the jurisdictional finding by reducing the degree of the offense or modifying the offense to a lesser offense.
"(4) An order or judgment dismissing or otherwise terminating the action before the minor has been placed in jeopardy, or where the minor has waived jeopardy. If, pursuant to this paragraph, the people prosecute an appeal of the decision or any review of that decision, it shall be binding upon the people and they shall be prohibited from refiling the case which was appealed.
"(5) The imposition of an unlawful order at a dispositional hearing, whether or not the court suspends the execution of the disposition.
"(c) Nothing contained in this section shall be construed to authorize an appeal from an order granting probation. Instead, the people may seek *266 appellate review of any grant of probation, whether or not the court imposes disposition, by means of a petition for a writ of mandate or prohibition which is filed within 60 days after probation is granted. The review of any grant of probation shall include review of any order underlying the grant of probation." (Italics added.)[6]
(1b) We believe the first sentence of subdivision (b)(4) of section 800 authorizes the People's appeal in this case.
Rottanak of course takes the position that section 800, subdivision (b)(4) does not apply to orders on demurrers. His argument is primarily based on the fact that this subdivision is virtually identical to subdivision (a)(8) of Penal Code section 1238, and Penal Code section 1238 contains a separate provision pertaining to demurrers.[7] He maintains that the Legislature's failure to include a provision regarding demurrers in section 800, when such a provision is included in Penal Code section 1238, means the Legislature intended to exclude orders or judgments on demurrers from those rulings which the People may appeal in juvenile cases.
*267 As a comparison of the two statutes shows, the provisions of section 800 track the provisions of Penal Code section 1238 to the extent relevant to juvenile law. There is thus some attraction in Rottanak's argument. (3) However, "[t]he fundamental rule is that a court should ascertain the intent of the Legislature so as to effectuate the law's purpose, and in determining intent the court first turns to the words used. [Citation.] [¶] When statutory language is clear and unambiguous, there is no need for construction and courts should not indulge in it. [Citations.]" (People v. Overstreet (1986) 42 Cal.3d 891, 895 [231 Cal. Rptr. 213, 726 P.2d 1288].) (1c) In terms of its scope, section 800, subdivision (b)(4) itself is not ambiguous; it only becomes so  if at all  when measured against the whole of Penal Code section 1238.
Additionally, Rottanak's position is unsupported by the legislative history we have been able to obtain concerning subdivision (b)(4).[8] Subdivisions (b) and (c) were added to section 800 by Senate Bill No. 1137, Statutes 1991, chapter 649, section 1, pages 2616-2617. Prior to this amendment, section 800 permitted the People to appeal only from preadjudication orders granting suppression motions. (People v. Superior Court (Arthur R.), supra, 199 Cal. App.3d at pp. 497-501.) According to the Legislative Counsel's Digest, Senate Bill No. 1137 (as introduced) would have specified "that a judgment in a proceeding adjudging a minor to be a ward of the court on the basis of criminal or noncriminal conduct may be appealed from, by any party, in the same manner as any final judgment, and any subsequent order, may be appealed from, by any party, as from an order after judgment." The stated purpose of the bill, as introduced, was to permit the People to appeal from judgments and postjudgment orders in juvenile court cases. (Sen. Com. on Judiciary, Analysis of Sen. Bill No. 1137 (1991-1992 Reg. Sess.) as introduced.)
Senate Bill No. 1137 was designed to follow the approach of Penal Code section 1238 in dealing with the prosecution's appeal rights in juvenile cases. (Assem. Com. on Pub. Saf., Analysis of Sen. Bill No. 1137 (1991-1992 Reg. Sess.) as introduced.) The bill was seen as necessary by its sponsor (Senator Mello) "because under current law, in numerous instances, the People are left without a remedy to appeal inadequate sentences or erroneous rulings imposed by the juvenile court." (Ibid., italics added.)
Senate Bill No. 1137 was amended during the July 9, 1991, hearing before the Assembly Committee on Public Safety. It was this amendment which *268 added subdivisions (b) and (c) to section 800.[9] Especially when considering subdivision (b)(4), the evolution of the bill's language clearly suggests the Legislature intended to expand the People's right of appeal to cover more than just actual judgments or orders after judgment.
We recognize that materials prepared for the Senate's third reading  which indicate the bill had already passed the Assembly Committee on Public Safety and, hence, must have addressed the bill as amended  state that Senate Bill No. 1137 "expands the rights of the prosecution to appeal from juvenile court proceedings to make them similar to, but more limited than, those the prosecution has in adult cases." (Italics added.) However, we do not view this statement as an indication the Legislature intended that the People would be unable to appeal from orders sustaining demurrers without leave to amend. The overriding purpose of the bill was to afford the People a means to appeal from inadequate sentences imposed by, and erroneous rulings made by, juvenile courts. An erroneous order which has the effect of terminating all prosecution on an allegation would appear to be of equal import as, for example, an order which erroneously reduces the degree of the offense or modifies the offense to a lesser offense. (See § 800, subd. (b)(3).)
Moreover, it would be anomalous for the Legislature to expressly provide for appealability of demurrers in juvenile cases when it has never expressly made demurrers available in such cases.[10] However, at least one appellate court has assumed that a minor has the right to demur to a petition brought under section 602. (See In re Jamil H. (1984) 158 Cal. App.3d 556 [204 Cal. Rptr. 816].) The Legislature is deemed to be aware of existing laws and judicial decisions in effect at the time legislation is enacted, and to have enacted and amended statutes "`"in light of such decisions as have a direct bearing upon them."' [Citations.]" (People v. Overstreet, supra, 42 Cal.3d at p. 897.) (1d) Thus aware of Jamil H. when section 800 was amended in 1991, the Legislature likely felt no need to include a specific provision regarding the appealability of demurrers in juvenile matters, but instead relied upon the broad terms of section 800, subdivision (b)(4) to cover such proceedings.
A comparison of the provisions of section 800, subdivisions (b) and (c) with those of Penal Code section 1238, bears out this view. As previously noted, section 800 corresponds to Penal Code section 1238 to the extent the penal statute can be adapted to juvenile law. However, Penal Code section 1238 contains references to some proceedings which either have no counterpart, or are not expressly provided for, in juvenile law, such as orders setting *269 aside indictments, informations, or complaints; judgments on a demurrer to the indictment, accusation, or information; and the like. Accordingly, section 800 contains no subdivisions addressing the People's right to appeal such procedures. Instead, section 800 contains a catch-all provision  subdivision (b)(4)  which permits the People to appeal from any order or judgment, provided that order or judgment dismisses or terminates all or a part of the action before the minor is placed in jeopardy, or where the minor has waived jeopardy.[11]
A defendant in a criminal case is entitled to the benefit of every reasonable doubt as to the true interpretation of the words or construction of a penal statute. (People v. Overstreet, supra, 42 Cal.3d at p. 896.) Assuming this rule applies in juvenile proceedings, in our estimation there is no reasonable doubt as to the true interpretation of subdivision (b)(4) of section 800. Given the absence of an express statutory authorization for demurrers in juvenile cases, the Legislature's omission from section 800 of a specific provision with respect to rulings on demurrers does not evidence an intent to preclude the People from appealing orders sustaining demurrers without leave to amend in juvenile matters. Accordingly, where, as here, the juvenile court's ruling on a demurrer constitutes "[a]n order or judgment dismissing or otherwise terminating the action before the minor has been placed in jeopardy, or where the minor has waived jeopardy," the People may appeal that ruling pursuant to subdivision (b)(4) of section 800.
Rottanak argues, however, that the question then arises whether the reference in section 800, subdivision (b)(4) to an order or judgment "terminating the action" (italics added) permits the People to appeal where the order in question has the effect of terminating only part of the action. We conclude that it does.
As already discussed, Penal Code section 1238 is the Penal Code counterpart of section 800. Except for the words "defendant" and "minor," subdivision (a)(8) of Penal Code section 1238 is identical to the first sentence of section 800, subdivision (b)(4). In People v. Booker (1994) 21 Cal. App.4th 1517, 1520-1521 [26 Cal. Rptr.2d 715], the court read subdivision (a)(8) of Penal Code section 1238 as if it contained the words "in part" when the challenged ruling by the trial court effectively eliminated a portion, but not all, of the People's case as pled. Booker thus held that subdivision (a)(8) of Penal Code section 1238 permits appeals from orders which dispose of less than all of the allegations of the People's pleading. (21 Cal. App.4th at *270 pp. 1520-1521.) The ruling in issue in Booker was an order by the trial court, made upon a defendant's motion, which reduced to a misdemeanor one of three felony charges against the defendant. The court said that "[a]n order dismissing an information or terminating part of a criminal action before trial is appealable." (Id. at p. 1520, italics added.) The court concluded that "[t]he trial court's decrees that the charged offenses must be prosecuted as misdemeanors were tantamount to dismissal of the felony charge[] ... and ... may be appealed by the People." (Id. at p. 1521.)
A similar case is People v. Orin (1975) 13 Cal.3d 937, 940-942 [120 Cal. Rptr. 65, 533 P.2d 193]. There, the California Supreme Court entertained an appeal, under Penal Code section 1238, subdivision (a)(8), of an order dismissing two counts of a three-count information "in interests of justice" (Pen. Code, § 1385). However, the order was made at the same time the defendant was sentenced, under a plea, to the remaining count. (People v. Orin, supra, 13 Cal.3d at p. 941.)
Comparable results are reflected in several cases which apply Penal Code section 1238, subdivision (a)(1). For example, in People v. Burke (1956) 47 Cal.2d 45 [301 P.2d 241], the Supreme Court held that the People had the right to appeal, pursuant to Penal Code section 1238, subdivisions 1 and 6, from a trial court order, made at sentencing, which struck "`in the interest of justice'" (Pen. Code, § 1385) an allegation that the defendant had suffered a prior conviction. (People v. Burke, supra, 47 Cal.2d at p. 50.)[12] Quoting from Penal Code section 1238, subdivision 1, the Supreme Court viewed the trial court's action as "in substance `an order setting aside [a part of] the ... information.'" (47 Cal.2d at p. 53, bracketed insertion in original.) Similarly, in People v. Jackson (1991) 1 Cal. App.4th 697 [2 Cal. Rptr.2d 308], the Court of Appeal held that the People were entitled to appeal from a "prejeopardy" order by the trial court, made at a pretrial evidentiary hearing, which struck a prior robbery conviction on the ground of inadequate advisement of defendant's constitutional rights. (Id. at p. 701.) Using the words of subdivision (a)(1) of Penal Code section 1238, the court said that the order was "`an order setting aside [part of] the indictment, information, or complaint.'" (1 Cal. App.4th at p. 700-701, bracketed insertion in Jackson; see also In re Rogers (1980) 28 Cal.3d 429, 437-438 [169 Cal. Rptr. 222, 619 P.2d 415] [order striking prior conviction]; People v. Shirley (1978) 78 Cal. App.3d 424, 427-429 [144 Cal. Rptr. 282] [order setting aside one count of two-count indictment].)
*271 We see nothing in the language of section 800, subdivision (b)(4), in the legislative history of that subdivision, or in the juvenile law itself which points to a different result in proceedings under section 602. The practical effect of the juvenile court's order in the instant proceeding was the same as that which followed from the orders involved in Burke, Booker, Jackson, and the other cited cases; it terminated the action against Rottanak insofar as the Penal Code section 12022.1 allegations were concerned.
Last, Rottanak raises jeopardy concerns where, as here, the People appeal following an adjudication under section 602. Significantly, Rottanak does not offer any argument or authority in support of his position, nor does he claim he had been placed in jeopardy on the Penal Code section 12022.1 allegations. Under traditional principles, jeopardy had not attached when the demurrer was ruled upon because no witness had yet been sworn. (See In re Mitchell G. (1990) 226 Cal. App.3d 66, 68 [276 Cal. Rptr. 245].) The fact that the remainder of the allegations of the petition proceeded to a contested hearing, and that jeopardy attached as to those allegations, does not mean Rottanak was in jeopardy as to the Penal Code section 12022.1 allegations. (See Smith v. Superior Court (1970) 5 Cal. App.3d 260, 264 [85 Cal. Rptr. 208] [when, at outset of trial, court and counsel agreed matter was being submitted only as to two counts of multicount information, trial "`entered upon'" and jeopardy attached only as to those two counts].)
The principal rationale for restricting People's appeals (aside from the double jeopardy prohibition) is the possibility of hardship to a defendant by the resultant delay in the proceedings. (People v. Dewberry (1974) 40 Cal. App.3d 175, 183 [114 Cal. Rptr. 815].) The same concern, however, exists in criminal actions where the trial court has ordered the prejeopardy dismissal of a portion of the prosecution's case under subdivision (a)(8) or (a)(1) of Penal Code section 1238. (See, e.g., People v. Jackson, supra, 1 Cal. App.4th at p. 704 [Pen. Code, § 1238, subd. (a)(1); case remanded for trial on reinstated allegation of prior conviction]; People v. Shirley, supra, 78 Cal. App.3d at p. 428 [Pen. Code, § 1238, subd. (a)(1); reversal of order dismissing one count of multicount indictment].) The appellate courts in these opinions have not found the potential for delay to be an impediment to effectuating the People's statutory right to an appeal; indeed, they have not even mentioned the subject. (See People v. Burke, supra, 47 Cal.2d at p. 47; People v. Booker, supra, 21 Cal. App.4th at p. 1520; People v. Jackson, supra, 1 Cal. App.4th 697; People v. Shirley, supra, 78 Cal. App.3d at p. 428.)
In any event, the problem is substantially overcome by the provision in section 800, subdivision (b)(4) which denies the People the right to refile the *272 case if an appeal is taken. (People v. Dewberry, supra, 40 Cal. App.3d at p. 183.)[13] Insofar as the record in this case shows, Rottanak is currently in custody at the California Youth Authority and will be for some time. Thus, we are not faced with a situation in which, for example, a minor who has not been or is no longer in custody would be subjected to additional confinement time if the People were allowed to appeal.
The remaining issue is whether the People may take an appeal under section 800, subdivision (b)(4) directly from the order sustaining the minor's demurrer without leave to amend, or instead must wait to seek review of the order by way of an appeal taken from the disposition order, the "judgment" entered in the case. The question is raised by the presence of the words "order or judgment" in section 800, subdivision (b)(4).[14]
Subdivision (a)(2) of Penal Code section 1238, which addresses appeals from rulings on demurrers, does not contain the word "order." Instead, it permits appeals only from a "judgment for the defendant on a demurrer...." (Italics added.) Based on this specific language, the rule under Penal Code section 1238, subdivision (a)(2) appears to be that the People may not appeal from an order sustaining a demurrer which does not result in the immediate termination of the entire action. (See People v. Superior Court (Elder) (1988) 201 Cal. App.3d 1061, 1065-1066 [247 Cal. Rptr. 647]; People v. Yoshimura (1976) 62 Cal. App.3d 410, 413 [133 Cal. Rptr. 228]; see also People v. Rehman (1964) 62 Cal.2d 135, 137 [41 Cal. Rptr. 457, 396 P.2d 913].) Thus, where a ruling on a demurrer operates as a dismissal of only some of the allegations of the People's pleading, the People's sole remedy is a petition for extraordinary writ relief. (People v. Superior Court (Elder), supra, 201 Cal. App.3d at p. 1066.)
There is no reason to apply these rules to subdivision (b)(4) of section 800, because it includes the word "order." We therefore hold that when the juvenile court sustains a demurrer which results in the elimination of only a portion of the petition, the People may appeal directly from the order constituting the ruling.[15] The cases which have applied Penal Code section 1238, subdivision (a)(1) or (a)(8) to orders which result in partial dismissals *273 of criminal actions either expressly (People v. Burke, supra, 47 Cal.2d at pp. 53-54) or implicitly (People v. Booker, supra, 21 Cal. App.4th at pp. 1520-1521; People v. Jackson, supra, 1 Cal. App.4th at pp. 700-701) affirm the propriety of an appeal directly from the order in issue. The same is true about the other cases we have mentioned. (See In re Rogers, supra, 28 Cal.3d at p. 437; People v. Orin, supra, 13 Cal.3d at p. 951 [order included in judgment disposing of other counts on plea]; People v. Shirley, supra, 78 Cal. App.3d at p. 427.)
In addition, as noted earlier, except in those specific instances enumerated in section 800, the People have no general right of appeal from judgments in juvenile cases. (People v. Superior Court (Arthur R.), supra, 199 Cal. App.3d at p. 501.) Although a reversal of the order on the demurrer may well require a hearing on the dismissed allegations, we see no advantage in deferring the People's right to review until what remains of the action is finally resolved in the juvenile court. In fact, the timing in a particular case may be such as to allow consolidation of the appeal by the People from an order sustaining a demurrer with any other subsequent appeal by the People or by the minor, or permit the hearing on any reinstated allegations to be consolidated with a hearing on the allegations not removed from the case at the outset by the juvenile court's ruling on the demurrer. Barring such circumstances, we know of nothing which prevents a hearing on the dismissed allegations alone on remand. (See People v. Jackson, supra, 1 Cal. App.4th at p. 700 [remand for trial on dismissed prior conviction allegation]; People v. Shirley, supra, 78 Cal. App.3d at p. 428 [reversal of dismissal of one count of multicount indictment].)
For all of the reasons expressed, and because the People filed their notice of appeal within 60 days after the date when the order sustaining the minor's demurrer was made (see Cal. Rules of Court, rule 31(a)), we find that the People's appeal is properly before us. Accordingly, we turn to its merits.

II. Applicability of Penal Code Section 12022.1 to Minor on "General Release"

The juvenile court sustained Rottanak's demurrer to the Penal Code section 12022.1 allegations on the grounds "[t]hat Penal Code Section 12022.1 is not applicable to minors who commit felonies while released on `general release' pending final resolution of an earlier felony charge." The *274 court concluded that Rottanak, "having been generally released, is not one to whom Penal Code Section 12022.1 is applicable."[16]
"Section 12022.1 of the Penal Code increases the period of imprisonment for a felony if the offender committed it while free on bail or his own recognizance (O.R.) pending resolution of earlier felony charges of which he is ultimately found guilty." (In re Jovan B. (1993) 6 Cal.4th 801, 807 [25 Cal. Rptr.2d 428, 863 P.2d 673].)[17] Despite the statute's use exclusively of *275 adult terms of conviction, sentencing, and prison, section 12022.1 applies in the juvenile context. (6 Cal.4th at pp. 808-814.)
In Jovan B., the minor was released pending trial under "`[h]ouse arrest/electronic monitoring.'" (In re Jovan B., supra, 6 Cal.4th at p. 807.) After determining the applicability of Penal Code section 12022.1 to juvenile proceedings, the California Supreme Court stated:
"The Court of Appeal [which held that section 12022.1 does not apply to juveniles] also expressed concern that a juvenile is not entitled to bail, and is never released on his `own' recognizance, as specified in Penal Code section 12022.1, but rather is freed, if at all, to the custody of a parent or guardian. However, we are convinced that for purposes of Welfare and Institutions Code section 726[[18]] and Penal Code section 12022.1, the minor's pretrial `house arrest' release in this case was the functional equivalent of O.R. release in an adult proceeding.
"When the juvenile court is persuaded, pending proceedings under Welfare and Institutions Code section 602, that the youthful subject may flee, presents a danger, or violated a prior order, but has a fit home and does not require `24-hour secure [pretrial] detention,' the court must order or continue his pretrial release `to his parent, guardian, or responsible relative on home supervision.' The order may impose, modify, or extend conditions `on [the] ... minor' (italics added), who must personally sign a written promise to obey. Violation of a condition permits the offender's placement in secure pretrial detention pending further court review. (Welf. & Inst. Code, §§ 628.1, 636.)
"Like adult O.R. release, therefore, a juvenile's conditional `home supervision' release places substantial responsibility, faith, and trust in the released person himself. Though the decision to release a juvenile relies in part on the assumption that parents, guardians, or relatives will monitor his conduct, his defiant commission of a new felony while released on this `special custodial status' is a personal breach of the juvenile court's trust. It is exactly the kind of opportunistic recidivism which warrants enhanced punishment under section Penal Code [sic] 12022.1. We conclude that by committing a new felony while subject to `house arrest' release on an earlier charge, the minor brought himself within the terms of the bail/O.R. enhancement." (In re Jovan B., supra, 6 Cal.4th at pp. 814-815.)
*276 The foregoing is clear. (5a) What is not clear, and the question we now face, is whether a minor who commits a new felony while subject to "general release" on an earlier charge falls within the terms of Penal Code section 12022.1. To resolve this difficult issue, we must determine whether a "general release" is the functional equivalent of an own recognizance (O.R.) release in the adult setting.[19]
For adults accused of violating penal laws, several types of release are possible. When an adult is arrested for an infraction (with the exception of a few specified Vehicle Code violations), the arresting officer requires that the person present a driver's license or other satisfactory evidence of identification and sign a promise to appear. Only if the person refuses to present identification or to sign the promise to appear can he or she be taken into custody. (Pen. Code, § 853.5.) Willful violation of the promise to appear is a misdemeanor. (Pen. Code, § 853.7.)
When an adult is arrested for a misdemeanor and does not demand to be taken before a magistrate, he or she must be released once the arresting officer has prepared a written notice to appear in court and the arrestee has given a written promise to appear as specified in the notice, unless the officer makes special findings. (Pen. Code, § 853.6, subds. (a), (d), (i).) As in the case of infractions, willful violation of the promise to appear is a misdemeanor. (Pen. Code, § 853.7.)
These provisions for release upon the giving of a written promise to appear do "not apply in any case where a person is arrested for an offense declared to be a felony." (Pen. Code, § 853.85.) Persons arrested on felony charges can obtain release in two ways: by posting bail or on O.R.
Penal Code section 1268 et seq. governs admission to bail. We are not concerned with these statutes in the instant case. We are instead concerned with Penal Code section 1270, subdivision (a), which permits a person who has been arrested for or charged with a crime (other than a capital offense) to be released O.R. by a court or magistrate who could release a defendant from custody upon the giving of bail. In this regard, Penal Code section 1318 provides:
"(a) The defendant shall not be released from custody under an own recognizance until the defendant files with the clerk of the court or other person authorized to accept bail a signed release agreement which includes:
*277 "(1) The defendant's promise to appear at all times and places, as ordered by the court or magistrate....
"(2) The defendant's promise to obey all reasonable conditions imposed by the court or magistrate.
"(3) The defendant's promise not to depart this state without leave of the court.
"(4) Agreement by the defendant to waive extradition if the defendant fails to appear as required and is apprehended outside of the State of California.
"(5) The acknowledgment of the defendant that he or she has been informed of the consequences and penalties applicable to violation of the conditions of release."
Where a person has been charged with a misdemeanor and released O.R., willful failure to appear constitutes a misdemeanor. (Pen. Code, § 1320, subd. (a).) Where a person has been charged with a felony and released O.R., willful failure to appear constitutes a felony. (Id., § 1320, subd. (b).)
Under the juvenile system, by comparison, a peace officer can take a minor into custody without a warrant where, inter alia, the officer has reasonable cause to believe the minor is a person described in section 602, i.e., the subject violated a law or a noncurfew ordinance. (§ 625, subd. (a).) If such cause is present, the officer has several options under section 626. He or she can: (1) release the minor outright (§ 626, subd. (a)); (2) deliver or refer the minor to the appropriate agency for shelter care or other services (id., subd. (b)); (3) prepare a written notice to appear before the probation officer and obtain the minor's and/or parent's, guardian's, or relative's written promise to appear, upon the execution of which the minor is to be released (id., subd. (c)); or (4) deliver custody of the minor to the probation officer (id., subd. (d)). If the officer determines the minor needs to be brought to the attention of the juvenile court, the officer has the choice of preparing a written notice to appear before the probation officer and obtaining the minor's and/or parent's, guardian's, or relative's written agreement to appear, whereupon the minor shall be released (§ 626.5, subd. (a)); or delivering custody of the minor to the probation officer (id., subd. (b)). In each instance, "the officer shall prefer the alternative which least restricts the minor's freedom of movement, provided that alternative is compatible with the best interests of the minor and the community." (§§ 626, 626.5.)
If the minor is delivered to the probation officer, section 628 applies. That statute provides in part:
*278 "(a) Upon delivery to the probation officer of a minor who has been taken into temporary custody under the provisions of this article, the probation officer shall immediately investigate the circumstances of the minor and the facts surrounding his being taken into custody and shall immediately release such minor to the custody of his parent, guardian, or responsible relative unless one or more of the following conditions exist:
"(1) The minor is in need of proper and effective parental care or control and has no parent, guardian, or responsible relative; or has no parent, guardian, or responsible relative willing to exercise or capable of exercising such care or control; or has no parent, guardian, or responsible relative actually exercising such care or control.
"(2) The minor is destitute or is not provided with the necessities of life or is not provided with a home....
"(3) The minor is provided with a home which is an unfit place for him....
"(4) Continued detention of the minor is a matter of immediate and urgent necessity for the protection of the minor or reasonable necessity for the protection of the person or property of another.
"(5) The minor is likely to flee the jurisdiction of the court.
"(6) The minor has violated an order of the juvenile court.
"(7) The minor is physically dangerous to the public because of a mental or physical deficiency, disorder or abnormality."
If the minor meets one or more of the criteria for detention under the preceding section, but the probation officer believes that 24-hour secure detention is not necessary to protect the minor or the person or property of another, or to ensure the minor does not flee, the probation officer is required to proceed according to the provisions of section 628.1. This statute provides in part:
"Unless one of the conditions described in paragraph (1), (2), or (3) of subdivision (a) of Section 628 exists, the probation officer shall release such minor to his parent, guardian, or responsible relative on home supervision. As a condition for such release, the probation officer shall require the minor to sign a written promise that he understands and will observe the specific conditions of home supervision release. Such conditions may include curfew *279 and school attendance requirements related to the protection of the minor or the person or property of another, or to the minor's appearances at court hearings.
"A minor who violates a specific condition of home supervision release which he has promised in writing to obey may be taken into custody and placed in secure detention, subject to court review at a detention hearing.
"A minor on home supervision shall be entitled to the same legal protections as a minor in secure detention, including a detention hearing."
As a condition for release, the probation officer may require the minor and/or parent, guardian, or relative to sign a written promise to appear before the probation officer at a specified time. (§ 629.)
At a detention hearing, the court hears evidence. "[U]nless it appears that such minor has violated an order of the juvenile court or has escaped from the commitment of the juvenile court or that it is a matter of immediate and urgent necessity for the protection of such minor or reasonably necessary for the protection of the person or property of another that he be detained or that such minor is likely to flee to avoid the jurisdiction of the court, the court shall make its order releasing such minor from custody." (§ 635.) In making a determination whether to detain the minor, the court may consider, among other factors, the circumstances and gravity of the alleged offense. (Ibid.)
If the court finds it appropriate to detain the minor, the court may order detention in the juvenile hall or other suitable place for up to 15 judicial days. (§ 636.) If the court finds that the criteria of section 628.1 are applicable, it is required to place the minor on home supervision for up to 15 judicial days. "If the court releases the minor on home supervision, the court may continue, modify, or augment any conditions of release previously imposed by the probation officer, or may impose new conditions on a minor released for the first time. If there are new or modified conditions, the minor shall be required to sign a written promise to obey such conditions pursuant to Section 628.1." (§ 636.)
Where a written promise to appear has been executed, willful failure to appear constitutes a misdemeanor. (§ 214.)
It is apparent from our review of the pertinent provisions of the Welfare and Institutions Code that a general release is conditioned upon the execution of a written promise to appear, whereas home supervision may include additional conditions. In our view, the existence of fewer conditions upon a *280 general release is insufficient to remove such a release from the purview of Penal Code section 12022.1.
First, nothing the Supreme Court said in In re Jovan B., supra, 6 Cal.4th 801, precludes a finding that general release is the functional equivalent of O.R. release for purposes of Penal Code section 12022.1. The court in Jovan B. was not concerned with identifying all forms of release which might fall within the provisions of this statute, but instead was analyzing whether section 12022.1 could ever apply in a juvenile case. (In re Jovan B., supra, 6 Cal.4th at pp. 814-815.)
Second, in finding that a home supervision release was the functional equivalent of an O.R. release, the Supreme Court in Jovan B. stressed (as previously quoted) that "... a juvenile's conditional `home supervision' release places substantial responsibility, faith, and trust in the released person himself. Though the decision to release a juvenile relies in part on the assumption that parents, guardians, or relatives will monitor his conduct, his defiant commission of a new felony while released on this `special custodial status' is a personal breach of the juvenile court's trust. It is exactly the kind of opportunistic recidivism which warrants enhanced punishment under [Penal Code section] 12022.1." (In re Jovan B., supra, 6 Cal.4th at p. 815, "personal" italicized in original, remaining italics added.)
The same can be said of a general release. In fact, arguably even more trust is placed in a minor on general release, because the minor is thought not to need the extra impetus to good behavior provided by having specific conditions spelled out, having to agree to obey those conditions in writing, and being threatened with custody upon disobedience. A minor on general release is being implicitly  if not explicitly  trusted by the probation officer or the juvenile court, or both, not to reoffend. If either felt the minor would reoffend, the minor would not be released. While this placing of trust may not be as explicit as where the minor is released on home supervision, it is nonetheless present. As with home supervision, the minor's "defiant commission" of a new felony while released is a personal breach of the trust extended to him or her. (See In re Jovan B., supra, 6 Cal.4th at p. 815.)
Third, in our estimation, "general release" constitutes a "`special custodial status'" within the rationale of Jovan B. A general release is not an unconditional release. Rather, as we have pointed out, it is expressly conditioned upon the giving of a written promise to appear, violation of which constitutes a new offense (§ 214; contrast In re Michael D. (1989) 214 Cal. App.3d 1610, 1615 [264 Cal. Rptr. 476]), and it is implicitly conditioned upon the minor's not reoffending. Although the fact of the minor's constructive custody is not as readily apparent as it is in a situation involving home *281 supervision, a minor on general release nevertheless "is subject to `restraints not shared by the public generally.'" (In re Smiley (1967) 66 Cal.2d 606, 613 [58 Cal. Rptr. 579, 427 P.2d 179].)[20] Moreover, the probation officer or the juvenile court determines the degree of liberty appropriate for the minor. This discretion is also analogous to O.R. release, where the decision lies with the court or magistrate granting such release. (See In re York (1995) 9 Cal.4th 1133, 1145 [40 Cal. Rptr.2d 308, 892 P.2d 804].)
Fourth, we do not view the availability of general release to minors facing felony charges in juvenile court as evidencing a legislative intent that such release be equivalent to the release available to adults arrested for infractions and misdemeanors, to which Penal Code section 12022.1 does not apply. To begin with, an adult charged with a felony cannot be unconditionally released. He or she must post bail or secure an O.R. release. The O.R. release may be conditioned upon compliance with numerous terms, or with few. (See Pen. Code, § 1318; In re York, supra, 9 Cal.4th at p. 1145.) The preadjudication release of a juvenile may also be comparably qualified. Home supervision release is allowed upon compliance with numerous terms (§§ 628.1, 636); a general release is granted upon compliance with few (§§ 628-629, 635).
We also must take into account the special purpose of the Juvenile Court Law (§ 200 et seq.), which "is to provide for the protection and safety of the public and each minor under the jurisdiction of the juvenile court and to preserve and strengthen the minor's family ties whenever possible, removing the minor from the custody of his or her parents only when necessary for his or her welfare or for the safety and protection of the public." (§ 202, subd. (a), italics added.) The Legislature's act in providing for the option of general release for minors facing felony charges is in keeping with this principle.
(6) Finally, "[t]he primary rule of statutory construction is that the courts should attempt to ascertain the intent of the Legislature and construe a statute so as to effectuate its purpose. All other rules of construction are subordinate to this primary principle." (People v. Superior Court (Arthur R.), supra, 199 Cal. App.3d at p. 498.) (5b) We are persuaded that Penal Code section 12022.1 applies because of the overwhelmingly clear goal and intent of the statute, i.e., to penalize recidivist conduct. (People v. McClanahan (1992) 3 Cal.4th 860, 868 [12 Cal. Rptr.2d 719, 838 P.2d 241].) As the California Supreme Court has explained, section 12022.1 "is intended `"`to *282 meet public concern over offenders who are arrested [and] then allowed back on the street a short time later to commit more crimes,'"'" "`"to deter the commission of new felonies by persons released from custody on an earlier felony,"'" and to recognize such an offender's "`"breach of the terms of his special custodial status...."'" (In re Jovan B., supra, 6 Cal.4th at p. 813, quoting People v. McClanahan, supra, 3 Cal.4th at pp. 867-871, italics omitted.) "These concerns apply equally to juvenile and adult offenses." (In re Jovan B., supra, at p. 813.) Arrest on felony charges, followed by release on general release and the subsequent commission of new felonies, is precisely the type of behavior at which section 12022.1 is aimed.
We need not decide whether, for example, Penal Code section 12022.1 would apply to a minor who is released by a peace officer upon execution of a written promise to appear before a probation officer (§ 626, subd. (c)), or whether it only applies when a minor is actually delivered to a probation officer (id., subd. (d)). The question before us is whether, under any circumstances, a general release can be the functional equivalent of an O.R. release and thus fall within the provisions of section 12022.1. We find that such circumstances do exist. Accordingly, Rottanak's demurrer should have been overruled.

DISPOSITION
The order sustaining, without leave to amend, Rottanak's demurrer to the Penal Code section 12022.1 allegation is reversed and the matter is remanded for further proceedings thereon.
Thaxter, J., and Reed, J.,[*] concurred.
Respondent's petition for review by the Supreme Court was denied November 16, 1995.
NOTES
[1]  All statutory references are to the Welfare and Institutions Code unless otherwise indicated.
[2]  The facts underlying the offenses will not be recited as they are not germane to the issues raised on appeal.
[3]  We will treat these pleadings as if a single demurrer had been filed.
[4]  With regard to a prior petition filed on December 14, 1993, the court found to be true allegations of vehicle theft (count I) and violation of probation (count II).
[5]  The People do not take exception to the ruling with regard to the Penal Code section 1203, subdivision (e)(4) allegations.
[6]  As it read at the time of the proceedings which are the subject of this appeal, subdivision (b)(2) of section 800 did not refer to section 785.
[7]  Penal Code section 1238 provides in part:

"(a) An appeal may be taken by the people from any of the following:
"(1) An order setting aside the indictment, information, or complaint.
"(2) A judgment for the defendant on a demurrer to the indictment, accusation, or information.
"(3) An order granting a new trial.
"(4) An order arresting judgment.
"(5) An order made after judgment, affecting the substantial rights of the people.
"(6) An order modifying the verdict or finding by reducing the degree of the offense or the punishment imposed or modifying the offense to a lesser offense.
"(7) An order dismissing a case prior to trial made upon motion of the court pursuant to Section 1385 whenever such order is based upon an order granting defendant's motion to return or suppress property or evidence made at a special hearing as provided in this code.
"(8) An order or judgment dismissing or otherwise terminating the action before the defendant has been placed in jeopardy or where the defendant has waived jeopardy.
"(9) An order denying the motion of the people to reinstate the complaint or a portion thereof pursuant to Section 871.5.
"(10) The imposition of an unlawful sentence, whether or not the court suspends the execution of the sentence....
".... .... .... .... .... .... ....
"(b) If, pursuant to paragraph (8) of subdivision (a), the people prosecute an appeal to decision, or any review of such decision, it shall be binding upon them and they shall be prohibited from refiling the case which was appealed.
".... .... .... .... .... .... ....
"(d) Nothing contained in this section shall be construed to authorize an appeal from an order granting probation. Instead, the people may seek appellate review of any grant of probation, whether or not the court imposes sentence, by means of a petition for a writ of mandate or prohibition which is filed within 60 days after probation is granted. The review of any grant of probation shall include review of any order underlying the grant of probation."
[8]  We may properly look to the legislative history of an enactment, including legislative committee reports and other legislative records, as an aid to ascertaining the Legislature's intent. (See, e.g., Freedom Newspapers, Inc. v. Orange County Employees Retirement System (1993) 6 Cal.4th 821, 828 [25 Cal. Rptr.2d 148, 863 P.2d 218]; People v. Aston (1985) 39 Cal.3d 481, 489 [216 Cal. Rptr. 771, 703 P.2d 111]; People v. Superior Court (Arthur R.), supra, 199 Cal. App.3d at p. 499.)
[9]  As added, those subdivisions were in substantially the same form as the current version.
[10]  The People do not claim, on this appeal, that a juvenile court may not entertain a minor's demurrer, and they did not object on this ground in the juvenile court.
[11]  Subdivision (a)(8) of Penal Code section 1238 is a similar catch-all provision. We need not, and do not, decide whether it could be construed so as to cover orders sustaining demurrers.
[12]  At the time, Penal Code section 1238, subdivision 1 allowed the People to appeal "[f]rom an order setting aside the indictment, information, or complaint." (People v. Burke, supra, 47 Cal.2d at p. 53.) Subdivision 6 of the section provided for an appeal by the People "[f]rom an order modifying the verdict or finding by reducing the degree of the offense or the punishment imposed." (People v. Burke, supra, 47 Cal.2d at p. 53.) See now Penal Code section 1238, subdivision (a)(1), (6).
[13]  The discussion in Dewberry concerned Penal Code section 1238, subdivision (a)(8) and the refiling bar contained in subdivision (b) of that statute. However, it is equally relevant to subdivision (b)(4) of section 800.
[14]  We note that the People's notice of appeal in the instant matter was timely filed in either event.
[15]  Of course, if the juvenile court's ruling on a minor's demurrer has the effect of terminating the People's entire case, then the People may appeal from the subsequent dismissal, which operates as a judgment. (See People v. Rehman, supra, 62 Cal.2d at p. 138; People v. Superior Court (Elder), supra, 201 Cal. App.3d at p. 1066.)
[16]  The subsequent ward petition alleged in pertinent part: "At the commission of said offense, minor did [sic] RATTANAK [sic] [K.], had been generally released on pending Jurisdictional hearing on an earlier felony offense ..., in violation of Section 12022.1." Penal Code section 1004, subdivision 4 permits a defendant to demur to the accusatory pleading when it appears on the face thereof that, inter alia, the facts stated do not constitute a public offense. (See also Code Civ. Proc., § 430.10, subd. (e).) The People correctly interpret the juvenile court's ruling, which sustained the demurrer without leave to amend, as constituting a determination that as a matter of law, there are no circumstances under which section 12022.1 can apply to a minor on "general release."
[17]  Penal Code section 12022.1 provides:

"(a) For the purposes of this section only:
"(1) `Primary offense' means a felony offense for which a person has been released from custody on bail or on his or her own recognizance prior to the judgment becoming final, including the disposition of any appeal, or for which release on bail or his or her own recognizance has been revoked.
"(2) `Secondary offense' means a felony offense alleged to have been committed while the person is released from custody for a primary offense.
"(b) Any person arrested for a secondary offense which was alleged to have been committed while that person was released from custody on a primary offense shall be subject to a penalty enhancement of an additional two years in state prison which shall be served consecutive to any other term imposed by the court.
"(c) The enhancement allegation provided in subdivision (b) shall be pleaded in the information or indictment which alleges the secondary offense and shall be proved as provided by law. The enhancement allegation may be pleaded in a complaint but need not be proved at the preliminary hearing for the secondary offense.
"(d) Whenever there is a conviction for the secondary offense and the enhancement is proved, and the person is sentenced on the secondary offense prior to the conviction of the primary offense, the imposition of the enhancement shall be stayed pending imposition of the sentence for the primary offense. The stay shall be lifted by the court hearing the primary offense at the time of sentencing for that offense and shall be recorded in the abstract of judgment. If the person is acquitted of the primary offense the stay shall be permanent.
"(e) If the person is convicted of a felony for the primary offense, is sentenced to state prison for the primary offense, and is convicted of a felony for the secondary offense, any state prison sentence for the secondary offense shall be consecutive to the primary sentence.
"(f) If the person is convicted of a felony for the primary offense, is granted probation for the primary offense, and is convicted of a felony for the secondary offense, any state prison sentence for the secondary offense shall be enhanced as provided in subdivision (b).
"(g) If the primary offense conviction is reversed on appeal, the enhancement shall be suspended pending retrial of that felony. Upon retrial and reconviction, the enhancement shall be reimposed. If the person is no longer in custody for the secondary offense upon reconviction of the primary offense, the court may, at its discretion, reimpose the enhancement and order him or her recommitted to custody." (Italics added.)
[18]  In part, section 726 specifies that when a minor is removed from the physical custody of his or her parent or guardian as the result of an order of wardship made pursuant to section 602, "the minor may not be held in physical confinement for a period in excess of the maximum term of imprisonment which could be imposed upon an adult convicted of the" same offense(s). The section also specifies how the "maximum term of imprisonment" is to be calculated.
[19]  "It is well settled that a demurrer raises an issue of law as to the sufficiency of the accusatory pleading, and it tests only those defects appearing on the face of that pleading." (People v. Williams (1979) 97 Cal. App.3d 382, 387-388 [158 Cal. Rptr. 778].) Accordingly, because this issue arises in the context of a ruling on a demurrer, we do not consider Rottanak's specific procedural history.
[20]  Smiley holds that an adult released on his or her own recognizance is under constructive custody. (In re Smiley, supra, 66 Cal.2d at p. 613.)
[*]   Judge of the Tulare Municipal Court, Visalia Division, sitting under assignment by the Chairperson of the Judicial Council.
