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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 m_arguments.append(argument); | 51 m_arguments.append(argument); |
52 } | 52 } |
53 | 53 |
54 void ScriptCallArgumentHandler::appendArgument(const String& argument) | 54 void ScriptCallArgumentHandler::appendArgument(const String& argument) |
55 { | 55 { |
56 v8::Isolate* isolate = m_scriptState->isolate(); | 56 v8::Isolate* isolate = m_scriptState->isolate(); |
57 ScriptState::Scope scope(m_scriptState.get()); | 57 ScriptState::Scope scope(m_scriptState.get()); |
58 m_arguments.append(ScriptValue(m_scriptState.get(), v8String(isolate, argume
nt))); | 58 m_arguments.append(ScriptValue(m_scriptState.get(), v8String(isolate, argume
nt))); |
59 } | 59 } |
60 | 60 |
61 void ScriptCallArgumentHandler::appendArgument(const char* argument) | |
62 { | |
63 v8::Isolate* isolate = m_scriptState->isolate(); | |
64 ScriptState::Scope scope(m_scriptState.get()); | |
65 m_arguments.append(ScriptValue(m_scriptState.get(), v8String(isolate, argume
nt))); | |
66 } | |
67 | |
68 void ScriptCallArgumentHandler::appendArgument(long argument) | |
69 { | |
70 v8::Isolate* isolate = m_scriptState->isolate(); | |
71 ScriptState::Scope scope(m_scriptState.get()); | |
72 m_arguments.append(ScriptValue(m_scriptState.get(), v8::Number::New(isolate,
argument))); | |
73 } | |
74 | |
75 void ScriptCallArgumentHandler::appendArgument(long long argument) | |
76 { | |
77 v8::Isolate* isolate = m_scriptState->isolate(); | |
78 ScriptState::Scope scope(m_scriptState.get()); | |
79 m_arguments.append(ScriptValue(m_scriptState.get(), v8::Number::New(isolate,
argument))); | |
80 } | |
81 | |
82 void ScriptCallArgumentHandler::appendArgument(unsigned argument) | |
83 { | |
84 v8::Isolate* isolate = m_scriptState->isolate(); | |
85 ScriptState::Scope scope(m_scriptState.get()); | |
86 m_arguments.append(ScriptValue(m_scriptState.get(), v8::Number::New(isolate,
argument))); | |
87 } | |
88 | |
89 void ScriptCallArgumentHandler::appendArgument(unsigned long argument) | |
90 { | |
91 v8::Isolate* isolate = m_scriptState->isolate(); | |
92 ScriptState::Scope scope(m_scriptState.get()); | |
93 m_arguments.append(ScriptValue(m_scriptState.get(), v8::Number::New(isolate,
argument))); | |
94 } | |
95 | |
96 void ScriptCallArgumentHandler::appendArgument(int argument) | 61 void ScriptCallArgumentHandler::appendArgument(int argument) |
97 { | 62 { |
98 v8::Isolate* isolate = m_scriptState->isolate(); | 63 v8::Isolate* isolate = m_scriptState->isolate(); |
99 ScriptState::Scope scope(m_scriptState.get()); | 64 ScriptState::Scope scope(m_scriptState.get()); |
100 m_arguments.append(ScriptValue(m_scriptState.get(), v8::Number::New(isolate,
argument))); | 65 m_arguments.append(ScriptValue(m_scriptState.get(), v8::Number::New(isolate,
argument))); |
101 } | 66 } |
102 | 67 |
103 void ScriptCallArgumentHandler::appendArgument(bool argument) | 68 void ScriptCallArgumentHandler::appendArgument(bool argument) |
104 { | 69 { |
105 v8::Isolate* isolate = m_scriptState->isolate(); | 70 v8::Isolate* isolate = m_scriptState->isolate(); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 v8::Local<v8::Object> result = V8ObjectConstructor::newInstance(m_scriptStat
e->isolate(), constructor, m_arguments.size(), info.get()); | 158 v8::Local<v8::Object> result = V8ObjectConstructor::newInstance(m_scriptStat
e->isolate(), constructor, m_arguments.size(), info.get()); |
194 if (tryCatch.HasCaught()) { | 159 if (tryCatch.HasCaught()) { |
195 hadException = true; | 160 hadException = true; |
196 return ScriptValue(); | 161 return ScriptValue(); |
197 } | 162 } |
198 | 163 |
199 return ScriptValue(m_scriptState.get(), result); | 164 return ScriptValue(m_scriptState.get(), result); |
200 } | 165 } |
201 | 166 |
202 } // namespace blink | 167 } // namespace blink |
OLD | NEW |