Closed Bug 175259 Opened 23 years ago Closed 23 years ago

Problem with linked JavaScript when using "private" input element

Categories

(Core :: JavaScript Engine, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

VERIFIED INVALID

People

(Reporter: mkliska, Assigned: rogerl)

Details

I have a form that has an input element with type="text" and name="private". I'm linking JavaScript file that a couple of functions, some of which are inserting data into the form with the following syntax: <formname>.title.value = "title"; <formname>.private.value = "N"; Any call to the functions from the linked JavaScript file fails, but no error is displayed. When I comment out the line where I'm assigning value to the "private" input element, everything works fine. If I rename the "private" element to "isprivate", everything works fine. I have checked the html page using W3C's HTML validator and the page is OK. My conclusion is that the JavaScript engine doesn't like the use of the "private" for the form elements, and maybe for some other things.
"private" is a reserved keyword in Javascript. If you need to use this syntax, use <formname>['private']. (See the JS console for the error message).
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → INVALID
Marking Verified. Thank you for this report, but Boris is correct. See http://www.mozilla.org/js/language for a link to the ECMA-262 Edition 3 spec for the JavaScript language. Section 7.5.3 indicates that "private" is a "Future Reserved Word", and thus may not be used as an identifier -
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.