| 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 "config.h" | 7 #include "config.h" |
| 8 #include "V8TestDictionary.h" | 8 #include "V8TestDictionary.h" |
| 9 | 9 |
| 10 #include "bindings/core/v8/ExceptionState.h" | 10 #include "bindings/core/v8/ExceptionState.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 if (block.HasCaught()) { | 123 if (block.HasCaught()) { |
| 124 exceptionState.rethrowV8Exception(block.Exception()); | 124 exceptionState.rethrowV8Exception(block.Exception()); |
| 125 return; | 125 return; |
| 126 } | 126 } |
| 127 if (enumMemberValue.IsEmpty() || enumMemberValue->IsUndefined()) { | 127 if (enumMemberValue.IsEmpty() || enumMemberValue->IsUndefined()) { |
| 128 // Do nothing. | 128 // Do nothing. |
| 129 } else { | 129 } else { |
| 130 V8StringResource<> enumMember = enumMemberValue; | 130 V8StringResource<> enumMember = enumMemberValue; |
| 131 if (!enumMember.prepare(exceptionState)) | 131 if (!enumMember.prepare(exceptionState)) |
| 132 return; | 132 return; |
| 133 String string = enumMember; | 133 const char* validValues[] = { |
| 134 if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" |
| string == "EnumValue3")) { | 134 "", |
| 135 exceptionState.throwTypeError("member enumMember ('" + string + "')
is not a valid enum value."); | 135 "EnumValue1", |
| 136 "EnumValue2", |
| 137 "EnumValue3", |
| 138 }; |
| 139 if (!isValidEnum(enumMember, validValues, 4)) { |
| 140 exceptionState.throwTypeError("member enumMember is not a valid enum
value."); |
| 136 return; | 141 return; |
| 137 } | 142 } |
| 138 impl.setEnumMember(enumMember); | 143 impl.setEnumMember(enumMember); |
| 139 } | 144 } |
| 140 | 145 |
| 141 v8::Local<v8::Value> eventTargetMemberValue = v8Object->Get(v8String(isolate
, "eventTargetMember")); | 146 v8::Local<v8::Value> eventTargetMemberValue = v8Object->Get(v8String(isolate
, "eventTargetMember")); |
| 142 if (block.HasCaught()) { | 147 if (block.HasCaught()) { |
| 143 exceptionState.rethrowV8Exception(block.Exception()); | 148 exceptionState.rethrowV8Exception(block.Exception()); |
| 144 return; | 149 return; |
| 145 } | 150 } |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 } | 595 } |
| 591 | 596 |
| 592 TestDictionary NativeValueTraits<TestDictionary>::nativeValue(v8::Isolate* isola
te, v8::Local<v8::Value> value, ExceptionState& exceptionState) | 597 TestDictionary NativeValueTraits<TestDictionary>::nativeValue(v8::Isolate* isola
te, v8::Local<v8::Value> value, ExceptionState& exceptionState) |
| 593 { | 598 { |
| 594 TestDictionary impl; | 599 TestDictionary impl; |
| 595 V8TestDictionary::toImpl(isolate, value, impl, exceptionState); | 600 V8TestDictionary::toImpl(isolate, value, impl, exceptionState); |
| 596 return impl; | 601 return impl; |
| 597 } | 602 } |
| 598 | 603 |
| 599 } // namespace blink | 604 } // namespace blink |
| OLD | NEW |