OLD | NEW |
1 {##############################################################################} | 1 {##############################################################################} |
2 {% macro attribute_getter(attribute, world_suffix) %} | 2 {% macro attribute_getter(attribute, world_suffix) %} |
3 {% filter conditional(attribute.conditional_string) %} | 3 {% filter conditional(attribute.conditional_string) %} |
4 static void {{attribute.name}}AttributeGetter{{world_suffix}}( | 4 static void {{attribute.name}}AttributeGetter{{world_suffix}}( |
5 {%- if attribute.is_expose_js_accessors %} | 5 {%- if attribute.is_expose_js_accessors %} |
6 const v8::FunctionCallbackInfo<v8::Value>& info | 6 const v8::FunctionCallbackInfo<v8::Value>& info |
7 {%- else %} | 7 {%- else %} |
8 const v8::PropertyCallbackInfo<v8::Value>& info | 8 const v8::PropertyCallbackInfo<v8::Value>& info |
9 {%- endif %}) | 9 {%- endif %}) |
10 { | 10 { |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 return false; | 352 return false; |
353 ScriptState* scriptState = ScriptState::from(context); | 353 ScriptState* scriptState = ScriptState::from(context); |
354 if (!scriptState->executionContext()) | 354 if (!scriptState->executionContext()) |
355 return false; | 355 return false; |
356 | 356 |
357 ScriptState::Scope scope(scriptState); | 357 ScriptState::Scope scope(scriptState); |
358 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 358 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
359 | 359 |
360 ExceptionState exceptionState(ExceptionState::GetterContext, "{{attribute.na
me}}", "{{cpp_class}}", scriptState->context()->Global(), scriptState->isolate()
); | 360 ExceptionState exceptionState(ExceptionState::GetterContext, "{{attribute.na
me}}", "{{cpp_class}}", scriptState->context()->Global(), scriptState->isolate()
); |
361 v8::TryCatch block; | 361 v8::TryCatch block; |
| 362 #ifndef NDEBUG |
| 363 block.SetVerbose(true); |
| 364 #endif |
362 V8RethrowTryCatchScope rethrow(block); | 365 V8RethrowTryCatchScope rethrow(block); |
363 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s
criptState, "{{cpp_class}}", "{{attribute.name}}", holder); | 366 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s
criptState, "{{cpp_class}}", "{{attribute.name}}", holder); |
364 if (block.HasCaught()) { | 367 if (block.HasCaught()) { |
365 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { | 368 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { |
366 // FIXME: We should support exceptions other than DOM exceptions. | 369 // FIXME: We should support exceptions other than DOM exceptions. |
367 RELEASE_ASSERT_NOT_REACHED(); | 370 RELEASE_ASSERT_NOT_REACHED(); |
368 } | 371 } |
369 return false; | 372 return false; |
370 } | 373 } |
371 {{attribute.private_script_v8_value_to_local_cpp_value}}; | 374 {{attribute.private_script_v8_value_to_local_cpp_value}}; |
(...skipping 16 matching lines...) Expand all Loading... |
388 return false; | 391 return false; |
389 ScriptState* scriptState = ScriptState::from(context); | 392 ScriptState* scriptState = ScriptState::from(context); |
390 if (!scriptState->executionContext()) | 393 if (!scriptState->executionContext()) |
391 return false; | 394 return false; |
392 | 395 |
393 ScriptState::Scope scope(scriptState); | 396 ScriptState::Scope scope(scriptState); |
394 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 397 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
395 | 398 |
396 ExceptionState exceptionState(ExceptionState::SetterContext, "{{attribute.na
me}}", "{{cpp_class}}", scriptState->context()->Global(), scriptState->isolate()
); | 399 ExceptionState exceptionState(ExceptionState::SetterContext, "{{attribute.na
me}}", "{{cpp_class}}", scriptState->context()->Global(), scriptState->isolate()
); |
397 v8::TryCatch block; | 400 v8::TryCatch block; |
| 401 #ifndef NDEBUG |
| 402 block.SetVerbose(true); |
| 403 #endif |
398 V8RethrowTryCatchScope rethrow(block); | 404 V8RethrowTryCatchScope rethrow(block); |
399 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "{{cpp_class}}", "{{
attribute.name}}", holder, {{attribute.private_script_cpp_value_to_v8_value}}); | 405 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "{{cpp_class}}", "{{
attribute.name}}", holder, {{attribute.private_script_cpp_value_to_v8_value}}); |
400 if (block.HasCaught()) { | 406 if (block.HasCaught()) { |
401 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { | 407 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { |
402 // FIXME: We should support exceptions other than DOM exceptions. | 408 // FIXME: We should support exceptions other than DOM exceptions. |
403 RELEASE_ASSERT_NOT_REACHED(); | 409 RELEASE_ASSERT_NOT_REACHED(); |
404 } | 410 } |
405 return false; | 411 return false; |
406 } | 412 } |
407 return true; | 413 return true; |
408 } | 414 } |
409 {% endmacro %} | 415 {% endmacro %} |
OLD | NEW |