Bug 159500

Summary: [JSC] Unify how we throw TypeError from C++
Product: WebKit Reporter: Benjamin Poulain <benjamin>
Component: New BugsAssignee: Benjamin Poulain <benjamin>
Status: RESOLVED FIXED    
Severity: Normal CC: alecflett, beidson, commit-queue, jsbell, keith_miller, mark.lam, msaboff, saam
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch saam: review+

Description Benjamin Poulain 2016-07-06 18:23:07 PDT
[JSC] Unify how we throw TypeError from C++
Comment 1 Benjamin Poulain 2016-07-06 18:37:39 PDT
Created attachment 282980 [details]
Patch
Comment 2 Saam Barati 2016-07-06 18:59:40 PDT
Comment on attachment 282980 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=282980&action=review

r=me with comments

> Source/JavaScriptCore/ChangeLog:8
> +        Throwing a TypeError is a uncommon case. We should minimize the impact

"a" => "an"

> Source/JavaScriptCore/ChangeLog:17
> +        On x86_64, this reduces the __TEXT__ segment by 29kb.

nice!

> Source/JavaScriptCore/runtime/Error.h:87
> +inline EncodedJSValue throwVMTypeError(ExecState* exec, ASCIILiteral errorMessage) { return JSValue::encode(throwTypeError(exec, errorMessage)); }

It's funny that "...VM..Error" just means that we return an EncodedJSValue. I wish we had a better name

> Source/JavaScriptCore/runtime/JSTypedArrayViewPrototype.cpp:61
> +        return throwVMTypeError(exec, \

Style: This "\" should be aligned with the other "\"
Comment 3 Benjamin Poulain 2016-07-06 20:13:14 PDT
Committed r202890: <http://trac.webkit.org/changeset/202890>