Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 359205 - New Timestamp generates incorrect javascript
Summary: New Timestamp generates incorrect javascript
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-28 06:50 EDT by Huang Ji Yong CLA
Modified: 2017-02-23 14:18 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 Huang Ji Yong CLA 2011-09-28 06:50:32 EDT
RUIHandler Testcase:
package client;

// RUI Handler

handler testTimeStamp type RUIhandler{initialUI =[ ], onConstructionFunction = start, title = "testTimeStamp"}

   
	myTime TimeStamp = new TimeStamp{};
	myDate Date = new Date{};
    function start()
    	
    end
end

The generation for new TimeStamp{} is 
this.myTime = new Date(egl.eglx.lang.ETimestamp.YEAR_CODE, egl.eglx.lang.ETimestamp.SECOND_CODE);

Where egl.eglx.lang.ETimestamp.YEAR_CODE and egl.eglx.lang.ETimestamp.SECOND_CODE are invalid. Thus, this.myTime is invalid.
Comment 1 Scott Greer CLA 2011-09-28 11:14:17 EDT
Fixed
Comment 2 Huang Ji Yong CLA 2011-10-24 05:50:23 EDT
The test case now has a compile error in this line
myTime TimeStamp = new TimeStamp{};
Comment 3 Scott Greer CLA 2011-10-24 08:40:58 EDT
Ji Yong,

This is not an error, and certainly not an issue with JS gen:  as the compile error says, you cannot instantiate a timestamp this way.  I believe the equivalent is to do this:

   myTime TimeStamp = new date;
Comment 4 Huang Ji Yong CLA 2011-10-24 21:47:21 EDT
Verified in build 201110241434