Consider removal of removes jsNull()/v8::Null() from JSInternalsCustom.cpp/V8Internal...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Mar 2012 05:47:18 +0000 (05:47 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Mar 2012 05:47:18 +0000 (05:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=82442

Patch by Vineet Chaudhary <rgf748@motorola.com> on 2012-03-28
Reviewed by Kentaro Hara.

No new tests. LayoutTests/fast/harness/user-preferred-language.html should pass
even after these changes.

* testing/js/JSInternalsCustom.cpp: Remove jsNull() if Vector is empty.
(WebCore::JSInternals::userPreferredLanguages):
* testing/v8/V8InternalsCustom.cpp: Remove v8::Null() if Vector is empty.
(WebCore::V8Internals::userPreferredLanguagesAccessorGetter):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@112502 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/testing/js/JSInternalsCustom.cpp
Source/WebCore/testing/v8/V8InternalsCustom.cpp

index aae986e..95bdeb2 100644 (file)
@@ -1,3 +1,18 @@
+2012-03-28  Vineet Chaudhary  <rgf748@motorola.com>
+
+        Consider removal of removes jsNull()/v8::Null() from JSInternalsCustom.cpp/V8InternalsCustom.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=82442
+
+        Reviewed by Kentaro Hara.
+
+        No new tests. LayoutTests/fast/harness/user-preferred-language.html should pass
+        even after these changes.
+
+        * testing/js/JSInternalsCustom.cpp: Remove jsNull() if Vector is empty.
+        (WebCore::JSInternals::userPreferredLanguages):
+        * testing/v8/V8InternalsCustom.cpp: Remove v8::Null() if Vector is empty.
+        (WebCore::V8Internals::userPreferredLanguagesAccessorGetter):
+
 2012-03-28  Hayato Ito  <hayato@chromium.org>
 
         Let focus navigation be compliant with Shadow DOM spec.
index 0002319..93f9307 100644 (file)
@@ -36,8 +36,6 @@ JSValue JSInternals::userPreferredLanguages(ExecState* exec) const
 {
     Internals* imp = static_cast<Internals*>(impl());
     const Vector<String> languages = imp->userPreferredLanguages();
-    if (languages.isEmpty())
-        return jsNull();
     
     MarkedArgumentBuffer array;
     Vector<String>::const_iterator end = languages.end();
index b6147b5..f704541 100644 (file)
@@ -35,8 +35,6 @@ v8::Handle<v8::Value> V8Internals::userPreferredLanguagesAccessorGetter(v8::Loca
 {
     Internals* internals = V8Internals::toNative(info.Holder());
     const Vector<String> languages = internals->userPreferredLanguages();
-    if (languages.isEmpty())
-        return v8::Null();
 
     v8::Local<v8::Array> array = v8::Array::New(languages.size());
     Vector<String>::const_iterator end = languages.end();