Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 366533 - return statements inside onclick attributes marked as an error
Summary: return statements inside onclick attributes marked as an error
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: PHP UI CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-13 08:55 EST by Anders Lindén CLA
Modified: 2020-05-14 11:09 EDT (History)
3 users (show)

See Also:


Attachments
disable js validator (863 bytes, text/plain)
2012-06-05 01:52 EDT, Zhongwei Zhao CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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