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

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: rebased 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
« no previous file with comments | « Source/bindings/core/v8/V8Binding.h ('k') | Source/bindings/core/v8/V8BindingTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 946 matching lines...) Expand 10 before | Expand all | Expand 10 after
957 { 957 {
958 return m_scriptState->isolate(); 958 return m_scriptState->isolate();
959 } 959 }
960 960
961 void GetDevToolsFunctionInfo(v8::Handle<v8::Function> function, v8::Isolate* iso late, int& scriptId, String& resourceName, int& lineNumber) 961 void GetDevToolsFunctionInfo(v8::Handle<v8::Function> function, v8::Isolate* iso late, int& scriptId, String& resourceName, int& lineNumber)
962 { 962 {
963 v8::Handle<v8::Function> originalFunction = getBoundFunction(function); 963 v8::Handle<v8::Function> originalFunction = getBoundFunction(function);
964 scriptId = originalFunction->ScriptId(); 964 scriptId = originalFunction->ScriptId();
965 v8::ScriptOrigin origin = originalFunction->GetScriptOrigin(); 965 v8::ScriptOrigin origin = originalFunction->GetScriptOrigin();
966 if (!origin.ResourceName().IsEmpty()) { 966 if (!origin.ResourceName().IsEmpty()) {
967 resourceName = NativeValueTraits<String>::nativeValue(origin.ResourceNam e(), isolate); 967 V8StringResource<> stringResource(origin.ResourceName());
968 stringResource.prepare();
969 resourceName = stringResource;
968 lineNumber = originalFunction->GetScriptLineNumber() + 1; 970 lineNumber = originalFunction->GetScriptLineNumber() + 1;
969 } 971 }
970 if (resourceName.isEmpty()) { 972 if (resourceName.isEmpty()) {
971 resourceName = "undefined"; 973 resourceName = "undefined";
972 lineNumber = 1; 974 lineNumber = 1;
973 } 975 }
974 } 976 }
975 977
976 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(Executio nContext* context, v8::Handle<v8::Function> function, v8::Isolate* isolate) 978 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(Executio nContext* context, v8::Handle<v8::Function> function, v8::Isolate* isolate)
977 { 979 {
(...skipping 14 matching lines...) Expand all
992 994
993 v8::Local<v8::Value> v8IteratorResult(v8::Isolate* isolate, v8::Handle<v8::Value > value) 995 v8::Local<v8::Value> v8IteratorResult(v8::Isolate* isolate, v8::Handle<v8::Value > value)
994 { 996 {
995 v8::Local<v8::Object> result = v8::Object::New(isolate); 997 v8::Local<v8::Object> result = v8::Object::New(isolate);
996 result->Set(v8String(isolate, "value"), value); 998 result->Set(v8String(isolate, "value"), value);
997 result->Set(v8String(isolate, "done"), v8Boolean(false, isolate)); 999 result->Set(v8String(isolate, "done"), v8Boolean(false, isolate));
998 return result; 1000 return result;
999 } 1001 }
1000 1002
1001 } // namespace blink 1003 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/V8Binding.h ('k') | Source/bindings/core/v8/V8BindingTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698