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

Bug 354738

Summary: EDT code str == null causes JS message egl.egl.lang.EBoolean.fromEBoolean is not a function
Product: z_Archived Reporter: Kathy Carroll <carrollk>
Component: EDTAssignee: Project Inbox <edt.javascriptgen-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Kathy Carroll CLA 2011-08-15 11:19:53 EDT
Functions passed and trace only work when I explicitly defined the parameter type as IN.

Would you expect this line of code to work?
   if(str == null || str == "")
It doesn't like the test for null. This is valid in RBD. Is it valid in EDT?

package handlers;

handler MyHandler type RUIhandler {onConstructionFunction = start, cssFile="css/Alpha.css", title="MyHandler"}
	
	function start()
		SysLib.WriteStdOut("Hello from JavaScript Batch");
		passed("something");
	end	
	
	function passed(str String in)
		SysLib.WriteStdOut("inside passed");
		if( str == "" )
//		if(str == null || str == "")
			SysLib.WriteStdOut("Passed string is empty/null");
		else
			SysLib.WriteStdOut("Passed has contents");
		end
		if (str != "OK") 
			str = str + " OK";
		end
		SysLib.WriteStdOut(str);
		trace(str);
	end
	
	function trace(details string in)
		syslib.writeStdout(details);
	end
end
Comment 1 Kathy Carroll CLA 2011-08-18 11:31:50 EDT
this line of JS

			if (egl.egl.lang.EBoolean.ezeCast((((egl.egl.lang.NullType.equals({eze$$value : str, eze$$signature : "S;"}, null)) || egl.egl.lang.EBoolean.fromEBoolean(((str) == "")))))) {

causes this runtime message

"egl.egl.lang.EBoolean.fromEBoolean is not a function"
Comment 2 Kathy Carroll CLA 2011-09-01 09:48:25 EDT
Indirectly fixed
Comment 3 Kathy Carroll CLA 2011-09-01 09:48:37 EDT
verified
Comment 4 Lisa Lasher CLA 2011-10-11 16:12:31 EDT
Closing this defect.