Bug 317165 - [language support] Boolean type assumed for || expression
Summary: [language support] Boolean type assumed for || expression
Status: NEW
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: 3.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: Future   Edit
Assignee: Project Inbox CLA
QA Contact: Chris Jaun CLA
URL:
Whiteboard: operator table needs review
Keywords: plan
Depends on:
Blocks:
 
Reported: 2010-06-17 08:38 EDT by Jacek Pospychala CLA
Modified: 2014-05-29 13:53 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jacek Pospychala CLA 2010-06-17 08:38:32 EDT
for example in:

var hello = "text" || 3;

JSDT Outline shows that hello is a Boolean. It should be "string".

Generally, the argument on the left should be assigned, if it is not undefined or false. Otherwise right argument should be used.

Other typical use is:
var a = a || {};


Similar problem exists for && oper.