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

Bug 358329

Summary: JS: Support overloaded system library functions
Product: z_Archived Reporter: Scott Greer <greer>
Component: EDTAssignee: Project Inbox <edt.javascriptgen-inbox>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 357992, 358029    

Description Scott Greer CLA 2011-09-20 22:55:11 EDT
This is to essentially replicate RBD's handling of overloaded functions such as String.clip, for which there are two variants.    Rather than implement general-purpose support for function overloading, RBD's JS gen simply special cases these parts and these functions.  

There are a number of bugs emerging which require this support.
Comment 1 Scott Greer CLA 2011-09-20 22:57:58 EDT
See SystemFunctionInvocationGenerator.java for RBD's implementation....
Comment 2 Scott Greer CLA 2011-09-28 18:34:34 EDT
I have an implementation which I will commit now so that the system functions will work in JS gen, however, see this bug for the details of the eventual solution:  https://bugs.eclipse.org/bugs/show_bug.cgi?id=359315
Comment 3 Scott Greer CLA 2011-09-29 11:55:29 EDT
Fixed by implementing the following:
1.  Use existing function "aliasing" logic to handle the generation of declarations and invocations for overloaded functions
2.  Detect whether a function is overloaded by scanning a part for like-named functions.
3.  Compute a "mangled" alias for the function name that factors in the type and number of args.
Comment 4 Lisa Lasher CLA 2011-11-04 11:45:43 EDT
Closing this work item