Bug 82442

Summary: Consider removal of removes jsNull()/v8::Null() from JSInternalsCustom.cpp/V8InternalsCustom.cpp
Product: WebKit Reporter: Vineet Chaudhary (vineetc) <code.vineet>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: eric.carlson, haraken, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 82319    
Attachments:
Description Flags
proposed patch none

Description Vineet Chaudhary (vineetc) 2012-03-28 02:45:03 PDT
This has comeup with https://bugs.webkit.org/show_bug.cgi?id=82319#c3
We would like to know if it an expected behaviour for Internals.idl to return null when the vector is empty?
Comment 1 Vineet Chaudhary (vineetc) 2012-03-28 03:04:39 PDT
Created attachment 134250 [details]
proposed patch

Attacjing proposed patch. This will test if any test case failures.
Please us know if any objections/suggestions. Thanks.
Comment 2 Kentaro Hara 2012-03-28 03:12:10 PDT
eric.carlson: Would you take a look at the change? (See also https://bugs.webkit.org/show_bug.cgi?id=82319) The behavior when the Vector is empty is not spec-ed, and we guess that we can remove the code that returns null when the Vector is empty.
Comment 3 Kentaro Hara 2012-03-28 03:13:35 PDT
(In reply to comment #1)
> Attacjing proposed patch. This will test if any test case failures.

If no existing tests are affected, maybe we want to add test cases for this.
Comment 4 Vineet Chaudhary (vineetc) 2012-03-28 04:17:18 PDT
(In reply to comment #3)
> (In reply to comment #1)
> > Attaching proposed patch. This will test if any test case failures.
> 
> If no existing tests are affected, maybe we want to add test cases for this.

Currently there is already a test case http://trac.webkit.org/browser/trunk/LayoutTests/fast/harness/user-preferred-language.html?rev=105315#L20  which checks for empty vector but this wont fail even if we remove 

if (languages.isEmpty())
  return jsNull(); 

Because all the platform have the implementation for platformLanguages().
Comment 5 Eric Carlson 2012-03-28 10:14:10 PDT
(In reply to comment #2)
> eric.carlson: Would you take a look at the change? (See also https://bugs.webkit.org/show_bug.cgi?id=82319) The behavior when the Vector is empty is not spec-ed, and we guess that we can remove the code that returns null when the Vector is empty.

This seems like a reasonable change to me.
Comment 6 Vineet Chaudhary (vineetc) 2012-03-28 10:33:47 PDT
(In reply to comment #5)
> (In reply to comment #2)
> > eric.carlson: Would you take a look at the change? (See also https://bugs.webkit.org/show_bug.cgi?id=82319) The behavior when the Vector is empty is not spec-ed, and we guess that we can remove the code that returns null when the Vector is empty.
> 
> This seems like a reasonable change to me.

As per comment #4 the test case covers empty vector case. Do I need to add more coverage for the test?
Comment 7 Kentaro Hara 2012-03-28 15:08:31 PDT
Comment on attachment 134250 [details]
proposed patch

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

> Source/WebCore/ChangeLog:9
> +        No new tests. LayoutTests/fast/harness/user-preferred-language.html should pass
> +        even after these changes.

OK, it would be hard to add a new test case for this change.
Comment 8 WebKit Review Bot 2012-03-28 22:47:34 PDT
Comment on attachment 134250 [details]
proposed patch

Clearing flags on attachment: 134250

Committed r112502: <http://trac.webkit.org/changeset/112502>
Comment 9 WebKit Review Bot 2012-03-28 22:47:39 PDT
All reviewed patches have been landed.  Closing bug.