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

Bug 345425

Summary: BrowserFunction overwrites existing JavaScript functions without warning
Product: [Eclipse Project] Platform Reporter: Dean Roberts <dean.t.roberts>
Component: SWTAssignee: Grant Gayed <grant_gayed>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: Silenio_Quarti
Version: 4.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug
Attachments:
Description Flags
Function overwrite example none

Description Dean Roberts CLA 2011-05-11 10:06:48 EDT
Build Identifier: 3.7.0  I20110426-2000

I've attached a Snippet that illustrates this.

Adding a BrowserFunction with a name that collides with an existing function declared in JavaScript MAY overwrite the JavaScript function without warning.

The simple example attached illustrates this.

I believe this will become problematic for web application integrators as they integrate more and more web applications into an Eclipse workbench.  The development tooling gives no indication of name space collisions and the resulting behaviour can be surprising and difficult to debug.

Perhaps an exception can be thrown when a Browser function is instantiated with a naming conflict?

In certain instances, overwriting existing JavaScript functions may be useful to an integrator.  Perhaps a flag when creating instantiating the browser function to determine if overwriting is allowed would be useful.



Reproducible: Always
Comment 1 Dean Roberts CLA 2011-05-11 10:07:37 EDT
Created attachment 195351 [details]
Function overwrite example
Comment 2 Lars Vogel CLA 2019-11-14 02:21:51 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.