Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 354761 - JS: EString functions need to use EGL's 1 based offsets
Summary: JS: EString functions need to use EGL's 1 based offsets
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-15 14:58 EDT by Kathy Carroll CLA
Modified: 2017-02-23 14:19 EST (History)
1 user (show)

See Also:


Attachments

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