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

Bug 360723

Summary: JS can't execute statement isa number
Product: z_Archived Reporter: Kathy Carroll <carrollk>
Component: EDTAssignee: Huang Ji Yong <hjiyong>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P1 CC: greer, hjiyong, svihovec
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
RUI Handler egl source
none
fix
none
Updated fix
none
second test
none
Additional Fix for the new variation lasher: iplog+

Description Kathy Carroll CLA 2011-10-12 16:03:00 EDT
Created attachment 205067 [details]
RUI Handler egl source

I wasn't able to preview or debug into this statement

if (myboolean isa number)
Comment 1 Huang Ji Yong CLA 2011-10-27 01:47:19 EDT
Hi Scott,
The error happens because the generated js for isa Number has runtime error
if (egl.is(myNum, "NUMERIC",egl.isnumeric)) {
this js will call
egl.isnumeric = function(s) {
	if (s == null) return true;
	return (s.length!=0 && s.match(/[^0-9]+/)==null);
};
In which, s is a numeric type and doesn't not have match funtion.

I wonder if we can just remove 
genIsaExpression in NumTypeTemplate and let num type just use the generic method in TypeTemplate.
This method works fine to resolve this problem.

Can you review it?
Thanks
Comment 2 Huang Ji Yong CLA 2011-10-27 01:54:52 EDT
Created attachment 206047 [details]
fix
Comment 3 Huang Ji Yong CLA 2011-11-02 01:18:42 EDT
Created attachment 206308 [details]
Updated fix
Comment 4 Huang Ji Yong CLA 2011-11-02 02:05:32 EDT
The old patch is out of date because Scott has finished some enhancement to Number TypeTemplate
Change the genIsaExpression of NumberTypeTemplate to deal with number type field.
Change runtime to deal with non-string input
Comment 5 Kathy Carroll CLA 2011-11-02 15:01:18 EDT
Value and reference decimal should be able to handle both
   isa decimal
   isa number

Added additional variations in the new attachement
Comment 6 Kathy Carroll CLA 2011-11-02 15:01:47 EDT
Created attachment 206366 [details]
second test
Comment 7 Huang Ji Yong CLA 2011-11-03 03:41:15 EDT
Created attachment 206382 [details]
Additional Fix for the new variation
Comment 8 Huang Ji Yong CLA 2011-11-03 03:43:05 EDT
Add fix to handle the 2 new variations
Comment 9 Kathy Carroll CLA 2011-11-07 07:02:04 EST
Verified with 201111062101 & closed