| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! | 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! |
| 6 | 6 |
| 7 #include "V8TestInterface2.h" | 7 #include "V8TestInterface2.h" |
| 8 | 8 |
| 9 #include "bindings/core/v8/ExceptionState.h" | 9 #include "bindings/core/v8/ExceptionState.h" |
| 10 #include "bindings/core/v8/ScriptState.h" | 10 #include "bindings/core/v8/ScriptState.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 "[ActiveScriptWrappable] extended attribute in the IDL file. " | 52 "[ActiveScriptWrappable] extended attribute in the IDL file. " |
| 53 "Be consistent."); | 53 "Be consistent."); |
| 54 | 54 |
| 55 namespace TestInterface2V8Internal { | 55 namespace TestInterface2V8Internal { |
| 56 | 56 |
| 57 static void itemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 57 static void itemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 58 { | 58 { |
| 59 ExceptionState exceptionState(ExceptionState::ExecutionContext, "item", "Tes
tInterface2", info.Holder(), info.GetIsolate()); | 59 ExceptionState exceptionState(ExceptionState::ExecutionContext, "item", "Tes
tInterface2", info.Holder(), info.GetIsolate()); |
| 60 if (UNLIKELY(info.Length() < 1)) { | 60 if (UNLIKELY(info.Length() < 1)) { |
| 61 setMinimumArityTypeError(exceptionState, 1, info.Length()); | 61 setMinimumArityTypeError(exceptionState, 1, info.Length()); |
| 62 exceptionState.throwIfNeeded(); | |
| 63 return; | 62 return; |
| 64 } | 63 } |
| 65 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 64 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 66 unsigned index; | 65 unsigned index; |
| 67 { | 66 { |
| 68 index = toUInt32(info.GetIsolate(), info[0], NormalConversion, exception
State); | 67 index = toUInt32(info.GetIsolate(), info[0], NormalConversion, exception
State); |
| 69 if (exceptionState.throwIfNeeded()) | 68 if (exceptionState.hadException()) |
| 70 return; | 69 return; |
| 71 } | 70 } |
| 72 TestInterfaceEmpty* result = impl->item(index, exceptionState); | 71 TestInterfaceEmpty* result = impl->item(index, exceptionState); |
| 73 if (exceptionState.hadException()) { | 72 if (exceptionState.hadException()) { |
| 74 exceptionState.throwIfNeeded(); | |
| 75 return; | 73 return; |
| 76 } | 74 } |
| 77 v8SetReturnValue(info, result); | 75 v8SetReturnValue(info, result); |
| 78 } | 76 } |
| 79 | 77 |
| 80 static void itemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) | 78 static void itemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 81 { | 79 { |
| 82 TestInterface2V8Internal::itemMethod(info); | 80 TestInterface2V8Internal::itemMethod(info); |
| 83 } | 81 } |
| 84 | 82 |
| 85 static void setItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 83 static void setItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 86 { | 84 { |
| 87 ExceptionState exceptionState(ExceptionState::ExecutionContext, "setItem", "
TestInterface2", info.Holder(), info.GetIsolate()); | 85 ExceptionState exceptionState(ExceptionState::ExecutionContext, "setItem", "
TestInterface2", info.Holder(), info.GetIsolate()); |
| 88 if (UNLIKELY(info.Length() < 2)) { | 86 if (UNLIKELY(info.Length() < 2)) { |
| 89 setMinimumArityTypeError(exceptionState, 2, info.Length()); | 87 setMinimumArityTypeError(exceptionState, 2, info.Length()); |
| 90 exceptionState.throwIfNeeded(); | |
| 91 return; | 88 return; |
| 92 } | 89 } |
| 93 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 90 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 94 unsigned index; | 91 unsigned index; |
| 95 TestInterfaceEmpty* value; | 92 TestInterfaceEmpty* value; |
| 96 { | 93 { |
| 97 index = toUInt32(info.GetIsolate(), info[0], NormalConversion, exception
State); | 94 index = toUInt32(info.GetIsolate(), info[0], NormalConversion, exception
State); |
| 98 if (exceptionState.throwIfNeeded()) | 95 if (exceptionState.hadException()) |
| 99 return; | 96 return; |
| 100 value = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), inf
o[1]); | 97 value = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), inf
o[1]); |
| 101 if (!value) { | 98 if (!value) { |
| 102 exceptionState.throwTypeError("parameter 2 is not of type 'TestInter
faceEmpty'."); | 99 exceptionState.throwTypeError("parameter 2 is not of type 'TestInter
faceEmpty'."); |
| 103 exceptionState.throwIfNeeded(); | |
| 104 return; | 100 return; |
| 105 } | 101 } |
| 106 } | 102 } |
| 107 TestInterfaceEmpty* result = impl->setItem(index, value, exceptionState); | 103 TestInterfaceEmpty* result = impl->setItem(index, value, exceptionState); |
| 108 if (exceptionState.hadException()) { | 104 if (exceptionState.hadException()) { |
| 109 exceptionState.throwIfNeeded(); | |
| 110 return; | 105 return; |
| 111 } | 106 } |
| 112 v8SetReturnValue(info, result); | 107 v8SetReturnValue(info, result); |
| 113 } | 108 } |
| 114 | 109 |
| 115 static void setItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
o) | 110 static void setItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
o) |
| 116 { | 111 { |
| 117 TestInterface2V8Internal::setItemMethod(info); | 112 TestInterface2V8Internal::setItemMethod(info); |
| 118 } | 113 } |
| 119 | 114 |
| 120 static void deleteItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 115 static void deleteItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 121 { | 116 { |
| 122 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deleteItem"
, "TestInterface2", info.Holder(), info.GetIsolate()); | 117 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deleteItem"
, "TestInterface2", info.Holder(), info.GetIsolate()); |
| 123 if (UNLIKELY(info.Length() < 1)) { | 118 if (UNLIKELY(info.Length() < 1)) { |
| 124 setMinimumArityTypeError(exceptionState, 1, info.Length()); | 119 setMinimumArityTypeError(exceptionState, 1, info.Length()); |
| 125 exceptionState.throwIfNeeded(); | |
| 126 return; | 120 return; |
| 127 } | 121 } |
| 128 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 122 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 129 unsigned index; | 123 unsigned index; |
| 130 { | 124 { |
| 131 index = toUInt32(info.GetIsolate(), info[0], NormalConversion, exception
State); | 125 index = toUInt32(info.GetIsolate(), info[0], NormalConversion, exception
State); |
| 132 if (exceptionState.throwIfNeeded()) | 126 if (exceptionState.hadException()) |
| 133 return; | 127 return; |
| 134 } | 128 } |
| 135 bool result = impl->deleteItem(index, exceptionState); | 129 bool result = impl->deleteItem(index, exceptionState); |
| 136 if (exceptionState.hadException()) { | 130 if (exceptionState.hadException()) { |
| 137 exceptionState.throwIfNeeded(); | |
| 138 return; | 131 return; |
| 139 } | 132 } |
| 140 v8SetReturnValueBool(info, result); | 133 v8SetReturnValueBool(info, result); |
| 141 } | 134 } |
| 142 | 135 |
| 143 static void deleteItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) | 136 static void deleteItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) |
| 144 { | 137 { |
| 145 TestInterface2V8Internal::deleteItemMethod(info); | 138 TestInterface2V8Internal::deleteItemMethod(info); |
| 146 } | 139 } |
| 147 | 140 |
| 148 static void namedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 141 static void namedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 149 { | 142 { |
| 150 ExceptionState exceptionState(ExceptionState::ExecutionContext, "namedItem",
"TestInterface2", info.Holder(), info.GetIsolate()); | 143 ExceptionState exceptionState(ExceptionState::ExecutionContext, "namedItem",
"TestInterface2", info.Holder(), info.GetIsolate()); |
| 151 if (UNLIKELY(info.Length() < 1)) { | 144 if (UNLIKELY(info.Length() < 1)) { |
| 152 setMinimumArityTypeError(exceptionState, 1, info.Length()); | 145 setMinimumArityTypeError(exceptionState, 1, info.Length()); |
| 153 exceptionState.throwIfNeeded(); | |
| 154 return; | 146 return; |
| 155 } | 147 } |
| 156 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 148 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 157 V8StringResource<> name; | 149 V8StringResource<> name; |
| 158 { | 150 { |
| 159 name = info[0]; | 151 name = info[0]; |
| 160 if (!name.prepare()) | 152 if (!name.prepare()) |
| 161 return; | 153 return; |
| 162 } | 154 } |
| 163 TestInterfaceEmpty* result = impl->namedItem(name, exceptionState); | 155 TestInterfaceEmpty* result = impl->namedItem(name, exceptionState); |
| 164 if (exceptionState.hadException()) { | 156 if (exceptionState.hadException()) { |
| 165 exceptionState.throwIfNeeded(); | |
| 166 return; | 157 return; |
| 167 } | 158 } |
| 168 v8SetReturnValue(info, result); | 159 v8SetReturnValue(info, result); |
| 169 } | 160 } |
| 170 | 161 |
| 171 static void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 162 static void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
| 172 { | 163 { |
| 173 TestInterface2V8Internal::namedItemMethod(info); | 164 TestInterface2V8Internal::namedItemMethod(info); |
| 174 } | 165 } |
| 175 | 166 |
| 176 static void setNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 167 static void setNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 177 { | 168 { |
| 178 ExceptionState exceptionState(ExceptionState::ExecutionContext, "setNamedIte
m", "TestInterface2", info.Holder(), info.GetIsolate()); | 169 ExceptionState exceptionState(ExceptionState::ExecutionContext, "setNamedIte
m", "TestInterface2", info.Holder(), info.GetIsolate()); |
| 179 if (UNLIKELY(info.Length() < 2)) { | 170 if (UNLIKELY(info.Length() < 2)) { |
| 180 setMinimumArityTypeError(exceptionState, 2, info.Length()); | 171 setMinimumArityTypeError(exceptionState, 2, info.Length()); |
| 181 exceptionState.throwIfNeeded(); | |
| 182 return; | 172 return; |
| 183 } | 173 } |
| 184 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 174 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 185 V8StringResource<> name; | 175 V8StringResource<> name; |
| 186 TestInterfaceEmpty* value; | 176 TestInterfaceEmpty* value; |
| 187 { | 177 { |
| 188 name = info[0]; | 178 name = info[0]; |
| 189 if (!name.prepare()) | 179 if (!name.prepare()) |
| 190 return; | 180 return; |
| 191 value = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), inf
o[1]); | 181 value = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), inf
o[1]); |
| 192 if (!value && !isUndefinedOrNull(info[1])) { | 182 if (!value && !isUndefinedOrNull(info[1])) { |
| 193 exceptionState.throwTypeError("parameter 2 is not of type 'TestInter
faceEmpty'."); | 183 exceptionState.throwTypeError("parameter 2 is not of type 'TestInter
faceEmpty'."); |
| 194 exceptionState.throwIfNeeded(); | |
| 195 return; | 184 return; |
| 196 } | 185 } |
| 197 } | 186 } |
| 198 TestInterfaceEmpty* result = impl->setNamedItem(name, value, exceptionState)
; | 187 TestInterfaceEmpty* result = impl->setNamedItem(name, value, exceptionState)
; |
| 199 if (exceptionState.hadException()) { | 188 if (exceptionState.hadException()) { |
| 200 exceptionState.throwIfNeeded(); | |
| 201 return; | 189 return; |
| 202 } | 190 } |
| 203 v8SetReturnValue(info, result); | 191 v8SetReturnValue(info, result); |
| 204 } | 192 } |
| 205 | 193 |
| 206 static void setNamedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>
& info) | 194 static void setNamedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>
& info) |
| 207 { | 195 { |
| 208 TestInterface2V8Internal::setNamedItemMethod(info); | 196 TestInterface2V8Internal::setNamedItemMethod(info); |
| 209 } | 197 } |
| 210 | 198 |
| 211 static void deleteNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& inf
o) | 199 static void deleteNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& inf
o) |
| 212 { | 200 { |
| 213 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deleteNamed
Item", "TestInterface2", info.Holder(), info.GetIsolate()); | 201 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deleteNamed
Item", "TestInterface2", info.Holder(), info.GetIsolate()); |
| 214 if (UNLIKELY(info.Length() < 1)) { | 202 if (UNLIKELY(info.Length() < 1)) { |
| 215 setMinimumArityTypeError(exceptionState, 1, info.Length()); | 203 setMinimumArityTypeError(exceptionState, 1, info.Length()); |
| 216 exceptionState.throwIfNeeded(); | |
| 217 return; | 204 return; |
| 218 } | 205 } |
| 219 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 206 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 220 V8StringResource<> name; | 207 V8StringResource<> name; |
| 221 { | 208 { |
| 222 name = info[0]; | 209 name = info[0]; |
| 223 if (!name.prepare()) | 210 if (!name.prepare()) |
| 224 return; | 211 return; |
| 225 } | 212 } |
| 226 bool result = impl->deleteNamedItem(name, exceptionState); | 213 bool result = impl->deleteNamedItem(name, exceptionState); |
| 227 if (exceptionState.hadException()) { | 214 if (exceptionState.hadException()) { |
| 228 exceptionState.throwIfNeeded(); | |
| 229 return; | 215 return; |
| 230 } | 216 } |
| 231 v8SetReturnValueBool(info, result); | 217 v8SetReturnValueBool(info, result); |
| 232 } | 218 } |
| 233 | 219 |
| 234 static void deleteNamedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Val
ue>& info) | 220 static void deleteNamedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Val
ue>& info) |
| 235 { | 221 { |
| 236 TestInterface2V8Internal::deleteNamedItemMethod(info); | 222 TestInterface2V8Internal::deleteNamedItemMethod(info); |
| 237 } | 223 } |
| 238 | 224 |
| 239 static void stringifierMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 225 static void stringifierMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
| 240 { | 226 { |
| 241 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 227 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 242 v8SetReturnValueString(info, impl->stringifierMethod(), info.GetIsolate()); | 228 v8SetReturnValueString(info, impl->stringifierMethod(), info.GetIsolate()); |
| 243 } | 229 } |
| 244 | 230 |
| 245 static void stringifierMethodMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 231 static void stringifierMethodMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
| 246 { | 232 { |
| 247 TestInterface2V8Internal::stringifierMethodMethod(info); | 233 TestInterface2V8Internal::stringifierMethodMethod(info); |
| 248 } | 234 } |
| 249 | 235 |
| 250 static void keysMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 236 static void keysMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 251 { | 237 { |
| 252 ExceptionState exceptionState(ExceptionState::ExecutionContext, "keys", "Tes
tInterface2", info.Holder(), info.GetIsolate()); | 238 ExceptionState exceptionState(ExceptionState::ExecutionContext, "keys", "Tes
tInterface2", info.Holder(), info.GetIsolate()); |
| 253 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 239 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 254 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 240 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 255 Iterator* result = impl->keysForBinding(scriptState, exceptionState); | 241 Iterator* result = impl->keysForBinding(scriptState, exceptionState); |
| 256 if (exceptionState.hadException()) { | 242 if (exceptionState.hadException()) { |
| 257 exceptionState.throwIfNeeded(); | |
| 258 return; | 243 return; |
| 259 } | 244 } |
| 260 v8SetReturnValue(info, result); | 245 v8SetReturnValue(info, result); |
| 261 } | 246 } |
| 262 | 247 |
| 263 static void keysMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) | 248 static void keysMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 264 { | 249 { |
| 265 TestInterface2V8Internal::keysMethod(info); | 250 TestInterface2V8Internal::keysMethod(info); |
| 266 } | 251 } |
| 267 | 252 |
| 268 static void valuesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 253 static void valuesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 269 { | 254 { |
| 270 ExceptionState exceptionState(ExceptionState::ExecutionContext, "values", "T
estInterface2", info.Holder(), info.GetIsolate()); | 255 ExceptionState exceptionState(ExceptionState::ExecutionContext, "values", "T
estInterface2", info.Holder(), info.GetIsolate()); |
| 271 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 256 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 272 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 257 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 273 Iterator* result = impl->valuesForBinding(scriptState, exceptionState); | 258 Iterator* result = impl->valuesForBinding(scriptState, exceptionState); |
| 274 if (exceptionState.hadException()) { | 259 if (exceptionState.hadException()) { |
| 275 exceptionState.throwIfNeeded(); | |
| 276 return; | 260 return; |
| 277 } | 261 } |
| 278 v8SetReturnValue(info, result); | 262 v8SetReturnValue(info, result); |
| 279 } | 263 } |
| 280 | 264 |
| 281 static void valuesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info
) | 265 static void valuesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info
) |
| 282 { | 266 { |
| 283 TestInterface2V8Internal::valuesMethod(info); | 267 TestInterface2V8Internal::valuesMethod(info); |
| 284 } | 268 } |
| 285 | 269 |
| 286 static void entriesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 270 static void entriesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 287 { | 271 { |
| 288 ExceptionState exceptionState(ExceptionState::ExecutionContext, "entries", "
TestInterface2", info.Holder(), info.GetIsolate()); | 272 ExceptionState exceptionState(ExceptionState::ExecutionContext, "entries", "
TestInterface2", info.Holder(), info.GetIsolate()); |
| 289 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 273 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 290 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 274 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 291 Iterator* result = impl->entriesForBinding(scriptState, exceptionState); | 275 Iterator* result = impl->entriesForBinding(scriptState, exceptionState); |
| 292 if (exceptionState.hadException()) { | 276 if (exceptionState.hadException()) { |
| 293 exceptionState.throwIfNeeded(); | |
| 294 return; | 277 return; |
| 295 } | 278 } |
| 296 v8SetReturnValue(info, result); | 279 v8SetReturnValue(info, result); |
| 297 } | 280 } |
| 298 | 281 |
| 299 static void entriesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
o) | 282 static void entriesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
o) |
| 300 { | 283 { |
| 301 TestInterface2V8Internal::entriesMethod(info); | 284 TestInterface2V8Internal::entriesMethod(info); |
| 302 } | 285 } |
| 303 | 286 |
| 304 static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 287 static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 305 { | 288 { |
| 306 ExceptionState exceptionState(ExceptionState::ExecutionContext, "forEach", "
TestInterface2", info.Holder(), info.GetIsolate()); | 289 ExceptionState exceptionState(ExceptionState::ExecutionContext, "forEach", "
TestInterface2", info.Holder(), info.GetIsolate()); |
| 307 if (UNLIKELY(info.Length() < 1)) { | 290 if (UNLIKELY(info.Length() < 1)) { |
| 308 setMinimumArityTypeError(exceptionState, 1, info.Length()); | 291 setMinimumArityTypeError(exceptionState, 1, info.Length()); |
| 309 exceptionState.throwIfNeeded(); | |
| 310 return; | 292 return; |
| 311 } | 293 } |
| 312 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 294 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 313 ScriptValue callback; | 295 ScriptValue callback; |
| 314 ScriptValue thisArg; | 296 ScriptValue thisArg; |
| 315 { | 297 { |
| 316 if (!info[0]->IsFunction()) { | 298 if (!info[0]->IsFunction()) { |
| 317 exceptionState.throwTypeError("The callback provided as parameter 1
is not a function."); | 299 exceptionState.throwTypeError("The callback provided as parameter 1
is not a function."); |
| 318 exceptionState.throwIfNeeded(); | |
| 319 return; | 300 return; |
| 320 } | 301 } |
| 321 callback = ScriptValue(ScriptState::current(info.GetIsolate()), info[0])
; | 302 callback = ScriptValue(ScriptState::current(info.GetIsolate()), info[0])
; |
| 322 thisArg = ScriptValue(ScriptState::current(info.GetIsolate()), info[1]); | 303 thisArg = ScriptValue(ScriptState::current(info.GetIsolate()), info[1]); |
| 323 } | 304 } |
| 324 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 305 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 325 impl->forEachForBinding(scriptState, ScriptValue(scriptState, info.Holder())
, callback, thisArg, exceptionState); | 306 impl->forEachForBinding(scriptState, ScriptValue(scriptState, info.Holder())
, callback, thisArg, exceptionState); |
| 326 if (exceptionState.hadException()) { | 307 if (exceptionState.hadException()) { |
| 327 exceptionState.throwIfNeeded(); | |
| 328 return; | 308 return; |
| 329 } | 309 } |
| 330 } | 310 } |
| 331 | 311 |
| 332 static void forEachMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
o) | 312 static void forEachMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
o) |
| 333 { | 313 { |
| 334 TestInterface2V8Internal::forEachMethod(info); | 314 TestInterface2V8Internal::forEachMethod(info); |
| 335 } | 315 } |
| 336 | 316 |
| 337 static void hasMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 317 static void hasMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 338 { | 318 { |
| 339 ExceptionState exceptionState(ExceptionState::ExecutionContext, "has", "Test
Interface2", info.Holder(), info.GetIsolate()); | 319 ExceptionState exceptionState(ExceptionState::ExecutionContext, "has", "Test
Interface2", info.Holder(), info.GetIsolate()); |
| 340 if (UNLIKELY(info.Length() < 1)) { | 320 if (UNLIKELY(info.Length() < 1)) { |
| 341 setMinimumArityTypeError(exceptionState, 1, info.Length()); | 321 setMinimumArityTypeError(exceptionState, 1, info.Length()); |
| 342 exceptionState.throwIfNeeded(); | |
| 343 return; | 322 return; |
| 344 } | 323 } |
| 345 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 324 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 346 TestInterfaceEmpty* value; | 325 TestInterfaceEmpty* value; |
| 347 { | 326 { |
| 348 value = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), inf
o[0]); | 327 value = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), inf
o[0]); |
| 349 if (!value) { | 328 if (!value) { |
| 350 exceptionState.throwTypeError("parameter 1 is not of type 'TestInter
faceEmpty'."); | 329 exceptionState.throwTypeError("parameter 1 is not of type 'TestInter
faceEmpty'."); |
| 351 exceptionState.throwIfNeeded(); | |
| 352 return; | 330 return; |
| 353 } | 331 } |
| 354 } | 332 } |
| 355 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 333 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 356 bool result = impl->hasForBinding(scriptState, value, exceptionState); | 334 bool result = impl->hasForBinding(scriptState, value, exceptionState); |
| 357 if (exceptionState.hadException()) { | 335 if (exceptionState.hadException()) { |
| 358 exceptionState.throwIfNeeded(); | |
| 359 return; | 336 return; |
| 360 } | 337 } |
| 361 v8SetReturnValueBool(info, result); | 338 v8SetReturnValueBool(info, result); |
| 362 } | 339 } |
| 363 | 340 |
| 364 static void hasMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) | 341 static void hasMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 365 { | 342 { |
| 366 TestInterface2V8Internal::hasMethod(info); | 343 TestInterface2V8Internal::hasMethod(info); |
| 367 } | 344 } |
| 368 | 345 |
| 369 static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 346 static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 370 { | 347 { |
| 371 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 348 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 372 v8SetReturnValueString(info, impl->stringifierMethod(), info.GetIsolate()); | 349 v8SetReturnValueString(info, impl->stringifierMethod(), info.GetIsolate()); |
| 373 } | 350 } |
| 374 | 351 |
| 375 static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) | 352 static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
| 376 { | 353 { |
| 377 TestInterface2V8Internal::toStringMethod(info); | 354 TestInterface2V8Internal::toStringMethod(info); |
| 378 } | 355 } |
| 379 | 356 |
| 380 static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 357 static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 381 { | 358 { |
| 382 ExceptionState exceptionState(ExceptionState::ExecutionContext, "iterator",
"TestInterface2", info.Holder(), info.GetIsolate()); | 359 ExceptionState exceptionState(ExceptionState::ExecutionContext, "iterator",
"TestInterface2", info.Holder(), info.GetIsolate()); |
| 383 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 360 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 384 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 361 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 385 Iterator* result = impl->iterator(scriptState, exceptionState); | 362 Iterator* result = impl->iterator(scriptState, exceptionState); |
| 386 if (exceptionState.hadException()) { | 363 if (exceptionState.hadException()) { |
| 387 exceptionState.throwIfNeeded(); | |
| 388 return; | 364 return; |
| 389 } | 365 } |
| 390 v8SetReturnValue(info, result); | 366 v8SetReturnValue(info, result); |
| 391 } | 367 } |
| 392 | 368 |
| 393 static void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) | 369 static void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
| 394 { | 370 { |
| 395 TestInterface2V8Internal::iteratorMethod(info); | 371 TestInterface2V8Internal::iteratorMethod(info); |
| 396 } | 372 } |
| 397 | 373 |
| 398 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) | 374 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 399 { | 375 { |
| 400 TestInterface2* impl = TestInterface2::create(); | 376 TestInterface2* impl = TestInterface2::create(); |
| 401 v8::Local<v8::Object> wrapper = info.Holder(); | 377 v8::Local<v8::Object> wrapper = info.Holder(); |
| 402 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterface2::w
rapperTypeInfo, wrapper); | 378 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterface2::w
rapperTypeInfo, wrapper); |
| 403 v8SetReturnValue(info, wrapper); | 379 v8SetReturnValue(info, wrapper); |
| 404 } | 380 } |
| 405 | 381 |
| 406 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) | 382 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) |
| 407 { | 383 { |
| 408 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 384 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 409 ExceptionState exceptionState(ExceptionState::IndexedGetterContext, "TestInt
erface2", info.Holder(), info.GetIsolate()); | 385 ExceptionState exceptionState(ExceptionState::IndexedGetterContext, "TestInt
erface2", info.Holder(), info.GetIsolate()); |
| 410 TestInterfaceEmpty* result = impl->item(index, exceptionState); | 386 TestInterfaceEmpty* result = impl->item(index, exceptionState); |
| 411 if (exceptionState.throwIfNeeded()) | 387 if (exceptionState.hadException()) |
| 412 return; | 388 return; |
| 413 if (!result) | 389 if (!result) |
| 414 return; | 390 return; |
| 415 v8SetReturnValueFast(info, result, impl); | 391 v8SetReturnValueFast(info, result, impl); |
| 416 } | 392 } |
| 417 | 393 |
| 418 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall
backInfo<v8::Value>& info) | 394 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall
backInfo<v8::Value>& info) |
| 419 { | 395 { |
| 420 TestInterface2V8Internal::indexedPropertyGetter(index, info); | 396 TestInterface2V8Internal::indexedPropertyGetter(index, info); |
| 421 } | 397 } |
| 422 | 398 |
| 423 static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value,
const v8::PropertyCallbackInfo<v8::Value>& info) | 399 static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value,
const v8::PropertyCallbackInfo<v8::Value>& info) |
| 424 { | 400 { |
| 425 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 401 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 426 TestInterfaceEmpty* propertyValue = V8TestInterfaceEmpty::toImplWithTypeChec
k(info.GetIsolate(), v8Value); | 402 TestInterfaceEmpty* propertyValue = V8TestInterfaceEmpty::toImplWithTypeChec
k(info.GetIsolate(), v8Value); |
| 427 ExceptionState exceptionState(ExceptionState::IndexedSetterContext, "TestInt
erface2", info.Holder(), info.GetIsolate()); | 403 ExceptionState exceptionState(ExceptionState::IndexedSetterContext, "TestInt
erface2", info.Holder(), info.GetIsolate()); |
| 428 if (!propertyValue) { | 404 if (!propertyValue) { |
| 429 exceptionState.throwTypeError("The provided value is not of type 'TestIn
terfaceEmpty'."); | 405 exceptionState.throwTypeError("The provided value is not of type 'TestIn
terfaceEmpty'."); |
| 430 exceptionState.throwIfNeeded(); | |
| 431 return; | 406 return; |
| 432 } | 407 } |
| 433 bool result = impl->setItem(index, propertyValue, exceptionState); | 408 bool result = impl->setItem(index, propertyValue, exceptionState); |
| 434 if (exceptionState.throwIfNeeded()) | 409 if (exceptionState.hadException()) |
| 435 return; | 410 return; |
| 436 if (!result) | 411 if (!result) |
| 437 return; | 412 return; |
| 438 v8SetReturnValue(info, v8Value); | 413 v8SetReturnValue(info, v8Value); |
| 439 } | 414 } |
| 440 | 415 |
| 441 static void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> v
8Value, const v8::PropertyCallbackInfo<v8::Value>& info) | 416 static void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> v
8Value, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 442 { | 417 { |
| 443 TestInterface2V8Internal::indexedPropertySetter(index, v8Value, info); | 418 TestInterface2V8Internal::indexedPropertySetter(index, v8Value, info); |
| 444 } | 419 } |
| 445 | 420 |
| 446 static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInf
o<v8::Boolean>& info) | 421 static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInf
o<v8::Boolean>& info) |
| 447 { | 422 { |
| 448 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 423 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 449 ExceptionState exceptionState(ExceptionState::IndexedDeletionContext, "TestI
nterface2", info.Holder(), info.GetIsolate()); | 424 ExceptionState exceptionState(ExceptionState::IndexedDeletionContext, "TestI
nterface2", info.Holder(), info.GetIsolate()); |
| 450 DeleteResult result = impl->deleteItem(index, exceptionState); | 425 DeleteResult result = impl->deleteItem(index, exceptionState); |
| 451 if (exceptionState.throwIfNeeded()) | 426 if (exceptionState.hadException()) |
| 452 return; | 427 return; |
| 453 if (result != DeleteUnknownProperty) | 428 if (result != DeleteUnknownProperty) |
| 454 return v8SetReturnValueBool(info, result == DeleteSuccess); | 429 return v8SetReturnValueBool(info, result == DeleteSuccess); |
| 455 } | 430 } |
| 456 | 431 |
| 457 static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCal
lbackInfo<v8::Boolean>& info) | 432 static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCal
lbackInfo<v8::Boolean>& info) |
| 458 { | 433 { |
| 459 TestInterface2V8Internal::indexedPropertyDeleter(index, info); | 434 TestInterface2V8Internal::indexedPropertyDeleter(index, info); |
| 460 } | 435 } |
| 461 | 436 |
| 462 static void namedPropertyGetter(v8::Local<v8::Name> name, const v8::PropertyCall
backInfo<v8::Value>& info) | 437 static void namedPropertyGetter(v8::Local<v8::Name> name, const v8::PropertyCall
backInfo<v8::Value>& info) |
| 463 { | 438 { |
| 464 auto nameString = name.As<v8::String>(); | 439 auto nameString = name.As<v8::String>(); |
| 465 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 440 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 466 AtomicString propertyName = toCoreAtomicString(nameString); | 441 AtomicString propertyName = toCoreAtomicString(nameString); |
| 467 v8::String::Utf8Value namedProperty(nameString); | 442 v8::String::Utf8Value namedProperty(nameString); |
| 468 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty,
"TestInterface2", info.Holder(), info.GetIsolate()); | 443 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty,
"TestInterface2", info.Holder(), info.GetIsolate()); |
| 469 TestInterfaceEmpty* result = impl->namedItem(propertyName, exceptionState); | 444 TestInterfaceEmpty* result = impl->namedItem(propertyName, exceptionState); |
| 470 if (exceptionState.throwIfNeeded()) | 445 if (exceptionState.hadException()) |
| 471 return; | 446 return; |
| 472 if (!result) | 447 if (!result) |
| 473 return; | 448 return; |
| 474 v8SetReturnValueFast(info, result, impl); | 449 v8SetReturnValueFast(info, result, impl); |
| 475 } | 450 } |
| 476 | 451 |
| 477 static void namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::Prop
ertyCallbackInfo<v8::Value>& info) | 452 static void namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::Prop
ertyCallbackInfo<v8::Value>& info) |
| 478 { | 453 { |
| 479 if (!name->IsString()) | 454 if (!name->IsString()) |
| 480 return; | 455 return; |
| 481 TestInterface2V8Internal::namedPropertyGetter(name, info); | 456 TestInterface2V8Internal::namedPropertyGetter(name, info); |
| 482 } | 457 } |
| 483 | 458 |
| 484 static void namedPropertySetter(v8::Local<v8::Name> name, v8::Local<v8::Value> v
8Value, const v8::PropertyCallbackInfo<v8::Value>& info) | 459 static void namedPropertySetter(v8::Local<v8::Name> name, v8::Local<v8::Value> v
8Value, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 485 { | 460 { |
| 486 auto nameString = name.As<v8::String>(); | 461 auto nameString = name.As<v8::String>(); |
| 487 v8::String::Utf8Value namedProperty(nameString); | 462 v8::String::Utf8Value namedProperty(nameString); |
| 488 ExceptionState exceptionState(ExceptionState::SetterContext, *namedProperty,
"TestInterface2", info.Holder(), info.GetIsolate()); | 463 ExceptionState exceptionState(ExceptionState::SetterContext, *namedProperty,
"TestInterface2", info.Holder(), info.GetIsolate()); |
| 489 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 464 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 490 V8StringResource<> propertyName(nameString); | 465 V8StringResource<> propertyName(nameString); |
| 491 if (!propertyName.prepare()) | 466 if (!propertyName.prepare()) |
| 492 return; | 467 return; |
| 493 TestInterfaceEmpty* propertyValue = V8TestInterfaceEmpty::toImplWithTypeChec
k(info.GetIsolate(), v8Value); | 468 TestInterfaceEmpty* propertyValue = V8TestInterfaceEmpty::toImplWithTypeChec
k(info.GetIsolate(), v8Value); |
| 494 if (!propertyValue && !isUndefinedOrNull(v8Value)) { | 469 if (!propertyValue && !isUndefinedOrNull(v8Value)) { |
| 495 exceptionState.throwTypeError("The provided value is not of type 'TestIn
terfaceEmpty'."); | 470 exceptionState.throwTypeError("The provided value is not of type 'TestIn
terfaceEmpty'."); |
| 496 exceptionState.throwIfNeeded(); | |
| 497 return; | 471 return; |
| 498 } | 472 } |
| 499 bool result = impl->setNamedItem(propertyName, propertyValue, exceptionState
); | 473 bool result = impl->setNamedItem(propertyName, propertyValue, exceptionState
); |
| 500 if (exceptionState.throwIfNeeded()) | 474 if (exceptionState.hadException()) |
| 501 return; | 475 return; |
| 502 if (!result) | 476 if (!result) |
| 503 return; | 477 return; |
| 504 v8SetReturnValue(info, v8Value); | 478 v8SetReturnValue(info, v8Value); |
| 505 } | 479 } |
| 506 | 480 |
| 507 static void namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::
Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) | 481 static void namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::
Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 508 { | 482 { |
| 509 if (!name->IsString()) | 483 if (!name->IsString()) |
| 510 return; | 484 return; |
| 511 TestInterface2V8Internal::namedPropertySetter(name, v8Value, info); | 485 TestInterface2V8Internal::namedPropertySetter(name, v8Value, info); |
| 512 } | 486 } |
| 513 | 487 |
| 514 static void namedPropertyQuery(v8::Local<v8::Name> name, const v8::PropertyCallb
ackInfo<v8::Integer>& info) | 488 static void namedPropertyQuery(v8::Local<v8::Name> name, const v8::PropertyCallb
ackInfo<v8::Integer>& info) |
| 515 { | 489 { |
| 516 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 490 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 517 AtomicString propertyName = toCoreAtomicString(name.As<v8::String>()); | 491 AtomicString propertyName = toCoreAtomicString(name.As<v8::String>()); |
| 518 v8::String::Utf8Value namedProperty(name); | 492 v8::String::Utf8Value namedProperty(name); |
| 519 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty,
"TestInterface2", info.Holder(), info.GetIsolate()); | 493 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty,
"TestInterface2", info.Holder(), info.GetIsolate()); |
| 520 bool result = impl->namedPropertyQuery(propertyName, exceptionState); | 494 bool result = impl->namedPropertyQuery(propertyName, exceptionState); |
| 521 if (exceptionState.throwIfNeeded()) | 495 if (exceptionState.hadException()) |
| 522 return; | 496 return; |
| 523 if (!result) | 497 if (!result) |
| 524 return; | 498 return; |
| 525 v8SetReturnValueInt(info, v8::None); | 499 v8SetReturnValueInt(info, v8::None); |
| 526 } | 500 } |
| 527 | 501 |
| 528 static void namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::Prope
rtyCallbackInfo<v8::Integer>& info) | 502 static void namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::Prope
rtyCallbackInfo<v8::Integer>& info) |
| 529 { | 503 { |
| 530 if (!name->IsString()) | 504 if (!name->IsString()) |
| 531 return; | 505 return; |
| 532 TestInterface2V8Internal::namedPropertyQuery(name, info); | 506 TestInterface2V8Internal::namedPropertyQuery(name, info); |
| 533 } | 507 } |
| 534 | 508 |
| 535 static void namedPropertyDeleter(v8::Local<v8::Name> name, const v8::PropertyCal
lbackInfo<v8::Boolean>& info) | 509 static void namedPropertyDeleter(v8::Local<v8::Name> name, const v8::PropertyCal
lbackInfo<v8::Boolean>& info) |
| 536 { | 510 { |
| 537 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 511 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 538 AtomicString propertyName = toCoreAtomicString(name.As<v8::String>()); | 512 AtomicString propertyName = toCoreAtomicString(name.As<v8::String>()); |
| 539 v8::String::Utf8Value namedProperty(name); | 513 v8::String::Utf8Value namedProperty(name); |
| 540 ExceptionState exceptionState(ExceptionState::DeletionContext, *namedPropert
y, "TestInterface2", info.Holder(), info.GetIsolate()); | 514 ExceptionState exceptionState(ExceptionState::DeletionContext, *namedPropert
y, "TestInterface2", info.Holder(), info.GetIsolate()); |
| 541 DeleteResult result = impl->deleteNamedItem(propertyName, exceptionState); | 515 DeleteResult result = impl->deleteNamedItem(propertyName, exceptionState); |
| 542 if (exceptionState.throwIfNeeded()) | 516 if (exceptionState.hadException()) |
| 543 return; | 517 return; |
| 544 if (result != DeleteUnknownProperty) | 518 if (result != DeleteUnknownProperty) |
| 545 return v8SetReturnValueBool(info, result == DeleteSuccess); | 519 return v8SetReturnValueBool(info, result == DeleteSuccess); |
| 546 } | 520 } |
| 547 | 521 |
| 548 static void namedPropertyDeleterCallback(v8::Local<v8::Name> name, const v8::Pro
pertyCallbackInfo<v8::Boolean>& info) | 522 static void namedPropertyDeleterCallback(v8::Local<v8::Name> name, const v8::Pro
pertyCallbackInfo<v8::Boolean>& info) |
| 549 { | 523 { |
| 550 if (!name->IsString()) | 524 if (!name->IsString()) |
| 551 return; | 525 return; |
| 552 TestInterface2V8Internal::namedPropertyDeleter(name, info); | 526 TestInterface2V8Internal::namedPropertyDeleter(name, info); |
| 553 } | 527 } |
| 554 | 528 |
| 555 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i
nfo) | 529 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i
nfo) |
| 556 { | 530 { |
| 557 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 531 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 558 Vector<String> names; | 532 Vector<String> names; |
| 559 ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestInter
face2", info.Holder(), info.GetIsolate()); | 533 ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestInter
face2", info.Holder(), info.GetIsolate()); |
| 560 impl->namedPropertyEnumerator(names, exceptionState); | 534 impl->namedPropertyEnumerator(names, exceptionState); |
| 561 if (exceptionState.throwIfNeeded()) | 535 if (exceptionState.hadException()) |
| 562 return; | 536 return; |
| 563 v8::Local<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size(
)); | 537 v8::Local<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size(
)); |
| 564 for (size_t i = 0; i < names.size(); ++i) { | 538 for (size_t i = 0; i < names.size(); ++i) { |
| 565 if (!v8CallBoolean(v8names->CreateDataProperty(info.GetIsolate()->GetCur
rentContext(), i, v8String(info.GetIsolate(), names[i])))) | 539 if (!v8CallBoolean(v8names->CreateDataProperty(info.GetIsolate()->GetCur
rentContext(), i, v8String(info.GetIsolate(), names[i])))) |
| 566 return; | 540 return; |
| 567 } | 541 } |
| 568 v8SetReturnValue(info, v8names); | 542 v8SetReturnValue(info, v8names); |
| 569 } | 543 } |
| 570 | 544 |
| 571 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A
rray>& info) | 545 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A
rray>& info) |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 InstallTemplateFunction V8TestInterface2::installV8TestInterface2TemplateFunctio
n = (InstallTemplateFunction)&V8TestInterface2::installV8TestInterface2Template; | 646 InstallTemplateFunction V8TestInterface2::installV8TestInterface2TemplateFunctio
n = (InstallTemplateFunction)&V8TestInterface2::installV8TestInterface2Template; |
| 673 | 647 |
| 674 void V8TestInterface2::updateWrapperTypeInfo(InstallTemplateFunction installTemp
lateFunction, PreparePrototypeAndInterfaceObjectFunction preparePrototypeAndInte
rfaceObjectFunction) | 648 void V8TestInterface2::updateWrapperTypeInfo(InstallTemplateFunction installTemp
lateFunction, PreparePrototypeAndInterfaceObjectFunction preparePrototypeAndInte
rfaceObjectFunction) |
| 675 { | 649 { |
| 676 V8TestInterface2::installV8TestInterface2TemplateFunction = installTemplateF
unction; | 650 V8TestInterface2::installV8TestInterface2TemplateFunction = installTemplateF
unction; |
| 677 if (preparePrototypeAndInterfaceObjectFunction) | 651 if (preparePrototypeAndInterfaceObjectFunction) |
| 678 V8TestInterface2::wrapperTypeInfo.preparePrototypeAndInterfaceObjectFunc
tion = preparePrototypeAndInterfaceObjectFunction; | 652 V8TestInterface2::wrapperTypeInfo.preparePrototypeAndInterfaceObjectFunc
tion = preparePrototypeAndInterfaceObjectFunction; |
| 679 } | 653 } |
| 680 | 654 |
| 681 } // namespace blink | 655 } // namespace blink |
| OLD | NEW |