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 "bindings/core/v8/UnionTypesCore.h" | 8 #include "bindings/core/v8/UnionTypesCore.h" |
9 | 9 |
10 #include "bindings/core/v8/Dictionary.h" | 10 #include "bindings/core/v8/Dictionary.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 return; | 107 return; |
108 } | 108 } |
109 | 109 |
110 if (V8ArrayBufferView::hasInstance(v8Value, isolate)) { | 110 if (V8ArrayBufferView::hasInstance(v8Value, isolate)) { |
111 RefPtr<TestArrayBufferView> cppValue = V8ArrayBufferView::toImpl(v8::Loc
al<v8::Object>::Cast(v8Value)); | 111 RefPtr<TestArrayBufferView> cppValue = V8ArrayBufferView::toImpl(v8::Loc
al<v8::Object>::Cast(v8Value)); |
112 impl.setArrayBufferView(cppValue); | 112 impl.setArrayBufferView(cppValue); |
113 return; | 113 return; |
114 } | 114 } |
115 | 115 |
116 if (isUndefinedOrNull(v8Value) || v8Value->IsObject()) { | 116 if (isUndefinedOrNull(v8Value) || v8Value->IsObject()) { |
117 TONATIVE_VOID_EXCEPTIONSTATE(Dictionary, cppValue, Dictionary(v8Value, i
solate, exceptionState), exceptionState); | 117 Dictionary cppValue = Dictionary(v8Value, isolate, exceptionState); |
| 118 if (exceptionState.hadException()) |
| 119 return; |
118 impl.setDictionary(cppValue); | 120 impl.setDictionary(cppValue); |
119 return; | 121 return; |
120 } | 122 } |
121 | 123 |
122 exceptionState.throwTypeError("The provided value is not of type '(ArrayBuff
er or ArrayBufferView or Dictionary)'"); | 124 exceptionState.throwTypeError("The provided value is not of type '(ArrayBuff
er or ArrayBufferView or Dictionary)'"); |
123 } | 125 } |
124 | 126 |
125 v8::Local<v8::Value> toV8(const ArrayBufferOrArrayBufferViewOrDictionary& impl,
v8::Local<v8::Object> creationContext, v8::Isolate* isolate) | 127 v8::Local<v8::Value> toV8(const ArrayBufferOrArrayBufferViewOrDictionary& impl,
v8::Local<v8::Object> creationContext, v8::Isolate* isolate) |
126 { | 128 { |
127 switch (impl.m_type) { | 129 switch (impl.m_type) { |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 { | 217 { |
216 if (v8Value.IsEmpty()) | 218 if (v8Value.IsEmpty()) |
217 return; | 219 return; |
218 | 220 |
219 if (v8Value->IsBoolean()) { | 221 if (v8Value->IsBoolean()) { |
220 impl.setBoolean(v8Value->ToBoolean()->Value()); | 222 impl.setBoolean(v8Value->ToBoolean()->Value()); |
221 return; | 223 return; |
222 } | 224 } |
223 | 225 |
224 if (v8Value->IsNumber()) { | 226 if (v8Value->IsNumber()) { |
225 TONATIVE_VOID_EXCEPTIONSTATE(double, cppValue, toDouble(v8Value, excepti
onState), exceptionState); | 227 double cppValue = toDouble(v8Value, exceptionState); |
| 228 if (exceptionState.hadException()) |
| 229 return; |
226 impl.setUnrestrictedDouble(cppValue); | 230 impl.setUnrestrictedDouble(cppValue); |
227 return; | 231 return; |
228 } | 232 } |
229 | 233 |
230 { | 234 { |
231 TOSTRING_VOID_EXCEPTIONSTATE(V8StringResource<>, cppValue, v8Value, exce
ptionState); | 235 V8StringResource<> cppValue = v8Value; |
| 236 if (!cppValue.prepare(exceptionState)) |
| 237 return; |
232 impl.setString(cppValue); | 238 impl.setString(cppValue); |
233 return; | 239 return; |
234 } | 240 } |
235 | 241 |
236 } | 242 } |
237 | 243 |
238 v8::Local<v8::Value> toV8(const BooleanOrStringOrUnrestrictedDouble& impl, v8::L
ocal<v8::Object> creationContext, v8::Isolate* isolate) | 244 v8::Local<v8::Value> toV8(const BooleanOrStringOrUnrestrictedDouble& impl, v8::L
ocal<v8::Object> creationContext, v8::Isolate* isolate) |
239 { | 245 { |
240 switch (impl.m_type) { | 246 switch (impl.m_type) { |
241 case BooleanOrStringOrUnrestrictedDouble::SpecificTypeNone: | 247 case BooleanOrStringOrUnrestrictedDouble::SpecificTypeNone: |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 container.setString(value); | 309 container.setString(value); |
304 return container; | 310 return container; |
305 } | 311 } |
306 | 312 |
307 void V8DoubleOrString::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value
, DoubleOrString& impl, ExceptionState& exceptionState) | 313 void V8DoubleOrString::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value
, DoubleOrString& impl, ExceptionState& exceptionState) |
308 { | 314 { |
309 if (v8Value.IsEmpty()) | 315 if (v8Value.IsEmpty()) |
310 return; | 316 return; |
311 | 317 |
312 if (v8Value->IsNumber()) { | 318 if (v8Value->IsNumber()) { |
313 TONATIVE_VOID_EXCEPTIONSTATE(double, cppValue, toRestrictedDouble(v8Valu
e, exceptionState), exceptionState); | 319 double cppValue = toRestrictedDouble(v8Value, exceptionState); |
| 320 if (exceptionState.hadException()) |
| 321 return; |
314 impl.setDouble(cppValue); | 322 impl.setDouble(cppValue); |
315 return; | 323 return; |
316 } | 324 } |
317 | 325 |
318 { | 326 { |
319 TOSTRING_VOID_EXCEPTIONSTATE(V8StringResource<>, cppValue, v8Value, exce
ptionState); | 327 V8StringResource<> cppValue = v8Value; |
| 328 if (!cppValue.prepare(exceptionState)) |
| 329 return; |
320 impl.setString(cppValue); | 330 impl.setString(cppValue); |
321 return; | 331 return; |
322 } | 332 } |
323 | 333 |
324 } | 334 } |
325 | 335 |
326 v8::Local<v8::Value> toV8(const DoubleOrString& impl, v8::Local<v8::Object> crea
tionContext, v8::Isolate* isolate) | 336 v8::Local<v8::Value> toV8(const DoubleOrString& impl, v8::Local<v8::Object> crea
tionContext, v8::Isolate* isolate) |
327 { | 337 { |
328 switch (impl.m_type) { | 338 switch (impl.m_type) { |
329 case DoubleOrString::SpecificTypeNone: | 339 case DoubleOrString::SpecificTypeNone: |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 return; | 524 return; |
515 } | 525 } |
516 | 526 |
517 if (V8ArrayBufferView::hasInstance(v8Value, isolate)) { | 527 if (V8ArrayBufferView::hasInstance(v8Value, isolate)) { |
518 RefPtr<TestArrayBufferView> cppValue = V8ArrayBufferView::toImpl(v8::Loc
al<v8::Object>::Cast(v8Value)); | 528 RefPtr<TestArrayBufferView> cppValue = V8ArrayBufferView::toImpl(v8::Loc
al<v8::Object>::Cast(v8Value)); |
519 impl.setArrayBufferView(cppValue); | 529 impl.setArrayBufferView(cppValue); |
520 return; | 530 return; |
521 } | 531 } |
522 | 532 |
523 { | 533 { |
524 TOSTRING_VOID_EXCEPTIONSTATE(V8StringResource<>, cppValue, v8Value, exce
ptionState); | 534 V8StringResource<> cppValue = v8Value; |
| 535 if (!cppValue.prepare(exceptionState)) |
| 536 return; |
525 impl.setString(cppValue); | 537 impl.setString(cppValue); |
526 return; | 538 return; |
527 } | 539 } |
528 | 540 |
529 } | 541 } |
530 | 542 |
531 v8::Local<v8::Value> toV8(const StringOrArrayBufferOrArrayBufferView& impl, v8::
Local<v8::Object> creationContext, v8::Isolate* isolate) | 543 v8::Local<v8::Value> toV8(const StringOrArrayBufferOrArrayBufferView& impl, v8::
Local<v8::Object> creationContext, v8::Isolate* isolate) |
532 { | 544 { |
533 switch (impl.m_type) { | 545 switch (impl.m_type) { |
534 case StringOrArrayBufferOrArrayBufferView::SpecificTypeNone: | 546 case StringOrArrayBufferOrArrayBufferView::SpecificTypeNone: |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 container.setDouble(value); | 608 container.setDouble(value); |
597 return container; | 609 return container; |
598 } | 610 } |
599 | 611 |
600 void V8StringOrDouble::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value
, StringOrDouble& impl, ExceptionState& exceptionState) | 612 void V8StringOrDouble::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value
, StringOrDouble& impl, ExceptionState& exceptionState) |
601 { | 613 { |
602 if (v8Value.IsEmpty()) | 614 if (v8Value.IsEmpty()) |
603 return; | 615 return; |
604 | 616 |
605 if (v8Value->IsNumber()) { | 617 if (v8Value->IsNumber()) { |
606 TONATIVE_VOID_EXCEPTIONSTATE(double, cppValue, toRestrictedDouble(v8Valu
e, exceptionState), exceptionState); | 618 double cppValue = toRestrictedDouble(v8Value, exceptionState); |
| 619 if (exceptionState.hadException()) |
| 620 return; |
607 impl.setDouble(cppValue); | 621 impl.setDouble(cppValue); |
608 return; | 622 return; |
609 } | 623 } |
610 | 624 |
611 { | 625 { |
612 TOSTRING_VOID_EXCEPTIONSTATE(V8StringResource<>, cppValue, v8Value, exce
ptionState); | 626 V8StringResource<> cppValue = v8Value; |
| 627 if (!cppValue.prepare(exceptionState)) |
| 628 return; |
613 impl.setString(cppValue); | 629 impl.setString(cppValue); |
614 return; | 630 return; |
615 } | 631 } |
616 | 632 |
617 } | 633 } |
618 | 634 |
619 v8::Local<v8::Value> toV8(const StringOrDouble& impl, v8::Local<v8::Object> crea
tionContext, v8::Isolate* isolate) | 635 v8::Local<v8::Value> toV8(const StringOrDouble& impl, v8::Local<v8::Object> crea
tionContext, v8::Isolate* isolate) |
620 { | 636 { |
621 switch (impl.m_type) { | 637 switch (impl.m_type) { |
622 case StringOrDouble::SpecificTypeNone: | 638 case StringOrDouble::SpecificTypeNone: |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 container.setStringSequence(value); | 698 container.setStringSequence(value); |
683 return container; | 699 return container; |
684 } | 700 } |
685 | 701 |
686 void V8StringOrStringSequence::toImpl(v8::Isolate* isolate, v8::Local<v8::Value>
v8Value, StringOrStringSequence& impl, ExceptionState& exceptionState) | 702 void V8StringOrStringSequence::toImpl(v8::Isolate* isolate, v8::Local<v8::Value>
v8Value, StringOrStringSequence& impl, ExceptionState& exceptionState) |
687 { | 703 { |
688 if (v8Value.IsEmpty()) | 704 if (v8Value.IsEmpty()) |
689 return; | 705 return; |
690 | 706 |
691 if (v8Value->IsArray()) { | 707 if (v8Value->IsArray()) { |
692 TONATIVE_VOID_EXCEPTIONSTATE(Vector<String>, cppValue, toImplArray<Strin
g>(v8Value, 0, isolate, exceptionState), exceptionState); | 708 Vector<String> cppValue = toImplArray<String>(v8Value, 0, isolate, excep
tionState); |
| 709 if (exceptionState.hadException()) |
| 710 return; |
693 impl.setStringSequence(cppValue); | 711 impl.setStringSequence(cppValue); |
694 return; | 712 return; |
695 } | 713 } |
696 | 714 |
697 { | 715 { |
698 TOSTRING_VOID_EXCEPTIONSTATE(V8StringResource<>, cppValue, v8Value, exce
ptionState); | 716 V8StringResource<> cppValue = v8Value; |
| 717 if (!cppValue.prepare(exceptionState)) |
| 718 return; |
699 impl.setString(cppValue); | 719 impl.setString(cppValue); |
700 return; | 720 return; |
701 } | 721 } |
702 | 722 |
703 } | 723 } |
704 | 724 |
705 v8::Local<v8::Value> toV8(const StringOrStringSequence& impl, v8::Local<v8::Obje
ct> creationContext, v8::Isolate* isolate) | 725 v8::Local<v8::Value> toV8(const StringOrStringSequence& impl, v8::Local<v8::Obje
ct> creationContext, v8::Isolate* isolate) |
706 { | 726 { |
707 switch (impl.m_type) { | 727 switch (impl.m_type) { |
708 case StringOrStringSequence::SpecificTypeNone: | 728 case StringOrStringSequence::SpecificTypeNone: |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 container.setDouble(value); | 793 container.setDouble(value); |
774 return container; | 794 return container; |
775 } | 795 } |
776 | 796 |
777 void V8TestEnumOrDouble::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Val
ue, TestEnumOrDouble& impl, ExceptionState& exceptionState) | 797 void V8TestEnumOrDouble::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Val
ue, TestEnumOrDouble& impl, ExceptionState& exceptionState) |
778 { | 798 { |
779 if (v8Value.IsEmpty()) | 799 if (v8Value.IsEmpty()) |
780 return; | 800 return; |
781 | 801 |
782 if (v8Value->IsNumber()) { | 802 if (v8Value->IsNumber()) { |
783 TONATIVE_VOID_EXCEPTIONSTATE(double, cppValue, toRestrictedDouble(v8Valu
e, exceptionState), exceptionState); | 803 double cppValue = toRestrictedDouble(v8Value, exceptionState); |
| 804 if (exceptionState.hadException()) |
| 805 return; |
784 impl.setDouble(cppValue); | 806 impl.setDouble(cppValue); |
785 return; | 807 return; |
786 } | 808 } |
787 | 809 |
788 { | 810 { |
789 TOSTRING_VOID_EXCEPTIONSTATE(V8StringResource<>, cppValue, v8Value, exce
ptionState); | 811 V8StringResource<> cppValue = v8Value; |
| 812 if (!cppValue.prepare(exceptionState)) |
| 813 return; |
790 String string = cppValue; | 814 String string = cppValue; |
791 if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" |
| string == "EnumValue3")) { | 815 if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" |
| string == "EnumValue3")) { |
792 exceptionState.throwTypeError("'" + string + "' is not a valid enum
value."); | 816 exceptionState.throwTypeError("'" + string + "' is not a valid enum
value."); |
793 return; | 817 return; |
794 } | 818 } |
795 impl.setTestEnum(cppValue); | 819 impl.setTestEnum(cppValue); |
796 return; | 820 return; |
797 } | 821 } |
798 | 822 |
799 } | 823 } |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
962 if (v8Value.IsEmpty()) | 986 if (v8Value.IsEmpty()) |
963 return; | 987 return; |
964 | 988 |
965 if (V8TestInterfaceGarbageCollected::hasInstance(v8Value, isolate)) { | 989 if (V8TestInterfaceGarbageCollected::hasInstance(v8Value, isolate)) { |
966 RawPtr<TestInterfaceGarbageCollected> cppValue = V8TestInterfaceGarbageC
ollected::toImpl(v8::Local<v8::Object>::Cast(v8Value)); | 990 RawPtr<TestInterfaceGarbageCollected> cppValue = V8TestInterfaceGarbageC
ollected::toImpl(v8::Local<v8::Object>::Cast(v8Value)); |
967 impl.setTestInterfaceGarbageCollected(cppValue); | 991 impl.setTestInterfaceGarbageCollected(cppValue); |
968 return; | 992 return; |
969 } | 993 } |
970 | 994 |
971 { | 995 { |
972 TOSTRING_VOID_EXCEPTIONSTATE(V8StringResource<>, cppValue, v8Value, exce
ptionState); | 996 V8StringResource<> cppValue = v8Value; |
| 997 if (!cppValue.prepare(exceptionState)) |
| 998 return; |
973 impl.setString(cppValue); | 999 impl.setString(cppValue); |
974 return; | 1000 return; |
975 } | 1001 } |
976 | 1002 |
977 } | 1003 } |
978 | 1004 |
979 v8::Local<v8::Value> toV8(const TestInterfaceGarbageCollectedOrString& impl, v8:
:Local<v8::Object> creationContext, v8::Isolate* isolate) | 1005 v8::Local<v8::Value> toV8(const TestInterfaceGarbageCollectedOrString& impl, v8:
:Local<v8::Object> creationContext, v8::Isolate* isolate) |
980 { | 1006 { |
981 switch (impl.m_type) { | 1007 switch (impl.m_type) { |
982 case TestInterfaceGarbageCollectedOrString::SpecificTypeNone: | 1008 case TestInterfaceGarbageCollectedOrString::SpecificTypeNone: |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1048 if (v8Value.IsEmpty()) | 1074 if (v8Value.IsEmpty()) |
1049 return; | 1075 return; |
1050 | 1076 |
1051 if (V8TestInterface::hasInstance(v8Value, isolate)) { | 1077 if (V8TestInterface::hasInstance(v8Value, isolate)) { |
1052 RefPtr<TestInterfaceImplementation> cppValue = V8TestInterface::toImpl(v
8::Local<v8::Object>::Cast(v8Value)); | 1078 RefPtr<TestInterfaceImplementation> cppValue = V8TestInterface::toImpl(v
8::Local<v8::Object>::Cast(v8Value)); |
1053 impl.setTestInterface(cppValue); | 1079 impl.setTestInterface(cppValue); |
1054 return; | 1080 return; |
1055 } | 1081 } |
1056 | 1082 |
1057 if (v8Value->IsNumber()) { | 1083 if (v8Value->IsNumber()) { |
1058 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionSt
ate), exceptionState); | 1084 int cppValue = toInt32(v8Value, exceptionState); |
| 1085 if (exceptionState.hadException()) |
| 1086 return; |
1059 impl.setLong(cppValue); | 1087 impl.setLong(cppValue); |
1060 return; | 1088 return; |
1061 } | 1089 } |
1062 | 1090 |
1063 { | 1091 { |
1064 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionSt
ate), exceptionState); | 1092 int cppValue = toInt32(v8Value, exceptionState); |
| 1093 if (exceptionState.hadException()) |
| 1094 return; |
1065 impl.setLong(cppValue); | 1095 impl.setLong(cppValue); |
1066 return; | 1096 return; |
1067 } | 1097 } |
1068 | 1098 |
1069 } | 1099 } |
1070 | 1100 |
1071 v8::Local<v8::Value> toV8(const TestInterfaceOrLong& impl, v8::Local<v8::Object>
creationContext, v8::Isolate* isolate) | 1101 v8::Local<v8::Value> toV8(const TestInterfaceOrLong& impl, v8::Local<v8::Object>
creationContext, v8::Isolate* isolate) |
1072 { | 1102 { |
1073 switch (impl.m_type) { | 1103 switch (impl.m_type) { |
1074 case TestInterfaceOrLong::SpecificTypeNone: | 1104 case TestInterfaceOrLong::SpecificTypeNone: |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1234 return; | 1264 return; |
1235 | 1265 |
1236 if (V8TestInterfaceWillBeGarbageCollected::hasInstance(v8Value, isolate)) { | 1266 if (V8TestInterfaceWillBeGarbageCollected::hasInstance(v8Value, isolate)) { |
1237 RefPtrWillBeRawPtr<TestInterfaceWillBeGarbageCollected> cppValue = V8Tes
tInterfaceWillBeGarbageCollected::toImpl(v8::Local<v8::Object>::Cast(v8Value)); | 1267 RefPtrWillBeRawPtr<TestInterfaceWillBeGarbageCollected> cppValue = V8Tes
tInterfaceWillBeGarbageCollected::toImpl(v8::Local<v8::Object>::Cast(v8Value)); |
1238 impl.setTestInterfaceWillBeGarbageCollected(cppValue); | 1268 impl.setTestInterfaceWillBeGarbageCollected(cppValue); |
1239 return; | 1269 return; |
1240 } | 1270 } |
1241 | 1271 |
1242 if (isUndefinedOrNull(v8Value) || v8Value->IsObject()) { | 1272 if (isUndefinedOrNull(v8Value) || v8Value->IsObject()) { |
1243 TestDictionary cppValue; | 1273 TestDictionary cppValue; |
1244 TONATIVE_VOID_EXCEPTIONSTATE_ARGINTERNAL(V8TestDictionary::toImpl(isolat
e, v8Value, cppValue, exceptionState), exceptionState); | 1274 V8TestDictionary::toImpl(isolate, v8Value, cppValue, exceptionState); |
| 1275 if (exceptionState.hadException()) |
| 1276 return; |
1245 impl.setTestDictionary(cppValue); | 1277 impl.setTestDictionary(cppValue); |
1246 return; | 1278 return; |
1247 } | 1279 } |
1248 | 1280 |
1249 exceptionState.throwTypeError("The provided value is not of type '(TestInter
faceWillBeGarbageCollected or TestDictionary)'"); | 1281 exceptionState.throwTypeError("The provided value is not of type '(TestInter
faceWillBeGarbageCollected or TestDictionary)'"); |
1250 } | 1282 } |
1251 | 1283 |
1252 v8::Local<v8::Value> toV8(const TestInterfaceWillBeGarbageCollectedOrTestDiction
ary& impl, v8::Local<v8::Object> creationContext, v8::Isolate* isolate) | 1284 v8::Local<v8::Value> toV8(const TestInterfaceWillBeGarbageCollectedOrTestDiction
ary& impl, v8::Local<v8::Object> creationContext, v8::Isolate* isolate) |
1253 { | 1285 { |
1254 switch (impl.m_type) { | 1286 switch (impl.m_type) { |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1315 container.setString(value); | 1347 container.setString(value); |
1316 return container; | 1348 return container; |
1317 } | 1349 } |
1318 | 1350 |
1319 void V8UnrestrictedDoubleOrString::toImpl(v8::Isolate* isolate, v8::Local<v8::Va
lue> v8Value, UnrestrictedDoubleOrString& impl, ExceptionState& exceptionState) | 1351 void V8UnrestrictedDoubleOrString::toImpl(v8::Isolate* isolate, v8::Local<v8::Va
lue> v8Value, UnrestrictedDoubleOrString& impl, ExceptionState& exceptionState) |
1320 { | 1352 { |
1321 if (v8Value.IsEmpty()) | 1353 if (v8Value.IsEmpty()) |
1322 return; | 1354 return; |
1323 | 1355 |
1324 if (v8Value->IsNumber()) { | 1356 if (v8Value->IsNumber()) { |
1325 TONATIVE_VOID_EXCEPTIONSTATE(double, cppValue, toDouble(v8Value, excepti
onState), exceptionState); | 1357 double cppValue = toDouble(v8Value, exceptionState); |
| 1358 if (exceptionState.hadException()) |
| 1359 return; |
1326 impl.setUnrestrictedDouble(cppValue); | 1360 impl.setUnrestrictedDouble(cppValue); |
1327 return; | 1361 return; |
1328 } | 1362 } |
1329 | 1363 |
1330 { | 1364 { |
1331 TOSTRING_VOID_EXCEPTIONSTATE(V8StringResource<>, cppValue, v8Value, exce
ptionState); | 1365 V8StringResource<> cppValue = v8Value; |
| 1366 if (!cppValue.prepare(exceptionState)) |
| 1367 return; |
1332 impl.setString(cppValue); | 1368 impl.setString(cppValue); |
1333 return; | 1369 return; |
1334 } | 1370 } |
1335 | 1371 |
1336 } | 1372 } |
1337 | 1373 |
1338 v8::Local<v8::Value> toV8(const UnrestrictedDoubleOrString& impl, v8::Local<v8::
Object> creationContext, v8::Isolate* isolate) | 1374 v8::Local<v8::Value> toV8(const UnrestrictedDoubleOrString& impl, v8::Local<v8::
Object> creationContext, v8::Isolate* isolate) |
1339 { | 1375 { |
1340 switch (impl.m_type) { | 1376 switch (impl.m_type) { |
1341 case UnrestrictedDoubleOrString::SpecificTypeNone: | 1377 case UnrestrictedDoubleOrString::SpecificTypeNone: |
1342 return v8::Null(isolate); | 1378 return v8::Null(isolate); |
1343 case UnrestrictedDoubleOrString::SpecificTypeUnrestrictedDouble: | 1379 case UnrestrictedDoubleOrString::SpecificTypeUnrestrictedDouble: |
1344 return v8::Number::New(isolate, impl.getAsUnrestrictedDouble()); | 1380 return v8::Number::New(isolate, impl.getAsUnrestrictedDouble()); |
1345 case UnrestrictedDoubleOrString::SpecificTypeString: | 1381 case UnrestrictedDoubleOrString::SpecificTypeString: |
1346 return v8String(isolate, impl.getAsString()); | 1382 return v8String(isolate, impl.getAsString()); |
1347 default: | 1383 default: |
1348 ASSERT_NOT_REACHED(); | 1384 ASSERT_NOT_REACHED(); |
1349 } | 1385 } |
1350 return v8::Local<v8::Value>(); | 1386 return v8::Local<v8::Value>(); |
1351 } | 1387 } |
1352 | 1388 |
1353 UnrestrictedDoubleOrString NativeValueTraits<UnrestrictedDoubleOrString>::native
Value(const v8::Local<v8::Value>& value, v8::Isolate* isolate, ExceptionState& e
xceptionState) | 1389 UnrestrictedDoubleOrString NativeValueTraits<UnrestrictedDoubleOrString>::native
Value(const v8::Local<v8::Value>& value, v8::Isolate* isolate, ExceptionState& e
xceptionState) |
1354 { | 1390 { |
1355 UnrestrictedDoubleOrString impl; | 1391 UnrestrictedDoubleOrString impl; |
1356 V8UnrestrictedDoubleOrString::toImpl(isolate, value, impl, exceptionState); | 1392 V8UnrestrictedDoubleOrString::toImpl(isolate, value, impl, exceptionState); |
1357 return impl; | 1393 return impl; |
1358 } | 1394 } |
1359 | 1395 |
1360 } // namespace blink | 1396 } // namespace blink |
OLD | NEW |