Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(252)

Side by Side Diff: Source/bindings/scripts/idl_types.py

Issue 556893002: Move IdlType.may_raise_exception_on_conversion to v8_types.py (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | Source/bindings/scripts/v8_attributes.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 """IDL type handling. 4 """IDL type handling.
5 5
6 Classes: 6 Classes:
7 IdlTypeBase 7 IdlTypeBase
8 IdlType 8 IdlType
9 IdlUnionType 9 IdlUnionType
10 IdlArrayOrSequenceType 10 IdlArrayOrSequenceType
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 self.is_enum or 190 self.is_enum or
191 self.name == 'Any' or 191 self.name == 'Any' or
192 self.name == 'Object' or 192 self.name == 'Object' or
193 self.name == 'Promise') # Promise will be basic in future 193 self.name == 'Promise') # Promise will be basic in future
194 194
195 @property 195 @property
196 def is_string_type(self): 196 def is_string_type(self):
197 return self.name in STRING_TYPES 197 return self.name in STRING_TYPES
198 198
199 @property 199 @property
200 def may_raise_exception_on_conversion(self):
201 return (self.is_integer_type or
202 self.name in ('ByteString', 'ScalarValueString'))
203
204 @property
205 def is_union_type(self): 200 def is_union_type(self):
206 return isinstance(self, IdlUnionType) 201 return isinstance(self, IdlUnionType)
207 202
208 @property 203 @property
209 def name(self): 204 def name(self):
210 """Return type name 205 """Return type name
211 206
212 http://heycam.github.io/webidl/#dfn-type-name 207 http://heycam.github.io/webidl/#dfn-type-name
213 """ 208 """
214 base_type = self.base_type 209 base_type = self.base_type
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 def is_nullable(self): 324 def is_nullable(self):
330 return True 325 return True
331 326
332 @property 327 @property
333 def name(self): 328 def name(self):
334 return self.inner_type.name + 'OrNull' 329 return self.inner_type.name + 'OrNull'
335 330
336 def resolve_typedefs(self, typedefs): 331 def resolve_typedefs(self, typedefs):
337 self.inner_type = self.inner_type.resolve_typedefs(typedefs) 332 self.inner_type = self.inner_type.resolve_typedefs(typedefs)
338 return self 333 return self
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/scripts/v8_attributes.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698