| Summary: | NullValueException is not thrown when returning a null value from a non-nullable return of type Any | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Brian Svihovec <svihovec> |
| Component: | EDT | Assignee: | Project Inbox <edt.javascriptgen-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | hjiyong, jeffdouglas, jinfahua, mheitz, pharmon, tww |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows NT | ||
| Whiteboard: | |||
| Bug Depends on: | 368733 | ||
| Bug Blocks: | |||
|
Description
Brian Svihovec
Defer from 0.8I1 because of vacation Change the return type of getData() to any? will work. It seems the problem now is that the return type is not validated. Since the return type of getData is non-nullable, we should not allow return a null type. I disagree with that assessment. The problem is not in the preventing of a null return value, but instead of the usage of that return value itself. The JS generated code is missing a call to egl.checkNull around the function invocation. It should look like this: egl.eglx.lang.SysLib.writeStdout(egl.eglx.lang.EString.ezeCast(egl.checkNull(this.getData()), false)); instead of this original: egl.eglx.lang.SysLib.writeStdout(egl.eglx.lang.EString.ezeCast(this.getData(), false)); The javagen logic has numerous places in the generator that wraps the checkNullable method call around various expressions. JavaScript gen needs to implement those missing ones as well. fixed |