| OLD | NEW |
| 1 # Copyright (C) 2013 Google Inc. All rights reserved. | 1 # Copyright (C) 2013 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 return '0' | 298 return '0' |
| 299 return '%sV8Internal::%sAttributeSetterCallback' % (cpp_class_name, attribut
e.name) | 299 return '%sV8Internal::%sAttributeSetterCallback' % (cpp_class_name, attribut
e.name) |
| 300 | 300 |
| 301 | 301 |
| 302 # [DoNotCheckSecurity], [Unforgeable] | 302 # [DoNotCheckSecurity], [Unforgeable] |
| 303 def access_control_list(attribute): | 303 def access_control_list(attribute): |
| 304 extended_attributes = attribute.extended_attributes | 304 extended_attributes = attribute.extended_attributes |
| 305 access_control = [] | 305 access_control = [] |
| 306 if 'DoNotCheckSecurity' in extended_attributes: | 306 if 'DoNotCheckSecurity' in extended_attributes: |
| 307 do_not_check_security = extended_attributes['DoNotCheckSecurity'] | 307 do_not_check_security = extended_attributes['DoNotCheckSecurity'] |
| 308 if do_not_check_security == 'Getter': | 308 if do_not_check_security == 'Setter': |
| 309 access_control.append('v8::ALL_CAN_READ') | |
| 310 elif do_not_check_security == 'Setter': | |
| 311 access_control.append('v8::ALL_CAN_WRITE') | 309 access_control.append('v8::ALL_CAN_WRITE') |
| 312 else: | 310 else: |
| 313 access_control.append('v8::ALL_CAN_READ') | 311 access_control.append('v8::ALL_CAN_READ') |
| 314 if not attribute.is_read_only: | 312 if not attribute.is_read_only: |
| 315 access_control.append('v8::ALL_CAN_WRITE') | 313 access_control.append('v8::ALL_CAN_WRITE') |
| 316 if 'Unforgeable' in extended_attributes: | 314 if 'Unforgeable' in extended_attributes: |
| 317 access_control.append('v8::PROHIBITS_OVERWRITING') | 315 access_control.append('v8::PROHIBITS_OVERWRITING') |
| 318 return access_control or ['v8::DEFAULT'] | 316 return access_control or ['v8::DEFAULT'] |
| 319 | 317 |
| 320 | 318 |
| 321 # [NotEnumerable], [Unforgeable] | 319 # [NotEnumerable], [Unforgeable] |
| 322 def property_attributes(attribute): | 320 def property_attributes(attribute): |
| 323 extended_attributes = attribute.extended_attributes | 321 extended_attributes = attribute.extended_attributes |
| 324 property_attributes_list = [] | 322 property_attributes_list = [] |
| 325 if ('NotEnumerable' in extended_attributes or | 323 if ('NotEnumerable' in extended_attributes or |
| 326 is_constructor_attribute(attribute)): | 324 is_constructor_attribute(attribute)): |
| 327 property_attributes_list.append('v8::DontEnum') | 325 property_attributes_list.append('v8::DontEnum') |
| 328 if 'Unforgeable' in extended_attributes: | 326 if 'Unforgeable' in extended_attributes: |
| 329 property_attributes_list.append('v8::DontDelete') | 327 property_attributes_list.append('v8::DontDelete') |
| 330 return property_attributes_list or ['v8::None'] | 328 return property_attributes_list or ['v8::None'] |
| 331 | 329 |
| 332 | 330 |
| 333 def is_constructor_attribute(attribute): | 331 def is_constructor_attribute(attribute): |
| 334 return attribute.idl_type.endswith('Constructor') | 332 return attribute.idl_type.endswith('Constructor') |
| OLD | NEW |