Closed Bug 215321 Opened 22 years ago Closed 22 years ago

instanceof operator fails

Categories

(Core :: JavaScript Engine, defect)

x86
Windows 2000
defect
Not set
major

Tracking

()

VERIFIED INVALID

People

(Reporter: tyoanhyoo, Assigned: khanson)

Details

(Whiteboard: [js1.2])

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Running example code for manual located at http://devedge.netscape.com/library/manuals/2000/javascript/1.4/guide/expr.html#1012225 theDay=new Date(1995, 12, 17) if (theDay instanceof Date) { // statements to execute } produces the error: Error: missing ) after condition Source File: file:///T:/Downloads/expd/table_editor/xbtabledemo.html Line: 26, Column: 11 Source Code: if (theDay instanceof Date) { Reproducible: Always Steps to Reproduce: 1.Place this script in a script tag: theDay=new Date(1995, 12, 17) if (theDay instanceof Date) { // statements to execute } 2. Open html file in Mozilla 1.4 Gecko/20030624 3. Observe error in JavaScript Console Actual Results: Error: missing ) after condition Source File: file:///T:/Downloads/expd/table_editor/xbtabledemo.html Line: 26, Column: 11 Source Code: if (theDay instanceof Date) { Expected Results: evalueated the expression in the if statement - to true. Internal business applications are failing.
Attached file Testcase
The testcase works fine for me, with no errors in the JS Console. Tony: could you try clicking on the testcase and see if it works for you, too? If not, see what happens if you download the latest Mozilla build. I'm using rv 1.5b: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.5b) Gecko/20030806 I think either you had an old build with a bug in it, or there was a typo in the testcase you actually ran. Let me know how the one attached here works, thanks -
Assignee: rogerl → khanson
I found the problem - the instanceof operator was being used in a script tag with its language attribute set to "javascript1.2". The operator works fine when the language attribute is either removed or set to "javascript1.3" or later
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → INVALID
Tony: thanks; marking Verified.
Status: RESOLVED → VERIFIED
Whiteboard: [js1.2]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: