Changeset 101606 in webkit


Ignore:
Timestamp:
Nov 30, 2011 9:44:30 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[FileSystem API] DirectoryEntry.getFile path argument is required
https://bugs.webkit.org/show_bug.cgi?id=69642

Patch by Mark Pilgrim <pilgrim@chromium.org> on 2011-11-30
Reviewed by Adam Barth.

Source/WebCore:

Test: fast/filesystem/simple-required-arguments-getfile.html

  • bindings/js/JSDirectoryEntryCustom.cpp:

(WebCore::JSDirectoryEntry::getFile): check args length and throw TypeError if not enough arguments

  • bindings/v8/custom/V8DirectoryEntryCustom.cpp:

(WebCore::V8DirectoryEntry::getFileCallback): check args length and throw TypeError if not enough arguments

LayoutTests:

  • fast/filesystem/resources/simple-required-arguments-getfile.js: Added.

(errorCallback):
(successCallback):

  • fast/filesystem/simple-required-arguments-getfile-expected.txt: Added.
  • fast/filesystem/simple-required-arguments-getfile.html: Added.
Location:
trunk
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r101605 r101606  
     12011-11-30  Mark Pilgrim  <pilgrim@chromium.org>
     2
     3        [FileSystem API] DirectoryEntry.getFile path argument is required
     4        https://bugs.webkit.org/show_bug.cgi?id=69642
     5
     6        Reviewed by Adam Barth.
     7
     8        * fast/filesystem/resources/simple-required-arguments-getfile.js: Added.
     9        (errorCallback):
     10        (successCallback):
     11        * fast/filesystem/simple-required-arguments-getfile-expected.txt: Added.
     12        * fast/filesystem/simple-required-arguments-getfile.html: Added.
     13
    1142011-11-30  Rafael Weinstein  <rafaelw@chromium.org>
    215
  • trunk/Source/WebCore/ChangeLog

    r101602 r101606  
     12011-11-30  Mark Pilgrim  <pilgrim@chromium.org>
     2
     3        [FileSystem API] DirectoryEntry.getFile path argument is required
     4        https://bugs.webkit.org/show_bug.cgi?id=69642
     5
     6        Reviewed by Adam Barth.
     7
     8        Test: fast/filesystem/simple-required-arguments-getfile.html
     9
     10        * bindings/js/JSDirectoryEntryCustom.cpp:
     11        (WebCore::JSDirectoryEntry::getFile): check args length and throw TypeError if not enough arguments
     12        * bindings/v8/custom/V8DirectoryEntryCustom.cpp:
     13        (WebCore::V8DirectoryEntry::getFileCallback): check args length and throw TypeError if not enough arguments
     14
    1152011-11-30  Joshua Bell  <jsbell@chromium.org>
    216
  • trunk/Source/WebCore/bindings/js/JSDirectoryEntryCustom.cpp

    r95901 r101606  
    4848JSValue JSDirectoryEntry::getFile(ExecState* exec)
    4949{
     50    if (exec->argumentCount() < 1)
     51        return throwError(exec, createTypeError(exec, "Not enough arguments"));
     52
    5053    DirectoryEntry* imp = static_cast<DirectoryEntry*>(impl());
    5154    const String& path = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(0));
  • trunk/Source/WebCore/bindings/v8/custom/V8DirectoryEntryCustom.cpp

    r95901 r101606  
    9494    INC_STATS("DOM.DirectoryEntry.getFile");
    9595    DirectoryEntry* imp = V8DirectoryEntry::toNative(args.Holder());
     96
     97    if (args.Length() < 1)
     98        return throwError("Not enough arguments", V8Proxy::TypeError);
     99
    96100    STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<WithUndefinedOrNullCheck>, path, args[0]);
    97101    if (args.Length() <= 1) {
Note: See TracChangeset for help on using the changeset viewer.