The default bug view has changed. See this FAQ.

Narcissus - invalid evaluation of nested ternaries

NEW
Unassigned

Status

Other Applications
Narcissus
8 years ago
7 months ago

People

(Reporter: crisp, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

8 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729)
Build Identifier: 

a?b?c:d:e; is actually evaluated as a?b:c?d:e;

Reproducible: Always




This bug was introduced by the fix in https://bugzilla.mozilla.org/show_bug.cgi?id=401405 but it goes back to https://bugzilla.mozilla.org/show_bug.cgi?id=330975

I'm not sure what the status of Narcissus is, but it is used in derivate works in which this should be a blocking issue
(Reporter)

Comment 1

8 years ago
Created attachment 376810 [details] [diff] [review]
Patch to jsparse.js

Proposed patch
crisp, could you attach a unified diff (preferred arguments are -pU8)? Also, a testcase would be great, too. Tentatively confirming this, pending the testcase.
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Reporter)

Comment 3

8 years ago
testcase:

var b = true, c = false;
var a = b ? c ? 1 : 2 : 3;
alert(a);

should alert '2', but alerts 'false'
(Reporter)

Comment 4

8 years ago
Created attachment 376819 [details] [diff] [review]
Proposed patch (unified diff)
Attachment #376810 - Attachment is obsolete: true
(Assignee)

Updated

3 years ago
Assignee: general → nobody
Component: JavaScript Engine → Narcissus
Product: Core → Other Applications
You need to log in before you can comment on or make changes to this bug.