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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 } | 55 } |
56 | 56 |
57 void ScriptCallArgumentHandler::appendArgument(const ScriptValue& argument) | 57 void ScriptCallArgumentHandler::appendArgument(const ScriptValue& argument) |
58 { | 58 { |
59 m_arguments.append(argument); | 59 m_arguments.append(argument); |
60 } | 60 } |
61 | 61 |
62 void ScriptCallArgumentHandler::appendArgument(const String& argument) | 62 void ScriptCallArgumentHandler::appendArgument(const String& argument) |
63 { | 63 { |
64 ScriptScope scope(m_scriptState); | 64 ScriptScope scope(m_scriptState); |
65 m_arguments.append(v8String(argument, m_scriptState->isolate())); | 65 m_arguments.append(deprecatedV8String(argument)); |
66 } | 66 } |
67 | 67 |
68 void ScriptCallArgumentHandler::appendArgument(const char* argument) | 68 void ScriptCallArgumentHandler::appendArgument(const char* argument) |
69 { | 69 { |
70 ScriptScope scope(m_scriptState); | 70 ScriptScope scope(m_scriptState); |
71 m_arguments.append(v8String(argument, m_scriptState->isolate())); | 71 m_arguments.append(deprecatedV8String(argument)); |
72 } | 72 } |
73 | 73 |
74 void ScriptCallArgumentHandler::appendArgument(long argument) | 74 void ScriptCallArgumentHandler::appendArgument(long argument) |
75 { | 75 { |
76 ScriptScope scope(m_scriptState); | 76 ScriptScope scope(m_scriptState); |
77 m_arguments.append(v8::Number::New(argument)); | 77 m_arguments.append(v8::Number::New(argument)); |
78 } | 78 } |
79 | 79 |
80 void ScriptCallArgumentHandler::appendArgument(long long argument) | 80 void ScriptCallArgumentHandler::appendArgument(long long argument) |
81 { | 81 { |
(...skipping 29 matching lines...) Expand all Loading... |
111 , m_thisObject(thisObject) | 111 , m_thisObject(thisObject) |
112 , m_name(name) | 112 , m_name(name) |
113 { | 113 { |
114 } | 114 } |
115 | 115 |
116 ScriptValue ScriptFunctionCall::call(bool& hadException, bool reportExceptions) | 116 ScriptValue ScriptFunctionCall::call(bool& hadException, bool reportExceptions) |
117 { | 117 { |
118 ScriptScope scope(m_scriptState, reportExceptions); | 118 ScriptScope scope(m_scriptState, reportExceptions); |
119 | 119 |
120 v8::Local<v8::Object> thisObject = m_thisObject.v8Object(); | 120 v8::Local<v8::Object> thisObject = m_thisObject.v8Object(); |
121 v8::Local<v8::Value> value = thisObject->Get(v8String(m_name, m_scriptState-
>isolate())); | 121 v8::Local<v8::Value> value = thisObject->Get(deprecatedV8String(m_name)); |
122 if (!scope.success()) { | 122 if (!scope.success()) { |
123 hadException = true; | 123 hadException = true; |
124 return ScriptValue(); | 124 return ScriptValue(); |
125 } | 125 } |
126 | 126 |
127 ASSERT(value->IsFunction()); | 127 ASSERT(value->IsFunction()); |
128 | 128 |
129 v8::Local<v8::Function> function(v8::Function::Cast(*value)); | 129 v8::Local<v8::Function> function(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) |
(...skipping 16 matching lines...) Expand all Loading... |
148 { | 148 { |
149 bool hadException = false; | 149 bool hadException = false; |
150 return call(hadException); | 150 return call(hadException); |
151 } | 151 } |
152 | 152 |
153 ScriptObject ScriptFunctionCall::construct(bool& hadException, bool reportExcept
ions) | 153 ScriptObject ScriptFunctionCall::construct(bool& hadException, bool reportExcept
ions) |
154 { | 154 { |
155 ScriptScope scope(m_scriptState, reportExceptions); | 155 ScriptScope scope(m_scriptState, reportExceptions); |
156 | 156 |
157 v8::Local<v8::Object> thisObject = m_thisObject.v8Object(); | 157 v8::Local<v8::Object> thisObject = m_thisObject.v8Object(); |
158 v8::Local<v8::Value> value = thisObject->Get(v8String(m_name, m_scriptState-
>isolate())); | 158 v8::Local<v8::Value> value = thisObject->Get(deprecatedV8String(m_name)); |
159 if (!scope.success()) { | 159 if (!scope.success()) { |
160 hadException = true; | 160 hadException = true; |
161 return ScriptObject(); | 161 return ScriptObject(); |
162 } | 162 } |
163 | 163 |
164 ASSERT(value->IsFunction()); | 164 ASSERT(value->IsFunction()); |
165 | 165 |
166 v8::Local<v8::Function> constructor(v8::Function::Cast(*value)); | 166 v8::Local<v8::Function> constructor(v8::Function::Cast(*value)); |
167 OwnArrayPtr<v8::Handle<v8::Value> > args = adoptArrayPtr(new v8::Handle<v8::
Value>[m_arguments.size()]); | 167 OwnArrayPtr<v8::Handle<v8::Value> > args = adoptArrayPtr(new v8::Handle<v8::
Value>[m_arguments.size()]); |
168 for (size_t i = 0; i < m_arguments.size(); ++i) | 168 for (size_t i = 0; i < m_arguments.size(); ++i) |
(...skipping 26 matching lines...) Expand all Loading... |
195 | 195 |
196 OwnArrayPtr<v8::Handle<v8::Value> > args = adoptArrayPtr(new v8::Handle<v8::
Value>[m_arguments.size()]); | 196 OwnArrayPtr<v8::Handle<v8::Value> > args = adoptArrayPtr(new v8::Handle<v8::
Value>[m_arguments.size()]); |
197 for (size_t i = 0; i < m_arguments.size(); ++i) | 197 for (size_t i = 0; i < m_arguments.size(); ++i) |
198 args[i] = m_arguments[i].v8Value(); | 198 args[i] = m_arguments[i].v8Value(); |
199 | 199 |
200 v8::Handle<v8::Value> result = ScriptController::callFunctionWithInstrumenta
tion(0, function, object, m_arguments.size(), args.get()); | 200 v8::Handle<v8::Value> result = ScriptController::callFunctionWithInstrumenta
tion(0, function, object, m_arguments.size(), args.get()); |
201 return ScriptValue(result); | 201 return ScriptValue(result); |
202 } | 202 } |
203 | 203 |
204 } // namespace WebCore | 204 } // namespace WebCore |
OLD | NEW |