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

Unified Diff: Source/bindings/v8/custom/V8HTMLAllCollectionCustom.cpp

Issue 23526039: Replace several uses of toWebCoreString() by V8TRYCATCH_FOR_V8STRINGRESOURCE() macro (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 months 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 side-by-side diff with in-line comments
Download patch
Index: Source/bindings/v8/custom/V8HTMLAllCollectionCustom.cpp
diff --git a/Source/bindings/v8/custom/V8HTMLAllCollectionCustom.cpp b/Source/bindings/v8/custom/V8HTMLAllCollectionCustom.cpp
index 7033e325920935708ef868e71635a56736f67f2d..b86fc6b152b6ef88adc440922df611083c1fd0c3 100644
--- a/Source/bindings/v8/custom/V8HTMLAllCollectionCustom.cpp
+++ b/Source/bindings/v8/custom/V8HTMLAllCollectionCustom.cpp
@@ -62,7 +62,8 @@ static v8::Handle<v8::Value> getItem(HTMLAllCollection* collection, v8::Handle<v
{
v8::Local<v8::Uint32> index = argument->ToArrayIndex();
if (index.IsEmpty()) {
- v8::Handle<v8::Value> result = getNamedItems(collection, toWebCoreString(argument->ToString()), callbackInfo);
+ V8TRYCATCH_FOR_V8STRINGRESOURCE_RETURN(V8StringResource<>, name, argument, v8::Undefined(callbackInfo.GetIsolate()));
haraken 2013/09/12 17:33:52 Ditto.
+ v8::Handle<v8::Value> result = getNamedItems(collection, name, callbackInfo);
if (result.IsEmpty())
return v8::Undefined();
@@ -82,8 +83,10 @@ void V8HTMLAllCollection::itemMethodCustom(const v8::FunctionCallbackInfo<v8::Va
void V8HTMLAllCollection::namedItemMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& args)
{
+ V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, name, args[0]);
+
HTMLAllCollection* imp = V8HTMLAllCollection::toNative(args.Holder());
- v8::Handle<v8::Value> result = getNamedItems(imp, toWebCoreString(args[0]), args);
+ v8::Handle<v8::Value> result = getNamedItems(imp, name, args);
if (result.IsEmpty()) {
v8SetReturnValueNull(args);
@@ -106,7 +109,7 @@ void V8HTMLAllCollection::legacyCallCustom(const v8::FunctionCallbackInfo<v8::Va
}
// If there is a second argument it is the index of the item we want.
- String name = toWebCoreString(args[0]);
+ V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, name, args[0]);
v8::Local<v8::Uint32> index = args[1]->ToArrayIndex();
if (index.IsEmpty())
return;

Powered by Google App Engine
This is Rietveld 408576698