Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 317165

Summary: [language support] Boolean type assumed for || expression
Product: [WebTools] JSDT Reporter: Jacek Pospychala <jacek.pospychala>
Component: GeneralAssignee: Project Inbox <jsdt.javascript-inbox>
Status: NEW --- QA Contact: Chris Jaun <cmjaun>
Severity: normal    
Priority: P3 Keywords: plan
Version: 3.2   
Target Milestone: Future   
Hardware: PC   
OS: Linux   
Whiteboard: operator table needs review

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.