Changeset 101717 in webkit


Ignore:
Timestamp:
Dec 1, 2011 3:14:42 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

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

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

Source/WebCore:

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

  • bindings/js/JSDirectoryEntryCustom.cpp:

(WebCore::JSDirectoryEntry::getDirectory): throw TypeError if not enough arguments

  • bindings/v8/custom/V8DirectoryEntryCustom.cpp:

(WebCore::V8DirectoryEntry::getDirectoryCallback): throw TypeError if not enough arguments

LayoutTests:

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

(errorCallback):
(successCallback):

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

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r101713 r101717  
     12011-12-01  Mark Pilgrim  <pilgrim@chromium.org>
     2
     3        [FileSystem API] DirectoryEntry.getDirectory path argument is required
     4        https://bugs.webkit.org/show_bug.cgi?id=69643
     5
     6        Reviewed by Adam Barth.
     7
     8        * fast/filesystem/resources/simple-required-arguments-getdirectory.js: Added.
     9        (errorCallback):
     10        (successCallback):
     11        * fast/filesystem/simple-required-arguments-getdirectory-expected.txt: Added.
     12        * fast/filesystem/simple-required-arguments-getdirectory.html: Added.
     13
    1142011-12-01  Benjamin Poulain  <benjamin@webkit.org>
    215
  • trunk/Source/WebCore/ChangeLog

    r101716 r101717  
     12011-12-01  Mark Pilgrim  <pilgrim@chromium.org>
     2
     3        [FileSystem API] DirectoryEntry.getDirectory path argument is required
     4        https://bugs.webkit.org/show_bug.cgi?id=69643
     5
     6        Reviewed by Adam Barth.
     7
     8        Test: fast/filesystem/simple-required-arguments-getdirectory.html
     9
     10        * bindings/js/JSDirectoryEntryCustom.cpp:
     11        (WebCore::JSDirectoryEntry::getDirectory): throw TypeError if not enough arguments
     12        * bindings/v8/custom/V8DirectoryEntryCustom.cpp:
     13        (WebCore::V8DirectoryEntry::getDirectoryCallback): throw TypeError if not enough arguments
     14
    1152011-12-01  Rafael Weinstein  <rafaelw@chromium.org>
    216
  • trunk/Source/WebCore/bindings/js/JSDirectoryEntryCustom.cpp

    r101606 r101717  
    9797JSValue JSDirectoryEntry::getDirectory(ExecState* exec)
    9898{
     99    if (exec->argumentCount() < 1)
     100        return throwError(exec, createTypeError(exec, "Not enough arguments"));
     101
    99102    DirectoryEntry* imp = static_cast<DirectoryEntry*>(impl());
    100103    const String& path = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(0));
  • trunk/Source/WebCore/bindings/v8/custom/V8DirectoryEntryCustom.cpp

    r101606 r101717  
    5151    INC_STATS("DOM.DirectoryEntry.getDirectory");
    5252    DirectoryEntry* imp = V8DirectoryEntry::toNative(args.Holder());
     53
     54    if (args.Length() < 1)
     55        return throwError("Not enough arguments", V8Proxy::TypeError);
     56
    5357    STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<WithUndefinedOrNullCheck>, path, args[0]);
    5458    if (args.Length() <= 1) {
Note: See TracChangeset for help on using the changeset viewer.