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

Bug 366533

Summary: return statements inside onclick attributes marked as an error
Product: z_Archived Reporter: Anders Lindén <anderslinden>
Component: PDTAssignee: PHP UI <php.ui-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: silviya, wywrzal, zhaozhongwei
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
disable js validator none

Description Anders Lindén CLA 2011-12-13 08:55:21 EST
Build Identifier: 20110916-0149

Lines like:

<button onclick="return on_foo_clicked()">foo</button>

results in an error: Cannot return from outside a function or method

Reproducible: Always

Steps to Reproduce:
1. Create a php file
2. Outside <??>-blocks, write html like the one mentioned
3. Watch error markups
Comment 1 Zhongwei Zhao CLA 2012-06-05 01:52:27 EDT
Created attachment 216808 [details]
disable js validator

I think it is better to add a preference key in preferences page to enable/disable js validator.
Comment 2 Michal Niewrzal CLA 2016-06-08 18:06:43 EDT
With JSDT 2.0 problem is not visible anymore.
Comment 3 Sylvia Tancheva CLA 2016-06-27 08:11:11 EDT
Closing