Fix v8 code generator for not being able to allow undefined and null values on optional function arguments. This is largely as reported in https://codereview.chromium.org/152413005/patch/1/10004, however in that change list the distinction between null and undefined make it still no compatible with WebCL's conformance tests, where optional arguments (WebCLEvent arrays) can be either null or undefined.

The fix in the above URL also does not address the issue where undefined values cannot be converted into empty arrays. Without this ability, undefined or null cannot be accepted as valid input for optional array arguments, instead [] must be used. This obviously is a problem. We fix it by returning empty arrays for undefined.