OLD | NEW |
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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 | 126 |
127 ASSERT(value->IsFunction()); | 127 ASSERT(value->IsFunction()); |
128 | 128 |
129 v8::Local<v8::Function> function = v8::Local<v8::Function>::Cast(value); | 129 v8::Local<v8::Function> function = v8::Local<v8::Function>::Cast(value); |
130 OwnArrayPtr<v8::Handle<v8::Value> > args = adoptArrayPtr(new v8::Handle<v8::
Value>[m_arguments.size()]); | 130 OwnArrayPtr<v8::Handle<v8::Value> > args = adoptArrayPtr(new v8::Handle<v8::
Value>[m_arguments.size()]); |
131 for (size_t i = 0; i < m_arguments.size(); ++i) { | 131 for (size_t i = 0; i < m_arguments.size(); ++i) { |
132 args[i] = m_arguments[i].v8Value(); | 132 args[i] = m_arguments[i].v8Value(); |
133 ASSERT(!args[i].IsEmpty()); | 133 ASSERT(!args[i].IsEmpty()); |
134 } | 134 } |
135 | 135 |
136 v8::Local<v8::Value> result = V8ScriptRunner::callFunction(function, getScri
ptExecutionContext(), thisObject, m_arguments.size(), args.get()); | 136 v8::Local<v8::Value> result = V8ScriptRunner::callFunction(function, getScri
ptExecutionContext(), thisObject, m_arguments.size(), args.get(), m_scriptState-
>isolate()); |
137 if (!scope.success()) { | 137 if (!scope.success()) { |
138 hadException = true; | 138 hadException = true; |
139 return ScriptValue(); | 139 return ScriptValue(); |
140 } | 140 } |
141 | 141 |
142 return ScriptValue(result); | 142 return ScriptValue(result); |
143 } | 143 } |
144 | 144 |
145 ScriptValue ScriptFunctionCall::call() | 145 ScriptValue ScriptFunctionCall::call() |
146 { | 146 { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 | 188 |
189 v8::TryCatch exceptionCatcher; | 189 v8::TryCatch exceptionCatcher; |
190 exceptionCatcher.SetVerbose(true); | 190 exceptionCatcher.SetVerbose(true); |
191 v8::Handle<v8::Object> object = v8::Context::GetCurrent()->Global(); | 191 v8::Handle<v8::Object> object = v8::Context::GetCurrent()->Global(); |
192 v8::Handle<v8::Function> function = v8::Handle<v8::Function>::Cast(m_functio
n.v8Value()); | 192 v8::Handle<v8::Function> function = v8::Handle<v8::Function>::Cast(m_functio
n.v8Value()); |
193 | 193 |
194 OwnArrayPtr<v8::Handle<v8::Value> > args = adoptArrayPtr(new v8::Handle<v8::
Value>[m_arguments.size()]); | 194 OwnArrayPtr<v8::Handle<v8::Value> > args = adoptArrayPtr(new v8::Handle<v8::
Value>[m_arguments.size()]); |
195 for (size_t i = 0; i < m_arguments.size(); ++i) | 195 for (size_t i = 0; i < m_arguments.size(); ++i) |
196 args[i] = m_arguments[i].v8Value(); | 196 args[i] = m_arguments[i].v8Value(); |
197 | 197 |
198 v8::Handle<v8::Value> result = ScriptController::callFunctionWithInstrumenta
tion(0, function, object, m_arguments.size(), args.get()); | 198 v8::Handle<v8::Value> result = ScriptController::callFunctionWithInstrumenta
tion(0, function, object, m_arguments.size(), args.get(), m_scriptState->isolate
()); |
199 return ScriptValue(result); | 199 return ScriptValue(result); |
200 } | 200 } |
201 | 201 |
202 } // namespace WebCore | 202 } // namespace WebCore |
OLD | NEW |