Bug 22460 - Calls to console.trace() ASSERT due to JSFunction's incomplete inheritance chain
Summary: Calls to console.trace() ASSERT due to JSFunction's incomplete inheritance chain
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-24 12:01 PST by Dimitri Glazkov (Google)
Modified: 2008-12-02 12:45 PST (History)
1 user (show)

See Also:


Attachments
Add InternalFunction as JSFunction's parent class (1.14 KB, patch)
2008-11-24 12:02 PST, Dimitri Glazkov (Google)
eric: review-
Details | Formatted Diff | Diff
Fix inheritance chain v2 (3.11 KB, patch)
2008-11-26 13:44 PST, Dimitri Glazkov (Google)
eric: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitri Glazkov (Google) 2008-11-24 12:01:00 PST
The issue occurs because JSFunction instance's prototype chain is walked to see if it is an InternalFunction (and it turns out it's not!) in JSCell::isObject.

The fix is to add the InternalFunctio::info as a parent in JSFunction::info.
Comment 1 Dimitri Glazkov (Google) 2008-11-24 12:02:24 PST
Created attachment 25439 [details]
Add InternalFunction as JSFunction's parent class

run-javascriptcore-tests passes with no changes.
Comment 2 Eric Seidel (no email) 2008-11-25 18:00:40 PST
Comment on attachment 25439 [details]
Add InternalFunction as JSFunction's parent class

Looks fine, but should have a test case.  Is there no way to make a test case?  Does console.trace() make no sense from within DRT?  If there is no reasonable way to make a test case, you can consider this an r+.
Comment 3 Dimitri Glazkov (Google) 2008-11-26 13:44:01 PST
Created attachment 25530 [details]
Fix inheritance chain v2

Now with a layout test. No MSG. Still "Mmm, good".
Comment 4 Eric Seidel (no email) 2008-11-26 14:50:43 PST
Comment on attachment 25530 [details]
Fix inheritance chain v2

Looks good.  I'm a little confused by this sentence:

 19     <p>Tests for absence of ASSERT in console.trace() due to incomplete inheritance chain.</p>

But it's fine as-is.
Comment 5 Eric Seidel (no email) 2008-12-02 12:45:47 PST
Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	JavaScriptCore/ChangeLog
	M	JavaScriptCore/runtime/JSFunction.cpp
	M	LayoutTests/ChangeLog
	A	LayoutTests/fast/dom/Window/console-trace-expected.txt
	A	LayoutTests/fast/dom/Window/console-trace.html
Committed r38913