Changeset 61390 in webkit
- Timestamp:
- Jun 18, 2010 2:31:34 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r61387 r61390 1 2010-06-18 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Darin Adler. 4 5 Remove unneeded custom code for WebSocket.send 6 https://bugs.webkit.org/show_bug.cgi?id=38180 7 8 Test what happens when you pass an object to WebSocket.send that throws 9 when you convert it to a string. 10 11 * websocket/tests/script-tests/send-throw.js: Added. 12 (endTest): 13 (FIRST_MESSAGE_TO_SEND.toString): 14 (ws.onopen): 15 (ws.onclose): 16 (timeOutCallback): 17 * websocket/tests/send-throw-expected.txt: Added. 18 * websocket/tests/send-throw.html: Added. 19 1 20 2010-06-18 Nikolas Zimmermann <nzimmermann@rim.com> 2 21 -
trunk/WebCore/ChangeLog
r61388 r61390 1 2010-06-18 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Darin Adler. 4 5 Remove unneeded custom code for WebSocket.send 6 https://bugs.webkit.org/show_bug.cgi?id=38180 7 8 We don't appear to require a custom binding here. The old function was 9 wacky in two ways: 10 11 1) It required all of its arguments. 12 13 2) If the toString of its argument threw, it would catch the exception 14 and re-throw a different exception. 15 16 I've kept the first behavior but changed the second (and documented it 17 with a test). 18 19 Test: websocket/tests/send-throw.html 20 21 * bindings/js/JSWebSocketCustom.cpp: 22 * bindings/v8/custom/V8WebSocketCustom.cpp: 23 * websockets/WebSocket.idl: 24 1 25 2010-06-15 Dumitru Daniliuc <dumi@chromium.org> 2 26 -
trunk/WebCore/bindings/js/JSWebSocketCustom.cpp
r61136 r61390 45 45 namespace WebCore { 46 46 47 // Custom functions48 JSValue JSWebSocket::send(ExecState* exec)49 {50 if (exec->argumentCount() < 1)51 return throwError(exec, createSyntaxError(exec, "Not enough arguments"));52 53 const String& msg = ustringToString(exec->argument(0).toString(exec));54 if (exec->hadException())55 return throwError(exec, createSyntaxError(exec, "bad message data."));56 ExceptionCode ec = 0;57 JSValue ret = jsBoolean(impl()->send(msg, ec));58 setDOMException(exec, ec);59 return ret;60 }61 62 47 EncodedJSValue JSC_HOST_CALL JSWebSocketConstructor::constructJSWebSocket(ExecState* exec) 63 48 { -
trunk/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp
r55798 r61390 94 94 } 95 95 96 v8::Handle<v8::Value> V8WebSocket::sendCallback(const v8::Arguments& args)97 {98 INC_STATS("DOM.WebSocket.send()");99 WebSocket* webSocket = V8WebSocket::toNative(args.Holder());100 101 ExceptionCode ec = 0;102 bool ret = false;103 if (args.Length() < 1)104 return throwError("Not enough arguments", V8Proxy::SyntaxError);105 else {106 String msg = toWebCoreString(args[0]);107 ret = webSocket->send(msg, ec);108 }109 if (ec)110 return throwError(ec);111 return v8Boolean(ret);112 }113 114 96 } // namespace WebCore 115 97 -
trunk/WebCore/websockets/WebSocket.idl
r61136 r61390 57 57 attribute EventListener onclose; 58 58 59 [Custom] boolean send(in DOMString data) 60 raises(DOMException); 59 [RequiresAllArguments] boolean send(in DOMString data) raises(DOMException); 61 60 void close(); 62 61
Note: See TracChangeset
for help on using the changeset viewer.