Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 345425 - BrowserFunction overwrites existing JavaScript functions without warning
Summary: BrowserFunction overwrites existing JavaScript functions without warning
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.1   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Grant Gayed CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-11 10:06 EDT by Dean Roberts CLA
Modified: 2019-11-14 02:21 EST (History)
1 user (show)

See Also:


Attachments
Function overwrite example (2.65 KB, application/octet-stream)
2011-05-11 10:07 EDT, Dean Roberts CLA
no flags Details

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