Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 358994 - Runtime error when accessing Record field by string literal
Summary: Runtime error when accessing Record field by string literal
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: Scott Greer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-26 23:04 EDT by Huang Ji Yong CLA
Modified: 2017-02-23 14:15 EST (History)
0 users

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-26 23:04:55 EDT
Steps to recreate:
1. Create a new RUI Handler.
2. Copy the source below
handler testRecordField type RUIhandler{initialUI =[], onConstructionFunction = start, cssFile = "css/testBugs.css", title = "testRecordField"}

    function start()    	
		rec myRec1 { field1 = "Row 1, Column 1", field2 = "Row 1, Column 2"};
		syslib.writestdout(rec["field1"]);
    end
end

Record myRec1
	field1 String;
	field2 String;
end

3. Run in VE, open in external browser. The following error occurs
Could not render UI
TypeError: Object [type=client.myRec1] has no method 'ezeGet' at [object Object].start (testRecordField.js:56:51) at new (testRecordField.js:6:9) at [object Object].eze$$thisClass (egl.js:800:27) at testRecordField.html?contextKey=55:75:22 at Function.eze$$loadScripts (testRecordField.html?contextKey=55:51:3) at testRecordField.html?contextKey=55:49:43 at HTMLScriptElement. (testRecordField.html?contextKey=55:37:4)

Object [type=client.myRec1] has no method 'ezeGet'
[CRRUI2094E] Here are the EGL function calls leading to this error:

    myRec1.<init>() [native JavaScript]
    client/testRecordField.egl() at line 14
    testRecordField.<init>() [native JavaScript]

Uncaught TypeError: Object [type=client.myRec1] has no method 'ezeGet'
testBugs/client/testRecordField.html?contextKey=55:90
[CRRUI2095E] Could not find the EGL function calls leading to this error

The error happens in line 56 of the handler generated js file:
eze$Temp1 = egl.eglx.lang.EString.ezeCast(rec.ezeGet("field1")); // ezeGet is not defined
Comment 1 Scott Greer CLA 2011-09-28 11:36:38 EDT
Fixed.
Comment 2 Huang Ji Yong CLA 2011-10-20 23:21:48 EDT
Verified in 201110202102