Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(523)

Side by Side Diff: Source/bindings/v8/custom/V8MessageEventCustom.cpp

Issue 38063003: Improve TypeError messages from failed array conversions. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Improve TypeError messages from failed array conversions. Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 109
110 DOMWindow* sourceArg = 0; 110 DOMWindow* sourceArg = 0;
111 if (args[6]->IsObject()) { 111 if (args[6]->IsObject()) {
112 v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(args[6]); 112 v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(args[6]);
113 v8::Handle<v8::Object> window = wrapper->FindInstanceInPrototypeChain(V8 Window::GetTemplate(args.GetIsolate(), worldTypeInMainThread(args.GetIsolate())) ); 113 v8::Handle<v8::Object> window = wrapper->FindInstanceInPrototypeChain(V8 Window::GetTemplate(args.GetIsolate(), worldTypeInMainThread(args.GetIsolate())) );
114 if (!window.IsEmpty()) 114 if (!window.IsEmpty())
115 sourceArg = V8Window::toNative(window); 115 sourceArg = V8Window::toNative(window);
116 } 116 }
117 OwnPtr<MessagePortArray> portArray; 117 OwnPtr<MessagePortArray> portArray;
118 118
119 if (!isUndefinedOrNull(args[7])) { 119 const int portArrayIndex = 7;
120 if (!isUndefinedOrNull(args[portArrayIndex])) {
120 portArray = adoptPtr(new MessagePortArray); 121 portArray = adoptPtr(new MessagePortArray);
121 if (!getMessagePortArray(args[7], *portArray, args.GetIsolate())) 122 if (!getMessagePortArray(args[portArrayIndex], portArrayIndex + 1, *port Array, args.GetIsolate()))
122 return; 123 return;
123 } 124 }
124 event->initMessageEvent(typeArg, canBubbleArg, cancelableArg, originArg, las tEventIdArg, sourceArg, portArray.release()); 125 event->initMessageEvent(typeArg, canBubbleArg, cancelableArg, originArg, las tEventIdArg, sourceArg, portArray.release());
125 126
126 if (!dataArg.IsEmpty()) { 127 if (!dataArg.IsEmpty()) {
127 args.Holder()->SetHiddenValue(V8HiddenPropertyName::data(args.GetIsolate ()), dataArg); 128 args.Holder()->SetHiddenValue(V8HiddenPropertyName::data(args.GetIsolate ()), dataArg);
128 if (isolatedWorldForIsolate(args.GetIsolate())) 129 if (isolatedWorldForIsolate(args.GetIsolate()))
129 event->setSerializedData(SerializedScriptValue::createAndSwallowExce ptions(dataArg, args.GetIsolate())); 130 event->setSerializedData(SerializedScriptValue::createAndSwallowExce ptions(dataArg, args.GetIsolate()));
130 } 131 }
131 } 132 }
132 133
133 void V8MessageEvent::webkitInitMessageEventMethodCustom(const v8::FunctionCallba ckInfo<v8::Value>& args) 134 void V8MessageEvent::webkitInitMessageEventMethodCustom(const v8::FunctionCallba ckInfo<v8::Value>& args)
134 { 135 {
135 initMessageEventMethodCustom(args); 136 initMessageEventMethodCustom(args);
136 } 137 }
137 138
138 139
139 } // namespace WebCore 140 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/custom/V8DedicatedWorkerGlobalScopeCustom.cpp ('k') | Source/bindings/v8/custom/V8MessagePortCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698