Bug 131186 - Web Inspector: JSContext inspection provide a way to opt-out of including Native Call Stacks in Exception traces reported to Web Inspector
Summary: Web Inspector: JSContext inspection provide a way to opt-out of including Nat...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-04-03 15:46 PDT by Joseph Pecoraro
Modified: 2015-11-20 13:14 PST (History)
8 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (8.62 KB, patch)
2014-04-03 15:50 PDT, Joseph Pecoraro
ggaren: review+
ggaren: commit-queue-
Details | Formatted Diff | Diff
[PATCH] For Landing (8.65 KB, patch)
2014-04-03 17:19 PDT, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2014-04-03 15:46:42 PDT
By default JSContext Inspection includes the native call stack above the JSC API boundary when there is a JavaScript exception in the context.

For example:

    @implementation Foo
    - (void)bar {
        JSContext *context = [[JSContext alloc] init];
        [context evaluateScript:@"var a=;"]; // Throws an exception.
    }
    @end

A JSContext inspector will see the JS exception stack "(anonymous function)" and the "-[JSContext evaluateScript], -[Foo bar], ..." call frames.

Some clients, may not want that. Provide SPI to turn off this behavior, so that only the JS exception stack will be visible.

<rdar://problem/16507210>
Comment 1 Joseph Pecoraro 2014-04-03 15:50:10 PDT
Created attachment 228552 [details]
[PATCH] Proposed Fix
Comment 2 WebKit Commit Bot 2014-04-03 15:52:17 PDT
Attachment 228552 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/API/JSContextPrivate.h:45:  Missing spaces around =  [whitespace/operators] [4]
Total errors found: 1 in 7 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Geoffrey Garen 2014-04-03 16:28:52 PDT
Comment on attachment 228552 [details]
[PATCH] Proposed Fix

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

r=me

> Source/JavaScriptCore/API/JSContextPrivate.h:46
> +@property
> +@discussion Set whether or not the native call stack is included when reporting exceptions. Default value is YES.
> +*/
> +@property (setter=_setIncludeNativeCallStackWhenReportingExceptions:) BOOL _includeNativeCallStackWhenReportingExceptions NS_AVAILABLE(10_10, 8_0);
> +

I think the preferred terminology when it comes to verbs is the infinitive: "setIncludes" instead of "setInclude".

c.f.

– autosaves
– setAutosaves:

– setSuppressesIncrementalRendering:
– suppressesIncrementalRendering
Comment 4 Joseph Pecoraro 2014-04-03 17:19:32 PDT
Created attachment 228563 [details]
[PATCH] For Landing
Comment 5 WebKit Commit Bot 2014-04-03 17:20:25 PDT
Attachment 228563 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/API/JSContextPrivate.h:45:  Missing spaces around =  [whitespace/operators] [4]
Total errors found: 1 in 7 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 WebKit Commit Bot 2014-04-03 17:51:19 PDT
Comment on attachment 228563 [details]
[PATCH] For Landing

Clearing flags on attachment: 228563

Committed r166756: <http://trac.webkit.org/changeset/166756>