[Webkit-unassigned] [Bug 129884] Make Math.imul ES6 conform

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Mar 16 10:12:41 PDT 2014


https://bugs.webkit.org/show_bug.cgi?id=129884





--- Comment #8 from Oliver Hunt <oliver at apple.com>  2014-03-16 10:13:02 PST ---
(From update of attachment 226702)
View in context: https://bugs.webkit.org/attachment.cgi?id=226702&action=review

>> Source/JavaScriptCore/runtime/MathObject.cpp:293
>> +        return JSValue::encode(jsNumber(left));
> 
> When there is an exception, the return value is ignored. So this should just say
> 
>     return JSValue();
> 
> We shouldn’t waste any code computing a value that will be ignored.

No, we should always return a real value - return JSValue() has a tendency to result in a real null entering the vm.  Our normal approach is to return jsUndefined() or jsNull()

>> Source/JavaScriptCore/runtime/MathObject.cpp:296
>> +        return JSValue::encode(jsNumber(right));
> 
> Same issue here. But also, since there is no code execution after this point, there is no reason to do an early exit when an exception occurred. We can just let the product be computed and then the caller will ignore it. So this code should be deleted.

as above don't return JSValue()

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list