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

Bug 354761

Summary: JS: EString functions need to use EGL's 1 based offsets
Product: z_Archived Reporter: Kathy Carroll <carrollk>
Component: EDTAssignee: Project Inbox <edt.javascriptgen-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: greer
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Kathy Carroll CLA 2011-08-15 14:58:32 EDT
If indexOf doesn't find value, I expect to get 0 not -1.  If the string is at
the start of the string, I expect 1 not 0. lastIndexOf and charCodeAt need to change as well.

Reference defect 354393 against Java Generation
Comment 1 Scott Greer CLA 2011-09-10 14:50:47 EDT
Following Matt's lead with his fixes for 354393, I added/corrected JS RT implementations for indexOf, lastIndexOf, charCodeAt;  I was unable to find existing FVT testcases that cover these, so I unit-tested with a few handcoded tests.
Comment 2 Kathy Carroll CLA 2011-09-12 10:39:58 EDT
Verified with 201109120910
Comment 3 Lisa Lasher CLA 2011-10-11 16:26:54 EDT
Closing this defect.