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}}. DO NOT MODIFY! | 5 // This file has been auto-generated by {{code_generator}}. DO NOT MODIFY! |
6 | 6 |
7 #include "config.h" | 7 #include "config.h" |
8 #include "{{header_filename}}" | 8 #include "{{header_filename}}" |
9 | 9 |
10 {% macro assign_and_return_if_hasinstance(member) %} | 10 {% macro assign_and_return_if_hasinstance(member) %} |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
124 return; | 124 return; |
125 } | 125 } |
126 | 126 |
127 {# 18. Boolean (fallback) #} | 127 {# 18. Boolean (fallback) #} |
128 {% elif container.boolean_type %} | 128 {% elif container.boolean_type %} |
129 { | 129 { |
130 impl.setBoolean(v8Value->ToBoolean()->Value()); | 130 impl.setBoolean(v8Value->ToBoolean()->Value()); |
131 return; | 131 return; |
132 } | 132 } |
133 | 133 |
134 {% endif %} | 134 {% else %} |
135 {# 19. TypeError #} | 135 {# 19. TypeError #} |
136 exceptionState.throwTypeError("Not a valid union member."); | 136 exceptionState.throwTypeError("Not a valid union member."); |
haraken
2014/11/07 00:06:36
I guess we unconditionally need exceptionState.thr
bashi
2014/11/07 00:24:07
When I implement this, I thought we need to make t
haraken
2014/11/07 01:15:33
Makes sense, thanks!
| |
137 {% endif %} | |
137 } | 138 } |
138 | 139 |
139 v8::Handle<v8::Value> toV8({{container.cpp_class}}& impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) | 140 v8::Handle<v8::Value> toV8({{container.cpp_class}}& impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
140 { | 141 { |
141 {# FIXME: We might want to return undefined in some cases #} | 142 {# FIXME: We might want to return undefined in some cases #} |
142 if (impl.isNull()) | 143 if (impl.isNull()) |
143 return v8::Null(isolate); | 144 return v8::Null(isolate); |
144 | 145 |
145 {% for member in container.members %} | 146 {% for member in container.members %} |
146 if (impl.is{{member.type_name}}()) | 147 if (impl.is{{member.type_name}}()) |
147 return {{member.cpp_value_to_v8_value}}; | 148 return {{member.cpp_value_to_v8_value}}; |
148 | 149 |
149 {% endfor %} | 150 {% endfor %} |
150 ASSERT_NOT_REACHED(); | 151 ASSERT_NOT_REACHED(); |
151 return v8::Handle<v8::Value>(); | 152 return v8::Handle<v8::Value>(); |
152 } | 153 } |
153 | 154 |
154 {% endfor %} | 155 {% endfor %} |
155 } // namespace blink | 156 } // namespace blink |
OLD | NEW |