WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
rebased patch
bug-84650-20120430110353.patch (text/plain), 5.61 KB, created by
Kentaro Hara
on 2012-04-30 11:03:54 PDT
(
hide
)
Description:
rebased patch
Filename:
MIME Type:
Creator:
Kentaro Hara
Created:
2012-04-30 11:03:54 PDT
Size:
5.61 KB
patch
obsolete
>Subversion Revision: 115652 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 401b15904bb26a2d645469f9c5dd811930950c0c..8886010a29b3e47beee1d1079051d2825e440b26 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,24 @@ >+2012-04-23 Kentaro Hara <haraken@chromium.org> >+ >+ FormData.append() should throw TypeError for not enough arguments >+ https://bugs.webkit.org/show_bug.cgi?id=84650 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ FormData.append() should throw TypeError if the number of >+ arguments is less than 2. >+ >+ The spec: >+ http://www.w3.org/TR/WebIDL/#dfn-overload-resolution-algorithm >+ http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#the-append()-method >+ >+ Test: fast/dom/form-data-exceptions.html >+ >+ * bindings/js/JSDOMFormDataCustom.cpp: >+ (WebCore::JSDOMFormData::append): >+ * bindings/v8/custom/V8DOMFormDataCustom.cpp: >+ (WebCore::V8DOMFormData::appendCallback): >+ > 2012-04-30 Kentaro Hara <haraken@chromium.org> > > Unreviewed. Fix test crashes in Win/Linux debug builds. >diff --git a/Source/WebCore/bindings/js/JSDOMFormDataCustom.cpp b/Source/WebCore/bindings/js/JSDOMFormDataCustom.cpp >index 7be93328c2656647d7f1f0e623aba6d250773bb3..19326d9224ec5e630c2f8637c8c2012074b42a48 100644 >--- a/Source/WebCore/bindings/js/JSDOMFormDataCustom.cpp >+++ b/Source/WebCore/bindings/js/JSDOMFormDataCustom.cpp >@@ -59,18 +59,18 @@ EncodedJSValue JSC_HOST_CALL JSDOMFormDataConstructor::constructJSDOMFormData(Ex > > JSValue JSDOMFormData::append(ExecState* exec) > { >- if (exec->argumentCount() >= 2) { >- String name = ustringToString(exec->argument(0).toString(exec)->value(exec)); >- JSValue value = exec->argument(1); >- if (value.inherits(&JSBlob::s_info)) { >- String filename; >- if (exec->argumentCount() >= 3 && !exec->argument(2).isUndefinedOrNull()) >- filename = ustringToString(exec->argument(2).toString(exec)->value(exec)); >- impl()->append(name, toBlob(value), filename); >- } else >- impl()->append(name, ustringToString(value.toString(exec)->value(exec))); >- } >+ if (exec->argumentCount() < 2) >+ return throwVMError(exec, createNotEnoughArgumentsError(exec)); > >+ String name = ustringToString(exec->argument(0).toString(exec)->value(exec)); >+ JSValue value = exec->argument(1); >+ if (value.inherits(&JSBlob::s_info)) { >+ String filename; >+ if (exec->argumentCount() >= 3 && !exec->argument(2).isUndefinedOrNull()) >+ filename = ustringToString(exec->argument(2).toString(exec)->value(exec)); >+ impl()->append(name, toBlob(value), filename); >+ } else >+ impl()->append(name, ustringToString(value.toString(exec)->value(exec))); > return jsUndefined(); > } > >diff --git a/Source/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp b/Source/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp >index a8d077dc5d597b3486c32e9379bb6a54f8ef8c7a..c1d13b567d39c89b3e36e011bd0e7eb46fbe2318 100644 >--- a/Source/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp >+++ b/Source/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp >@@ -65,7 +65,7 @@ v8::Handle<v8::Value> V8DOMFormData::appendCallback(const v8::Arguments& args) > INC_STATS("DOM.FormData.append()"); > > if (args.Length() < 2) >- return throwError("Not enough arguments", V8Proxy::SyntaxError); >+ return V8Proxy::throwNotEnoughArgumentsError(); > > DOMFormData* domFormData = V8DOMFormData::toNative(args.Holder()); > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 14305efcb79322ba77b1736397f0d8911afabe9e..15761e8765357b783ba8829f059fbda9fa272932 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,20 @@ >+2012-04-23 Kentaro Hara <haraken@chromium.org> >+ >+ FormData.append() should throw TypeError for not enough arguments >+ https://bugs.webkit.org/show_bug.cgi?id=84650 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ FormData.append() should throw TypeError if the number of >+ arguments is less than 2. >+ >+ The spec: >+ http://www.w3.org/TR/WebIDL/#dfn-overload-resolution-algorithm >+ http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#the-append()-method >+ >+ * fast/dom/form-data-exceptions-expected.txt: Added. >+ * fast/dom/form-data-exceptions.html: Added. >+ > 2012-04-30 Tommy Widenflycht <tommyw@google.com> > > MediaStream API: Adding a test for the experimental PeerConnection00 >diff --git a/LayoutTests/fast/dom/form-data-exceptions-expected.txt b/LayoutTests/fast/dom/form-data-exceptions-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..fc6e522df44d50f728cb6ed6d5943d5c232fc3dc >--- /dev/null >+++ b/LayoutTests/fast/dom/form-data-exceptions-expected.txt >@@ -0,0 +1,6 @@ >+PASS formData.append() threw exception TypeError: Not enough arguments. >+PASS formData.append("foo") threw exception TypeError: Not enough arguments. >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/fast/dom/form-data-exceptions.html b/LayoutTests/fast/dom/form-data-exceptions.html >new file mode 100644 >index 0000000000000000000000000000000000000000..7324e104565d708fd4506a792455d97be4c9a18e >--- /dev/null >+++ b/LayoutTests/fast/dom/form-data-exceptions.html >@@ -0,0 +1,14 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<script src="../../fast/js/resources/js-test-pre.js"></script> >+</head> >+<body> >+<script> >+var formData = new FormData(); >+shouldThrow('formData.append()'); >+shouldThrow('formData.append("foo")'); >+</script> >+</body> >+<script src="../../fast/js/resources/js-test-post.js"></script> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 84650
:
138459
|
138586
|
138590
|
138604
|
139480
|
139482
|
143259
|
143412