Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 360723 - JS can't execute statement isa number
Summary: JS can't execute statement isa number
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P1 normal (vote)
Target Milestone: ---   Edit
Assignee: Huang Ji Yong CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-12 16:03 EDT by Kathy Carroll CLA
Modified: 2017-02-23 14:14 EST (History)
3 users (show)

See Also:


Attachments
RUI Handler egl source (1015 bytes, application/octet-stream)
2011-10-12 16:03 EDT, Kathy Carroll CLA
no flags Details
fix (6.41 KB, patch)
2011-10-27 01:54 EDT, Huang Ji Yong CLA
no flags Details | Diff
Updated fix (2.04 KB, application/octet-stream)
2011-11-02 01:18 EDT, Huang Ji Yong CLA
no flags Details
second test (1.49 KB, application/octet-stream)
2011-11-02 15:01 EDT, Kathy Carroll CLA
no flags Details
Additional Fix for the new variation (6.41 KB, patch)
2011-11-03 03:41 EDT, Huang Ji Yong CLA
lasher: iplog+
Details | Diff

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