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

Side by Side Diff: Source/bindings/core/v8/V8Binding.cpp

Issue 555133003: Use ExceptionState to throw exceptions when converting arrays (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 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 916 matching lines...) Expand 10 before | Expand all | Expand 10 after
927 { 927 {
928 return m_scriptState->isolate(); 928 return m_scriptState->isolate();
929 } 929 }
930 930
931 void GetDevToolsFunctionInfo(v8::Handle<v8::Function> function, v8::Isolate* iso late, int& scriptId, String& resourceName, int& lineNumber) 931 void GetDevToolsFunctionInfo(v8::Handle<v8::Function> function, v8::Isolate* iso late, int& scriptId, String& resourceName, int& lineNumber)
932 { 932 {
933 v8::Handle<v8::Function> originalFunction = getBoundFunction(function); 933 v8::Handle<v8::Function> originalFunction = getBoundFunction(function);
934 scriptId = originalFunction->ScriptId(); 934 scriptId = originalFunction->ScriptId();
935 v8::ScriptOrigin origin = originalFunction->GetScriptOrigin(); 935 v8::ScriptOrigin origin = originalFunction->GetScriptOrigin();
936 if (!origin.ResourceName().IsEmpty()) { 936 if (!origin.ResourceName().IsEmpty()) {
937 resourceName = NativeValueTraits<String>::nativeValue(origin.ResourceNam e(), isolate); 937 V8StringResource<> stringResource(origin.ResourceName());
Jens Widell 2014/09/11 13:22:31 It feels like maybe we could do something better h
938 stringResource.prepare();
939 resourceName = stringResource;
938 lineNumber = originalFunction->GetScriptLineNumber() + 1; 940 lineNumber = originalFunction->GetScriptLineNumber() + 1;
939 } 941 }
940 if (resourceName.isEmpty()) { 942 if (resourceName.isEmpty()) {
941 resourceName = "undefined"; 943 resourceName = "undefined";
942 lineNumber = 1; 944 lineNumber = 1;
943 } 945 }
944 } 946 }
945 947
946 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(Executio nContext* context, v8::Handle<v8::Function> function, v8::Isolate* isolate) 948 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(Executio nContext* context, v8::Handle<v8::Function> function, v8::Isolate* isolate)
947 { 949 {
(...skipping 14 matching lines...) Expand all
962 964
963 v8::Local<v8::Value> v8IteratorResult(v8::Isolate* isolate, v8::Handle<v8::Value > value) 965 v8::Local<v8::Value> v8IteratorResult(v8::Isolate* isolate, v8::Handle<v8::Value > value)
964 { 966 {
965 v8::Local<v8::Object> result = v8::Object::New(isolate); 967 v8::Local<v8::Object> result = v8::Object::New(isolate);
966 result->Set(v8String(isolate, "value"), value); 968 result->Set(v8String(isolate, "value"), value);
967 result->Set(v8String(isolate, "done"), v8Boolean(false, isolate)); 969 result->Set(v8String(isolate, "done"), v8Boolean(false, isolate));
968 return result; 970 return result;
969 } 971 }
970 972
971 } // namespace blink 973 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698