Bug 159500 - [JSC] Unify how we throw TypeError from C++
Summary: [JSC] Unify how we throw TypeError from C++
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Benjamin Poulain
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-06 18:23 PDT by Benjamin Poulain
Modified: 2016-07-06 20:13 PDT (History)
8 users (show)

See Also:


Attachments
Patch (92.25 KB, patch)
2016-07-06 18:37 PDT, Benjamin Poulain
saam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>